summaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 13:12:22 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 13:12:22 +0000
commitf012705c7e4ca8cf90b6b734ce1d5355daca5ba5 (patch)
treed1bcdd1cfc5ddc28894a9b9d6cbb2875d922e437 /lib/AsmParser/LLParser.cpp
parent804272c8d6fd960c47c8cbc1603aba3fe5a65ea8 (diff)
downloadllvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.gz
llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.bz2
llvm-f012705c7e4ca8cf90b6b734ce1d5355daca5ba5.tar.xz
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/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 15a9832731..01cd531dac 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -1715,8 +1715,7 @@ Value *LLParser::PerFunctionState::GetVal(const std::string &Name,
}
// Don't make placeholders with invalid type.
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) &&
- Ty != Type::getLabelTy(F.getContext())) {
+ if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) && !Ty->isLabelTy()) {
P.Error(Loc, "invalid use of a non-first-class type");
return 0;
}
@@ -1757,8 +1756,7 @@ Value *LLParser::PerFunctionState::GetVal(unsigned ID, const Type *Ty,
return 0;
}
- if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) &&
- Ty != Type::getLabelTy(F.getContext())) {
+ if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty) && !Ty->isLabelTy()) {
P.Error(Loc, "invalid use of a non-first-class type");
return 0;
}
@@ -2663,8 +2661,7 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
AttrListPtr PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
- if (PAL.paramHasAttr(1, Attribute::StructRet) &&
- RetType != Type::getVoidTy(Context))
+ if (PAL.paramHasAttr(1, Attribute::StructRet) && !RetType->isVoidTy())
return Error(RetTypeLoc, "functions with 'sret' argument must return void");
const FunctionType *FT =