[cfe-commits] r67900 - /cfe/trunk/tools/clang-cc/AnalysisConsumer.cpp

Chris Lattner sabre at nondot.org
Fri Mar 27 20:29:41 PDT 2009


Author: lattner
Date: Fri Mar 27 22:29:40 2009
New Revision: 67900

URL: http://llvm.org/viewvc/llvm-project?rev=67900&view=rev
Log:
don't poke at TranslationUnit directly

Modified:
    cfe/trunk/tools/clang-cc/AnalysisConsumer.cpp

Modified: cfe/trunk/tools/clang-cc/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/AnalysisConsumer.cpp?rev=67900&r1=67899&r2=67900&view=diff

==============================================================================
--- cfe/trunk/tools/clang-cc/AnalysisConsumer.cpp (original)
+++ cfe/trunk/tools/clang-cc/AnalysisConsumer.cpp Fri Mar 27 22:29:40 2009
@@ -460,10 +460,14 @@
       (*I)(mgr);  
   }
 
-  if (!ObjCImplementationActions.empty())
-    for (TranslationUnit::iterator I = TU.begin(), E = TU.end(); I!=E; ++I)
+  if (!ObjCImplementationActions.empty()) {
+    TranslationUnitDecl *TUD = TU.getContext().getTranslationUnitDecl();
+    
+    for (DeclContext::decl_iterator I = TUD->decls_begin(),E = TUD->decls_end();
+         I != E; ++I)
       if (ObjCImplementationDecl* ID = dyn_cast<ObjCImplementationDecl>(*I))
         HandleCode(ID, 0, ObjCImplementationActions);
+  }
   
   // Delete the PathDiagnosticClient here just in case the AnalysisConsumer
   // object doesn't get released.  This will cause any side-effects in the





More information about the cfe-commits mailing list