diff options
author | Karl Schimpf <kschimpf@google.com> | 2013-09-06 13:27:38 -0700 |
---|---|---|
committer | Karl Schimpf <kschimpf@google.com> | 2013-09-06 13:27:38 -0700 |
commit | 9b86d1e242fec1dce22eda36b8f2eb3d6f1cc380 (patch) | |
tree | a732249a07bdb6aacd4d783152d8032674a89768 /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | |
parent | 38a5426a06d06aa18de1cc332411c04c348b01e4 (diff) |
Clean up vestigial code for constants in PNaCl bitcode files.
* Removes code that is no longer used because global variables are handled
separately.
* Removes CST_CODE_NULL.
* Adds special abbreviations for constant integer 0, replacing
most of what was lost when CST_CODE_NULL is removed.
* Adds abbreviation for floating point constants.
* Removes CST_CODE_AGGREGATE and CST_CODE_DATA, except for reading
old PNaCl version 1 bitcode files.
* Removes call to ParseConstants() in ParseModule() since the module
block no longer contains a constants block (globals are handled
separately).
* Removes getConstantFwdRef() method, since it is no longer needed.
* Remove ConstantPlaceHolder class, since it is no longer needed.
* Remove ResolvedConstants and ResolveConstantForwardRefs()
from the bitcode reader, since it is no longer needed.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3668
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/23522024
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h')
-rw-r--r-- | lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h index f69fdbdfd4..318fcb1470 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h @@ -77,22 +77,10 @@ public: class NaClBitcodeReaderValueList { std::vector<WeakVH> ValuePtrs; - - /// ResolveConstants - As we resolve forward-referenced constants, we add - /// information about them to this vector. This allows us to resolve them in - /// bulk instead of resolving each reference at a time. See the code in - /// ResolveConstantForwardRefs for more information about this. - /// - /// The key of this vector is the placeholder constant, the value is the slot - /// number that holds the resolved value. - typedef std::vector<std::pair<Constant*, unsigned> > ResolveConstantsTy; - ResolveConstantsTy ResolveConstants; LLVMContext &Context; public: NaClBitcodeReaderValueList(LLVMContext &C) : Context(C) {} - ~NaClBitcodeReaderValueList() { - assert(ResolveConstants.empty() && "Constants not resolved?"); - } + ~NaClBitcodeReaderValueList() {} // vector compatibility methods unsigned size() const { return ValuePtrs.size(); } @@ -102,7 +90,6 @@ public: } void clear() { - assert(ResolveConstants.empty() && "Constants not resolved?"); ValuePtrs.clear(); } @@ -124,12 +111,6 @@ public: // already been declared. bool createValueFwdRef(unsigned Idx, Type *Ty); - // Declares the type of the forward-referenced constant Idx. - // Returns 0 if an error occurred. - // TODO(kschimpf) Convert these to be like createValueFwdRef and - // getValueFwdRef. - Constant *getConstantFwdRef(unsigned Idx, Type *Ty); - // Gets the forward reference value for Idx. Value *getValueFwdRef(unsigned Idx); @@ -149,10 +130,6 @@ public: // replaces uses of the global variable forward reference with the // value GV. void AssignGlobalVar(GlobalVariable *GV, unsigned Idx); - - /// ResolveConstantForwardRefs - Once all constants are read, this method bulk - /// resolves any forward references. - void ResolveConstantForwardRefs(); }; |