]> granicus.if.org Git - clang/commitdiff
Don't always zext the result of the not unary operator to an int.
authorAnders Carlsson <andersca@mac.com>
Tue, 19 May 2009 18:44:53 +0000 (18:44 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 19 May 2009 18:44:53 +0000 (18:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72117 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp

index 6ceb2a67900f9271729d7456bd471d72e42e0a2b..05573d6aec342724d8252076257f3c74a8346f8e 100644 (file)
@@ -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