[llvm-branch-commits] [cfe-branch] r205785 - Merging r200953:

Tom Stellard thomas.stellard at amd.com
Tue Apr 8 11:57:45 PDT 2014


Author: tstellar
Date: Tue Apr  8 13:57:44 2014
New Revision: 205785

URL: http://llvm.org/viewvc/llvm-project?rev=205785&view=rev
Log:
Merging r200953:

------------------------------------------------------------------------
r200953 | rtrieu | 2014-02-06 18:26:23 -0500 (Thu, 06 Feb 2014) | 3 lines

Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing on
certain receiver types.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_34/lib/AST/StmtPrinter.cpp
    cfe/branches/release_34/test/Misc/ast-dump-decl.m

Modified: cfe/branches/release_34/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/AST/StmtPrinter.cpp?rev=205785&r1=205784&r2=205785&view=diff
==============================================================================
--- cfe/branches/release_34/lib/AST/StmtPrinter.cpp (original)
+++ cfe/branches/release_34/lib/AST/StmtPrinter.cpp Tue Apr  8 13:57:44 2014
@@ -709,9 +709,11 @@ void StmtPrinter::VisitObjCIvarRefExpr(O
 void StmtPrinter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) {
   if (Node->isSuperReceiver())
     OS << "super.";
-  else if (Node->getBase()) {
+  else if (Node->isObjectReceiver() && Node->getBase()) {
     PrintExpr(Node->getBase());
     OS << ".";
+  } else if (Node->isClassReceiver() && Node->getClassReceiver()) {
+    OS << Node->getClassReceiver()->getName() << ".";
   }
 
   if (Node->isImplicitProperty())

Modified: cfe/branches/release_34/test/Misc/ast-dump-decl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/test/Misc/ast-dump-decl.m?rev=205785&r1=205784&r2=205785&view=diff
==============================================================================
--- cfe/branches/release_34/test/Misc/ast-dump-decl.m (original)
+++ cfe/branches/release_34/test/Misc/ast-dump-decl.m Tue Apr  8 13:57:44 2014
@@ -134,3 +134,12 @@ void TestBlockDecl(int x) {
 // CHECK-NEXT:   ...
 // CHECK-NEXT:   capture ParmVar{{.*}} 'x' 'int'
 // CHECK-NEXT:   CompoundStmt
+
+ at interface B
++ (int) foo;
+ at end
+
+void f() {
+  __typeof__(B.foo) Test;
+}
+// CHECK: VarDecl{{.*}}Test 'typeof (B.foo)':'int'





More information about the llvm-branch-commits mailing list