aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-21 23:00:09 +0000
committerChris Lattner <sabre@nondot.org>2009-04-21 23:00:09 +0000
commitf0a990c2aa0b596a7e3cdd8fa2a5909d591ffe66 (patch)
treee5abce205148b7348efbcfe20466a514f8a889a7
parent25efa107ae8381458ffa464c5fc7d21135bbe52d (diff)
fix PR4026: Clang can't codegen __func__ without implicit cast
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69747 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGExprAgg.cpp15
-rw-r--r--test/CodeGen/exprs.c5
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 9d6df5c820..2e45f2017b 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -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:
diff --git a/test/CodeGen/exprs.c b/test/CodeGen/exprs.c
index 0e74b8c773..f80ee41958 100644
--- a/test/CodeGen/exprs.c
+++ b/test/CodeGen/exprs.c
@@ -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__;
+}