diff options
author | Karl Schimpf <kschimpf@google.com> | 2013-07-22 12:34:53 -0700 |
---|---|---|
committer | Karl Schimpf <kschimpf@google.com> | 2013-07-22 12:34:53 -0700 |
commit | b88a634f28cbfeade16b68d1d99fb58e27e311b4 (patch) | |
tree | c67e307540360ded8512a556909bd818d9f1881d /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | |
parent | 9b2942831f43dd9a5802565b9996bdf2c0bfd896 (diff) |
Remove module info records not allowed by PNaCl from the bitcode.
Remove dead code for:
(1) Top-level inline assembly.
(2) Remove code for named sections.
(3) Remove code for GC names.
(4) Global variable aliases.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18770005
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h')
-rw-r--r-- | lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h index 4105eb53b8..3b9d8982d5 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h @@ -126,14 +126,12 @@ class NaClBitcodeReader : public GVMaterializer { uint64_t NextUnreadBit; bool SeenValueSymbolTable; - const char *ErrorString; + std::string ErrorString; std::vector<Type*> TypeList; NaClBitcodeReaderValueList ValueList; SmallVector<SmallVector<uint64_t, 64>, 64> UseListRecords; - std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits; - /// FunctionBBs - While parsing a function body, this is a list of the basic /// blocks for the function. std::vector<BasicBlock*> FunctionBBs; @@ -179,7 +177,7 @@ public: bool AcceptSupportedOnly = true) : Context(C), TheModule(0), Buffer(buffer), BufferOwned(false), LazyStreamer(0), NextUnreadBit(0), SeenValueSymbolTable(false), - ErrorString(0), ValueList(C), + ValueList(C), SeenFirstFunctionBody(false), UseRelativeIDs(false), AcceptSupportedBitcodeOnly(AcceptSupportedOnly) { } @@ -187,7 +185,7 @@ public: bool AcceptSupportedOnly = true) : Context(C), TheModule(0), Buffer(0), BufferOwned(false), LazyStreamer(streamer), NextUnreadBit(0), SeenValueSymbolTable(false), - ErrorString(0), ValueList(C), + ValueList(C), SeenFirstFunctionBody(false), UseRelativeIDs(false), AcceptSupportedBitcodeOnly(AcceptSupportedOnly) { } @@ -213,7 +211,11 @@ public: ErrorString = Str; return true; } - const char *getErrorString() const { return ErrorString; } + bool Error(const std::string &Str) { + ErrorString = Str; + return true; + } + const char *getErrorString() const { return ErrorString.c_str(); } /// @brief Main interface to parsing a bitcode buffer. /// @returns true if an error occurred. @@ -282,7 +284,6 @@ private: bool RememberAndSkipFunctionBody(); bool ParseFunctionBody(Function *F); bool GlobalCleanup(); - bool ResolveAliasInits(); bool ParseUseLists(); bool InitStream(); bool InitStreamFromBuffer(); |