[cfe-commits] r43641 - in /cfe/trunk: CodeGen/CGExprAgg.cpp test/CodeGen/struct.c
Anders Carlsson
andersca at mac.com
Fri Nov 2 09:59:10 PDT 2007
Author: andersca
Date: Fri Nov 2 11:59:10 2007
New Revision: 43641
URL: http://llvm.org/viewvc/llvm-project?rev=43641&view=rev
Log:
Generate code for member exprs.
Modified:
cfe/trunk/CodeGen/CGExprAgg.cpp
cfe/trunk/test/CodeGen/struct.c
Modified: cfe/trunk/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprAgg.cpp?rev=43641&r1=43640&r2=43641&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/CodeGen/CGExprAgg.cpp Fri Nov 2 11:59:10 2007
@@ -61,6 +61,8 @@
// l-values.
void VisitDeclRefExpr(DeclRefExpr *DRE) { return EmitAggLoadOfLValue(DRE); }
+ void VisitMemberExpr(MemberExpr *ME) { return EmitAggLoadOfLValue(ME); }
+
// case Expr::ArraySubscriptExprClass:
// Operators.
Modified: cfe/trunk/test/CodeGen/struct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/struct.c?rev=43641&r1=43640&r2=43641&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/struct.c (original)
+++ cfe/trunk/test/CodeGen/struct.c Fri Nov 2 11:59:10 2007
@@ -73,7 +73,20 @@
extern range f6();
void f7()
{
- range r = f6();
+ range r = f6();
+}
+
+/* Member expressions */
+typedef struct {
+ range range1;
+ range range2;
+} rangepair;
+
+void f8()
+{
+ rangepair p;
+
+ range r = p.range1;
}
More information about the cfe-commits
mailing list