diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-07 05:12:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-07 05:12:37 +0000 |
commit | cdfcc2dee6655f84076f373ce74e8caf8e5cf556 (patch) | |
tree | 984bb00aaa59e8bf86a7ea30a3c7eb6734d7708c /llvm/lib/Bitcode | |
parent | 1d4313b26166b136b59eb9f743f460b6a355c9ff (diff) | |
download | bcm5719-llvm-cdfcc2dee6655f84076f373ce74e8caf8e5cf556.tar.gz bcm5719-llvm-cdfcc2dee6655f84076f373ce74e8caf8e5cf556.zip |
use a more efficient check for 'is metadata'
llvm-svn: 134599
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.h b/llvm/lib/Bitcode/Reader/BitcodeReader.h index 9bab00e4527..1fa6f827b9c 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.h +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.h @@ -44,9 +44,9 @@ class BitcodeReaderValueList { /// number that holds the resolved value. typedef std::vector<std::pair<Constant*, unsigned> > ResolveConstantsTy; ResolveConstantsTy ResolveConstants; - LLVMContext& Context; + LLVMContext &Context; public: - BitcodeReaderValueList(LLVMContext& C) : Context(C) {} + BitcodeReaderValueList(LLVMContext &C) : Context(C) {} ~BitcodeReaderValueList() { assert(ResolveConstants.empty() && "Constants not resolved?"); } @@ -212,10 +212,9 @@ public: private: const Type *getTypeByID(unsigned ID, bool isTypeTable = false); Value *getFnValueByID(unsigned ID, const Type *Ty) { - if (Ty == Type::getMetadataTy(Context)) + if (Ty->isMetadataTy()) return MDValueList.getValueFwdRef(ID); - else - return ValueList.getValueFwdRef(ID, Ty); + return ValueList.getValueFwdRef(ID, Ty); } BasicBlock *getBasicBlock(unsigned ID) const { if (ID >= FunctionBBs.size()) return 0; // Invalid ID |