diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-26 11:19:15 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-26 11:19:15 -0700 |
commit | bb186d9ec3a98cec5290410982309e0b35765231 (patch) | |
tree | 6b1ddc83d236dbd5a01a33063353b81b472b103a /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | |
parent | afa589d27ad90bcfebae9566dd31785d4ba9696f (diff) |
PNaCl wire format: Remove the METADATA_BLOCK block from pexes
Despite removing metadata at the IR level, the writer was still
outputting a METADATA_BLOCK containing built-in strings such as "dbg",
"tbaa" and "fpmath".
Remove this by removing metadata support from the reader and writer.
I've removed most references to "metadata" and "MD".
I've also removed DEBUG_LOC handling, since that depends on
MDValueList in the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3518
TEST=PNaCl toolchain trybots + check hello_world.final.pexe in bcanalyzer
Review URL: https://codereview.chromium.org/17761005
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h')
-rw-r--r-- | lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h index e6ea6266be..5256e07134 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h @@ -93,40 +93,6 @@ public: }; -//===----------------------------------------------------------------------===// -// NaClBitcodeReaderMDValueList Class -//===----------------------------------------------------------------------===// - -class NaClBitcodeReaderMDValueList { - std::vector<WeakVH> MDValuePtrs; - - LLVMContext &Context; -public: - NaClBitcodeReaderMDValueList(LLVMContext& C) : Context(C) {} - - // vector compatibility methods - unsigned size() const { return MDValuePtrs.size(); } - void resize(unsigned N) { MDValuePtrs.resize(N); } - void push_back(Value *V) { MDValuePtrs.push_back(V); } - void clear() { MDValuePtrs.clear(); } - Value *back() const { return MDValuePtrs.back(); } - void pop_back() { MDValuePtrs.pop_back(); } - bool empty() const { return MDValuePtrs.empty(); } - - Value *operator[](unsigned i) const { - assert(i < MDValuePtrs.size()); - return MDValuePtrs[i]; - } - - void shrinkTo(unsigned N) { - assert(N <= size() && "Invalid shrinkTo request!"); - MDValuePtrs.resize(N); - } - - Value *getValueFwdRef(unsigned Idx); - void AssignValue(Value *V, unsigned Idx); -}; - class NaClBitcodeReader : public GVMaterializer { NaClBitcodeHeader Header; // Header fields of the PNaCl bitcode file. LLVMContext &Context; @@ -143,7 +109,6 @@ class NaClBitcodeReader : public GVMaterializer { std::vector<Type*> TypeList; NaClBitcodeReaderValueList ValueList; - NaClBitcodeReaderMDValueList MDValueList; SmallVector<Instruction *, 64> InstructionList; SmallVector<SmallVector<uint64_t, 64>, 64> UseListRecords; @@ -163,9 +128,6 @@ class NaClBitcodeReader : public GVMaterializer { typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap; UpgradedIntrinsicMap UpgradedIntrinsics; - // Map the bitcode's custom MDKind ID to the Module's MDKind ID. - DenseMap<unsigned, unsigned> MDKindMap; - // Several operations happen after the module header has been read, but // before function bodies are processed. This keeps track of whether // we've done this yet. @@ -198,7 +160,7 @@ public: bool AcceptSupportedOnly = true) : Context(C), TheModule(0), Buffer(buffer), BufferOwned(false), LazyStreamer(0), NextUnreadBit(0), SeenValueSymbolTable(false), - ErrorString(0), ValueList(C), MDValueList(C), + ErrorString(0), ValueList(C), SeenFirstFunctionBody(false), UseRelativeIDs(false), AcceptSupportedBitcodeOnly(AcceptSupportedOnly) { } @@ -206,7 +168,7 @@ public: bool AcceptSupportedOnly = true) : Context(C), TheModule(0), Buffer(0), BufferOwned(false), LazyStreamer(streamer), NextUnreadBit(0), SeenValueSymbolTable(false), - ErrorString(0), ValueList(C), MDValueList(C), + ErrorString(0), ValueList(C), SeenFirstFunctionBody(false), UseRelativeIDs(false), AcceptSupportedBitcodeOnly(AcceptSupportedOnly) { } @@ -248,8 +210,6 @@ private: // Gets or creates the (function-level) forward referenced value for // ID with the given type. Value *getOrCreateFnValueByID(unsigned ID, Type *Ty) { - if (Ty && Ty->isMetadataTy()) - return MDValueList.getValueFwdRef(ID); return ValueList.getOrCreateValueFwdRef(ID, Ty); } // Returns the value associated with ID. The value must already exist, @@ -330,8 +290,6 @@ private: bool ParseFunctionBody(Function *F); bool GlobalCleanup(); bool ResolveGlobalAndAliasInits(); - bool ParseMetadata(); - bool ParseMetadataAttachment(); bool ParseUseLists(); bool InitStream(); bool InitStreamFromBuffer(); |