don't poke at TranslationUnit directly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67900 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/AnalysisConsumer.cpp b/tools/clang-cc/AnalysisConsumer.cpp
index f19ff17..4594a71 100644
--- a/tools/clang-cc/AnalysisConsumer.cpp
+++ b/tools/clang-cc/AnalysisConsumer.cpp
@@ -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