aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-07 05:12:37 +0000
committerChris Lattner <sabre@nondot.org>2011-07-07 05:12:37 +0000
commit7af453a3bdc069ef769c3d3ba02f57b4271c56d0 (patch)
tree0590135ff89e15da8420efeaacf71479596a0d66
parentb99e412650d25776686b46e743751f4ba97a2e4e (diff)
downloadexternal_llvm-7af453a3bdc069ef769c3d3ba02f57b4271c56d0.zip
external_llvm-7af453a3bdc069ef769c3d3ba02f57b4271c56d0.tar.gz
external_llvm-7af453a3bdc069ef769c3d3ba02f57b4271c56d0.tar.bz2
use a more efficient check for 'is metadata'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134599 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index 9bab00e..1fa6f82 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/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