summaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-01 22:55:40 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-01 22:55:40 +0000
commit551ccae044b0ff658fe629dd67edd5ffe75d10e8 (patch)
treed7fa643a1f1f12dbc4ee049bcc7a032a49b17d51 /lib/Bytecode/Reader
parented543731fb385b55750d0c514d130a810339d739 (diff)
downloadllvm-551ccae044b0ff658fe629dd67edd5ffe75d10e8.tar.gz
llvm-551ccae044b0ff658fe629dd67edd5ffe75d10e8.tar.bz2
llvm-551ccae044b0ff658fe629dd67edd5ffe75d10e8.tar.xz
Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader')
-rw-r--r--lib/Bytecode/Reader/ArchiveReader.cpp2
-rw-r--r--lib/Bytecode/Reader/Reader.cpp14
-rw-r--r--lib/Bytecode/Reader/ReaderWrappers.cpp6
3 files changed, 14 insertions, 8 deletions
diff --git a/lib/Bytecode/Reader/ArchiveReader.cpp b/lib/Bytecode/Reader/ArchiveReader.cpp
index 1d8530fc78..50e11d6ab5 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 f0b39d45de..39f238c986 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 2930a42c63..383e53e9be 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;