]> granicus.if.org Git - clang/commitdiff
fix PR4026: Clang can't codegen __func__ without implicit cast
authorChris Lattner <sabre@nondot.org>
Tue, 21 Apr 2009 23:00:09 +0000 (23:00 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Apr 2009 23:00:09 +0000 (23:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69747 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprAgg.cpp
test/CodeGen/exprs.c

index 9d6df5c820d5330285afec32f3b03dfbacd7c0a4..2e45f2017b422717fc5d45736ca55e729b2139e9 100644 (file)
@@ -64,16 +64,19 @@ public:
   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: 
index 0e74b8c77322224c00cd8040d6aac5cb8b260117..f80ee4195803fd821d6ab320ee8468142ad6a179 100644 (file)
@@ -94,3 +94,8 @@ struct s6 { int f0; };
 int f6(int a0, struct s6 a1, struct s6 a2) {
   return (a0 ? a1 : a2).f0;
 }
+
+// PR4026
+void f7() {
+  __func__;
+}