[cfe-commits] r67219 - in /cfe/trunk: lib/CodeGen/CGExpr.cpp test/CodeGen/exprs.c
Chris Lattner
sabre at nondot.org
Wed Mar 18 11:30:44 PDT 2009
Author: lattner
Date: Wed Mar 18 13:30:44 2009
New Revision: 67219
URL: http://llvm.org/viewvc/llvm-project?rev=67219&view=rev
Log:
fix the more complex cases by actually codegen'ing the right expr :)
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/test/CodeGen/exprs.c
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=67219&r1=67218&r2=67219&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Wed Mar 18 13:30:44 2009
@@ -1024,7 +1024,7 @@
// Casts are only lvalues when the source and destination types are the same.
llvm::Value *Temp = CreateTempAlloca(ConvertType(E->getType()));
- EmitAnyExpr(E, Temp, false);
+ EmitAnyExpr(E->getSubExpr(), Temp, false);
return LValue::MakeAddr(Temp, E->getType().getCVRQualifiers(),
getContext().getObjCGCAttrKind(E->getType()));
Modified: cfe/trunk/test/CodeGen/exprs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exprs.c?rev=67219&r1=67218&r2=67219&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/exprs.c (original)
+++ cfe/trunk/test/CodeGen/exprs.c Wed Mar 18 13:30:44 2009
@@ -82,3 +82,9 @@
union f3_x {int x; float y;};
int f3() {return ((union f3_x)2).x;}
+union f4_y {int x; _Complex float y;};
+_Complex float f4() {return ((union f4_y)(_Complex float)2.0).y;}
+
+struct f5_a { int a; } f5_a;
+union f5_z {int x; struct f5_a y;};
+struct f5_a f5() {return ((union f5_z)f5_a).y;}
More information about the cfe-commits
mailing list