aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprConstant.cpp
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
commit7f215c12af4c3e7f81b24102a676aabfdb4e1566 (patch)
tree55a24deb60276747a4c968a7c9b69accef36f761 /lib/CodeGen/CGExprConstant.cpp
parent9a20723df5904f2da9e4da14bf127366609b5cd8 (diff)
use more efficient type comparison predicates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index a145a66b59..d4c387796f 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/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);
}