[cfe-commits] r45023 - in /cfe/trunk: CodeGen/CGExprAgg.cpp test/CodeGen/struct.c
Seo Sanghyeon
sanxiyn at gmail.com
Thu Dec 13 18:04:12 PST 2007
Author: sanxiyn
Date: Thu Dec 13 20:04:12 2007
New Revision: 45023
URL: http://llvm.org/viewvc/llvm-project?rev=45023&view=rev
Log:
Array subscription in aggregate expression
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=45023&r1=45022&r2=45023&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/CodeGen/CGExprAgg.cpp Thu Dec 13 20:04:12 2007
@@ -59,11 +59,13 @@
void VisitParenExpr(ParenExpr *PE) { Visit(PE->getSubExpr()); }
// l-values.
- void VisitDeclRefExpr(DeclRefExpr *DRE) { return EmitAggLoadOfLValue(DRE); }
- void VisitMemberExpr(MemberExpr *ME) { return EmitAggLoadOfLValue(ME); }
- void VisitUnaryDeref(UnaryOperator *E) { return EmitAggLoadOfLValue(E); }
-
- // case Expr::ArraySubscriptExprClass:
+ void VisitDeclRefExpr(DeclRefExpr *DRE) { EmitAggLoadOfLValue(DRE); }
+ void VisitMemberExpr(MemberExpr *ME) { EmitAggLoadOfLValue(ME); }
+ void VisitUnaryDeref(UnaryOperator *E) { EmitAggLoadOfLValue(E); }
+
+ void VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
+ EmitAggLoadOfLValue(E);
+ }
// Operators.
// case Expr::UnaryOperatorClass:
Modified: cfe/trunk/test/CodeGen/struct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/struct.c?rev=45023&r1=45022&r2=45023&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/struct.c (original)
+++ cfe/trunk/test/CodeGen/struct.c Thu Dec 13 20:04:12 2007
@@ -94,6 +94,11 @@
range r = *p;
}
+void f10(range *p)
+{
+ range r = p[0];
+}
+
/* _Bool types */
struct _w
More information about the cfe-commits
mailing list