diff options
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Archive/ArchiveReader.cpp | 2 | ||||
-rw-r--r-- | lib/Bytecode/Reader/ArchiveReader.cpp | 2 | ||||
-rw-r--r-- | lib/Bytecode/Reader/Reader.cpp | 14 | ||||
-rw-r--r-- | lib/Bytecode/Reader/ReaderWrappers.cpp | 6 | ||||
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.cpp | 4 | ||||
-rw-r--r-- | lib/Bytecode/Writer/Writer.cpp | 4 | ||||
-rw-r--r-- | lib/Bytecode/Writer/WriterInternals.h | 2 |
7 files changed, 20 insertions, 14 deletions
diff --git a/lib/Bytecode/Archive/ArchiveReader.cpp b/lib/Bytecode/Archive/ArchiveReader.cpp index 1d8530f..50e11d6 100644 --- a/lib/Bytecode/Archive/ArchiveReader.cpp +++ b/lib/Bytecode/Archive/ArchiveReader.cpp @@ -18,7 +18,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Module.h" -#include "Support/FileUtilities.h" +#include "llvm/Support/FileUtilities.h" #include <cstdlib> #include <iostream> using namespace llvm; diff --git a/lib/Bytecode/Reader/ArchiveReader.cpp b/lib/Bytecode/Reader/ArchiveReader.cpp index 1d8530f..50e11d6 100644 --- a/lib/Bytecode/Reader/ArchiveReader.cpp +++ b/lib/Bytecode/Reader/ArchiveReader.cpp @@ -18,7 +18,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Module.h" -#include "Support/FileUtilities.h" +#include "llvm/Support/FileUtilities.h" #include <cstdlib> #include <iostream> using namespace llvm; diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp index f0b39d4..39f238c 100644 --- a/lib/Bytecode/Reader/Reader.cpp +++ b/lib/Bytecode/Reader/Reader.cpp @@ -24,7 +24,7 @@ #include "llvm/SymbolTable.h" #include "llvm/Bytecode/Format.h" #include "llvm/Support/GetElementPtrTypeIterator.h" -#include "Support/StringExtras.h" +#include "llvm/ADT/StringExtras.h" #include <sstream> using namespace llvm; @@ -428,14 +428,20 @@ Value * BytecodeReader::getValue(unsigned type, unsigned oNum, bool Create) { if (!Create) return 0; // Do not create a placeholder? + // Did we already create a place holder? std::pair<unsigned,unsigned> KeyValue(type, oNum); ForwardReferenceMap::iterator I = ForwardReferences.lower_bound(KeyValue); if (I != ForwardReferences.end() && I->first == KeyValue) return I->second; // We have already created this placeholder - Value *Val = new Argument(getType(type)); - ForwardReferences.insert(I, std::make_pair(KeyValue, Val)); - return Val; + // If the type exists (it should) + if (const Type* Ty = getType(type)) { + // Create the place holder + Value *Val = new Argument(Ty); + ForwardReferences.insert(I, std::make_pair(KeyValue, Val)); + return Val; + } + throw "Can't create placeholder for value of type slot #" + utostr(type); } /// This is just like getValue, but when a compaction table is in use, it diff --git a/lib/Bytecode/Reader/ReaderWrappers.cpp b/lib/Bytecode/Reader/ReaderWrappers.cpp index 2930a42..383e53e 100644 --- a/lib/Bytecode/Reader/ReaderWrappers.cpp +++ b/lib/Bytecode/Reader/ReaderWrappers.cpp @@ -17,9 +17,9 @@ #include "Reader.h" #include "llvm/Module.h" #include "llvm/Instructions.h" -#include "Support/FileUtilities.h" -#include "Support/StringExtras.h" -#include "Config/unistd.h" +#include "llvm/Support/FileUtilities.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/Config/unistd.h" #include <cerrno> using namespace llvm; diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index 2656edd..d4145db 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/lib/Bytecode/Writer/SlotCalculator.cpp @@ -23,8 +23,8 @@ #include "llvm/SymbolTable.h" #include "llvm/Type.h" #include "llvm/Analysis/ConstantsScanner.h" -#include "Support/PostOrderIterator.h" -#include "Support/STLExtras.h" +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/ADT/STLExtras.h" #include <algorithm> #include <functional> diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index 7db2148..60a48cc 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -25,8 +25,8 @@ #include "llvm/Module.h" #include "llvm/SymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" -#include "Support/STLExtras.h" -#include "Support/Statistic.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/Statistic.h" #include <cstring> #include <algorithm> using namespace llvm; diff --git a/lib/Bytecode/Writer/WriterInternals.h b/lib/Bytecode/Writer/WriterInternals.h index e496da9..8b5f99e 100644 --- a/lib/Bytecode/Writer/WriterInternals.h +++ b/lib/Bytecode/Writer/WriterInternals.h @@ -23,7 +23,7 @@ #include "llvm/Bytecode/Writer.h" #include "llvm/Bytecode/Format.h" #include "llvm/Instruction.h" -#include "Support/DataTypes.h" +#include "llvm/Support/DataTypes.h" #include <string> #include <vector> |