From 775640d24847323639a99ea34643a05ffac6c247 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Tue, 19 May 2009 18:44:53 +0000 Subject: Don't always zext the result of the not unary operator to an int. llvm-svn: 72117 --- clang/lib/CodeGen/CGExprScalar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CGExprScalar.cpp') diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 6ceb2a67900..05573d6aec3 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -719,8 +719,8 @@ Value *ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *E) { // the operand is an icmp ne, turn into icmp eq. BoolVal = Builder.CreateNot(BoolVal, "lnot"); - // ZExt result to int. - return Builder.CreateZExt(BoolVal, CGF.LLVMIntTy, "lnot.ext"); + // ZExt result to the expr type. + return Builder.CreateZExt(BoolVal, ConvertType(E->getType()), "lnot.ext"); } /// VisitSizeOfAlignOfExpr - Return the size or alignment of the type of -- cgit v1.2.3