[cfe-commits] r41427 - /cfe/trunk/CodeGen/CGExprScalar.cpp
Chris Lattner
sabre at nondot.org
Sat Aug 25 22:29:21 PDT 2007
Author: lattner
Date: Sun Aug 26 00:29:21 2007
New Revision: 41427
URL: http://llvm.org/viewvc/llvm-project?rev=41427&view=rev
Log:
implement codegen of __imag of a scalar. Our impl doesn't suffer from
GCC bug PR33192.
Modified:
cfe/trunk/CodeGen/CGExprScalar.cpp
Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=41427&r1=41426&r2=41427&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Sun Aug 26 00:29:21 2007
@@ -393,9 +393,11 @@
Expr *Op = E->getSubExpr();
if (Op->getType()->isComplexType())
return CGF.EmitComplexExpr(Op).second;
-
- // FIXME: does this evaluate the subexpr??
- return 0; // FIXME: Return zero of the right int/fp type.
+
+ // __imag on a scalar returns zero. Emit it the subexpr to ensure side
+ // effects are evaluated.
+ CGF.EmitScalarExpr(Op);
+ return llvm::Constant::getNullValue(ConvertType(E->getType()));
}
More information about the cfe-commits
mailing list