summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-26 21:52:32 +0000
committerChris Lattner <sabre@nondot.org>2010-06-26 21:52:32 +0000
commitfa20e95043d754afe785530803a24bd1dad76d5f (patch)
treee5537c65fa7095d2e880dc139f39c1efbfd393dc /clang
parent0bf27620f0cd12ba436ae698645cce079611cfb2 (diff)
downloadbcm5719-llvm-fa20e95043d754afe785530803a24bd1dad76d5f.tar.gz
bcm5719-llvm-fa20e95043d754afe785530803a24bd1dad76d5f.zip
use more efficient type comparison predicates.
llvm-svn: 106958
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp2
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp4
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp2
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp4
4 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 5e84ffc06dc..1484334edc0 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -427,7 +427,7 @@ EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
NextVal = Builder.CreateGEP(NextVal, Inc, "ptrincdec");
NextVal = Builder.CreateBitCast(NextVal, InVal->getType());
}
- } else if (InVal->getType() == llvm::Type::getInt1Ty(VMContext) && isInc) {
+ } else if (InVal->getType()->isIntegerTy(1) && isInc) {
// Bool++ is an interesting case, due to promotion rules, we get:
// Bool++ -> Bool = Bool+1 -> Bool = (int)Bool+1 ->
// Bool = ((int)Bool+1) != 0
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index a145a66b59b..d4c387796fe 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -908,7 +908,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
llvm::Constant *C = llvm::ConstantInt::get(VMContext,
Result.Val.getInt());
- if (C->getType() == llvm::Type::getInt1Ty(VMContext)) {
+ if (C->getType()->isIntegerTy(1)) {
const llvm::Type *BoolTy = getTypes().ConvertTypeForMem(E->getType());
C = llvm::ConstantExpr::getZExt(C, BoolTy);
}
@@ -955,7 +955,7 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
}
llvm::Constant* C = ConstExprEmitter(*this, CGF).Visit(const_cast<Expr*>(E));
- if (C && C->getType() == llvm::Type::getInt1Ty(VMContext)) {
+ if (C && C->getType()->isIntegerTy(1)) {
const llvm::Type *BoolTy = getTypes().ConvertTypeForMem(E->getType());
C = llvm::ConstantExpr::getZExt(C, BoolTy);
}
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 773eb09bb61..c5bc320727a 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1424,7 +1424,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) {
return Builder.CreateAdd(Ops.LHS, Ops.RHS, "add");
}
- // Must have binary (not unary) expr here. Unary pointer increment doesn't
+ // Must have binary (not unary) expr here. Unary pointer decrement doesn't
// use this path.
const BinaryOperator *BinOp = cast<BinaryOperator>(Ops.E);
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 1de0ebc41c3..667220063b6 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -1076,7 +1076,7 @@ void X86_64ABIInfo::classify(QualType Ty,
ABIArgInfo X86_64ABIInfo::getCoerceResult(QualType Ty,
const llvm::Type *CoerceTo,
ASTContext &Context) const {
- if (CoerceTo == llvm::Type::getInt64Ty(CoerceTo->getContext())) {
+ if (CoerceTo->isIntegerTy(64)) {
// Integer and pointer types will end up in a general purpose
// register.
@@ -1087,7 +1087,7 @@ ABIArgInfo X86_64ABIInfo::getCoerceResult(QualType Ty,
if (Ty->isIntegralOrEnumerationType() || Ty->hasPointerRepresentation())
return (Ty->isPromotableIntegerType() ?
ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
- } else if (CoerceTo == llvm::Type::getDoubleTy(CoerceTo->getContext())) {
+ } else if (CoerceTo->isDoubleTy()) {
assert(Ty.isCanonical() && "should always have a canonical type here");
assert(!Ty.hasQualifiers() && "should never have a qualified type here");
OpenPOWER on IntegriCloud