[cfe-commits] r69747 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp test/CodeGen/exprs.c

Chris Lattner sabre at nondot.org
Tue Apr 21 16:00:09 PDT 2009


Author: lattner
Date: Tue Apr 21 18:00:09 2009
New Revision: 69747

URL: http://llvm.org/viewvc/llvm-project?rev=69747&view=rev
Log:
fix PR4026: Clang can't codegen __func__ without implicit cast

Modified:
    cfe/trunk/lib/CodeGen/CGExprAgg.cpp
    cfe/trunk/test/CodeGen/exprs.c

Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=69747&r1=69746&r2=69747&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Tue Apr 21 18:00:09 2009
@@ -64,16 +64,19 @@
   void VisitMemberExpr(MemberExpr *ME) { EmitAggLoadOfLValue(ME); }
   void VisitUnaryDeref(UnaryOperator *E) { EmitAggLoadOfLValue(E); }
   void VisitStringLiteral(StringLiteral *E) { EmitAggLoadOfLValue(E); }
-  void VisitCompoundLiteralExpr(CompoundLiteralExpr *E)
-      { EmitAggLoadOfLValue(E); }
-
+  void VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
+    EmitAggLoadOfLValue(E); 
+  }
   void VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
     EmitAggLoadOfLValue(E);
   }
+  void VisitBlockDeclRefExpr(const BlockDeclRefExpr *E) {
+    EmitAggLoadOfLValue(E); 
+  }
+  void VisitPredefinedExpr(const PredefinedExpr *E) {
+    EmitAggLoadOfLValue(E); 
+  }
   
-  void VisitBlockDeclRefExpr(const BlockDeclRefExpr *E)
-      { EmitAggLoadOfLValue(E); }
-
   // Operators.
   //  case Expr::UnaryOperatorClass:
   //  case Expr::CastExprClass: 

Modified: cfe/trunk/test/CodeGen/exprs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exprs.c?rev=69747&r1=69746&r2=69747&view=diff

==============================================================================
--- cfe/trunk/test/CodeGen/exprs.c (original)
+++ cfe/trunk/test/CodeGen/exprs.c Tue Apr 21 18:00:09 2009
@@ -94,3 +94,8 @@
 int f6(int a0, struct s6 a1, struct s6 a2) {
   return (a0 ? a1 : a2).f0;
 }
+
+// PR4026
+void f7() {
+  __func__;
+}





More information about the cfe-commits mailing list