[llvm-commits] [llvm] r134599 - /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
Chris Lattner
sabre at nondot.org
Wed Jul 6 22:12:37 PDT 2011
Author: lattner
Date: Thu Jul 7 00:12:37 2011
New Revision: 134599
URL: http://llvm.org/viewvc/llvm-project?rev=134599&view=rev
Log:
use a more efficient check for 'is metadata'
Modified:
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h?rev=134599&r1=134598&r2=134599&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h Thu Jul 7 00:12:37 2011
@@ -44,9 +44,9 @@
/// 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 @@
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
More information about the llvm-commits
mailing list