Minor speedup to do less linear time searches of information we already have.
[oota-llvm.git] / lib / Bytecode / Reader / ReaderInternals.h
index 53f699e6d08714eec354e851519e6098c6d8b29d..8522aee4c296220a940f5145d0a8ee8cdbe05276 100644 (file)
@@ -180,7 +180,10 @@ private:
   Value      *getValue(unsigned TypeID, unsigned num, bool Create = true);
   const Type *getType(unsigned ID);
   BasicBlock *getBasicBlock(unsigned ID);
-  Constant   *getConstantValue(const Type *Ty, unsigned num);
+  Constant   *getConstantValue(unsigned TypeID, unsigned num);
+  Constant   *getConstantValue(const Type *Ty, unsigned num) {
+    return getConstantValue(getTypeSlot(Ty), num);
+  }
 
   unsigned insertValue(Value *V, ValueTable &Table);
   unsigned insertValue(Value *V, unsigned Type, ValueTable &Table);