summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Archive/ArchiveReader.cpp1
-rw-r--r--lib/Archive/ArchiveWriter.cpp2
-rw-r--r--lib/Bytecode/Archive/ArchiveReader.cpp1
-rw-r--r--lib/Bytecode/Archive/ArchiveWriter.cpp2
-rw-r--r--lib/Bytecode/Reader/Reader.cpp3
5 files changed, 4 insertions, 5 deletions
diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp
index d4a4921854e..28327df4cb0 100644
--- a/lib/Archive/ArchiveReader.cpp
+++ b/lib/Archive/ArchiveReader.cpp
@@ -90,7 +90,6 @@ Archive::parseMemberHeader(const char*& At, const char* End) {
// a '/' and blanks.
std::string pathname;
- unsigned index;
switch (Hdr->name[0]) {
case '#':
if (Hdr->name[1] == '1' && Hdr->name[2] == '/') {
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index 58e785384cf..5c7b1263204 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -293,7 +293,7 @@ Archive::writeMember(
ARFile.write(data,fSize);
// Make sure the member is an even length
- if (ARFile.tellp() & 1 == 1)
+ if ((ARFile.tellp() & 1) == 1)
ARFile << ARFILE_PAD;
// Free the compressed data, if necessary
diff --git a/lib/Bytecode/Archive/ArchiveReader.cpp b/lib/Bytecode/Archive/ArchiveReader.cpp
index d4a4921854e..28327df4cb0 100644
--- a/lib/Bytecode/Archive/ArchiveReader.cpp
+++ b/lib/Bytecode/Archive/ArchiveReader.cpp
@@ -90,7 +90,6 @@ Archive::parseMemberHeader(const char*& At, const char* End) {
// a '/' and blanks.
std::string pathname;
- unsigned index;
switch (Hdr->name[0]) {
case '#':
if (Hdr->name[1] == '1' && Hdr->name[2] == '/') {
diff --git a/lib/Bytecode/Archive/ArchiveWriter.cpp b/lib/Bytecode/Archive/ArchiveWriter.cpp
index 58e785384cf..5c7b1263204 100644
--- a/lib/Bytecode/Archive/ArchiveWriter.cpp
+++ b/lib/Bytecode/Archive/ArchiveWriter.cpp
@@ -293,7 +293,7 @@ Archive::writeMember(
ARFile.write(data,fSize);
// Make sure the member is an even length
- if (ARFile.tellp() & 1 == 1)
+ if ((ARFile.tellp() & 1) == 1)
ARFile << ARFILE_PAD;
// Free the compressed data, if necessary
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 3f86c1907b0..e9b18e0ceaa 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -19,6 +19,7 @@
#include "Reader.h"
#include "llvm/Bytecode/BytecodeHandler.h"
#include "llvm/BasicBlock.h"
+#include "llvm/Config/alloca.h"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
#include "llvm/SymbolTable.h"
@@ -1501,7 +1502,7 @@ void BytecodeReader::ParseStringConstants(unsigned NumEntries, ValueTable &Tab){
error("String constant data invalid!");
// Read character data. The type tells us how long the string is.
- char Data[ATy->getNumElements()];
+ char *Data = reinterpret_cast<char *>(alloca(ATy->getNumElements()));
read_data(Data, Data+ATy->getNumElements());
std::vector<Constant*> Elements(ATy->getNumElements());