diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 13:12:22 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 13:12:22 +0000 |
commit | f012705c7e4ca8cf90b6b734ce1d5355daca5ba5 (patch) | |
tree | d1bcdd1cfc5ddc28894a9b9d6cbb2875d922e437 /lib/Bitcode | |
parent | 804272c8d6fd960c47c8cbc1603aba3fe5a65ea8 (diff) | |
download | external_llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.zip external_llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.gz external_llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.bz2 |
Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 4 | ||||
-rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 7dffafa..98243e0 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -808,7 +808,7 @@ bool BitcodeReader::ParseMetadata() { const Type *Ty = getTypeByID(Record[i], false); if (Ty->isMetadataTy()) Elts.push_back(MDValueList.getValueFwdRef(Record[i+1])); - else if (Ty != Type::getVoidTy(Context)) + else if (!Ty->isVoidTy()) Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty)); else Elts.push_back(NULL); @@ -2238,7 +2238,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { } // Non-void values get registered in the value table for future use. - if (I && I->getType() != Type::getVoidTy(Context)) + if (I && !I->getType()->isVoidTy()) ValueList.AssignValue(I, NextValueNo++); } diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index d8128db..861de84 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -382,7 +382,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) { // Add all of the instructions. for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) { - if (I->getType() != Type::getVoidTy(F.getContext())) + if (!I->getType()->isVoidTy()) EnumerateValue(I); } } |