use a more efficient check for 'is metadata'
authorChris Lattner <sabre@nondot.org>
Thu, 7 Jul 2011 05:12:37 +0000 (05:12 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Jul 2011 05:12:37 +0000 (05:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134599 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.h

index 9bab00e4527ace9433f95a6d6aed4affb790e762..1fa6f827b9cfcaef91b0e09b56d6bdd896a8c488 100644 (file)
@@ -44,9 +44,9 @@ class BitcodeReaderValueList {
   /// number that holds the resolved value.
   typedef std::vector<std::pair<Constant*, unsigned> > ResolveConstantsTy;
   ResolveConstantsTy ResolveConstants;
-  LLVMContextContext;
+  LLVMContext &Context;
 public:
-  BitcodeReaderValueList(LLVMContextC) : 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