From: Anders Carlsson Date: Tue, 19 May 2009 18:44:53 +0000 (+0000) Subject: Don't always zext the result of the not unary operator to an int. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f84d88a302ea38cf0695ce8cdace47178d2fff4;p=clang Don't always zext the result of the not unary operator to an int. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72117 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 6ceb2a6790..05573d6aec 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/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