summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-01-11 23:22:37 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-01-11 23:22:37 +0000
commita0abe62904c139aa5d6257bf70ec21c1980f541f (patch)
tree10defce23e1ce473cbeaf8bb84e6b2a44d83fe11 /clang/lib/CodeGen
parentfd22768b08338aae974fc118c0dd276f6a64899a (diff)
downloadbcm5719-llvm-a0abe62904c139aa5d6257bf70ec21c1980f541f.tar.gz
bcm5719-llvm-a0abe62904c139aa5d6257bf70ec21c1980f541f.zip
make ScalarExprEmitter::EmitCompare() emit the expression with the correct type instead of always zext it to an int
this fixes codegen of simple exprs in C++ like 'if (x != 0)' llvm-svn: 62060
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index 7b71d7b1294..4bb5fd1a4ff 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1021,9 +1021,8 @@ Value *ScalarExprEmitter::EmitCompare(const BinaryOperator *E,unsigned UICmpOpc,
Result = Builder.CreateOr(ResultR, ResultI, "or.ri");
}
}
-
- // ZExt result to int.
- return Builder.CreateZExt(Result, CGF.LLVMIntTy, "cmp.ext");
+
+ return EmitScalarConversion(Result, CGF.getContext().BoolTy, E->getType());
}
Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) {
OpenPOWER on IntegriCloud