[cfe-commits] r57212 - /cfe/trunk/Driver/RewriteObjC.cpp

Ted Kremenek kremenek at apple.com
Mon Oct 6 15:16:15 PDT 2008


Author: kremenek
Date: Mon Oct  6 17:16:13 2008
New Revision: 57212

URL: http://llvm.org/viewvc/llvm-project?rev=57212&view=rev
Log:
Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when rewriting Objective-c foreach statements.

Modified:
    cfe/trunk/Driver/RewriteObjC.cpp

Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=57212&r1=57211&r2=57212&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Mon Oct  6 17:16:13 2008
@@ -1161,11 +1161,12 @@
   buf = "\n{\n\t";
   if (DeclStmt *DS = dyn_cast<DeclStmt>(S->getElement())) {
     // type elem;
-    QualType ElementType = cast<ValueDecl>(DS->getDecl())->getType();
+    ScopedDecl* D = DS->getSolitaryDecl();
+    QualType ElementType = cast<ValueDecl>(D)->getType();
     elementTypeAsString = ElementType.getAsString();
     buf += elementTypeAsString;
     buf += " ";
-    elementName = DS->getDecl()->getName();
+    elementName = D->getName();
     buf += elementName;
     buf += ";\n\t";
   }





More information about the cfe-commits mailing list