diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-28 03:29:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-28 03:29:40 +0000 |
commit | e90778716bdc4ddc351f1d38e41c54f1a36466d1 (patch) | |
tree | 3d708cc5f5095de07da96a628a1c6303c51e1277 | |
parent | 515ff5a31d75df9f4f099458a31cd7a405cf513d (diff) |
don't poke at TranslationUnit directly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67900 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/clang-cc/AnalysisConsumer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/clang-cc/AnalysisConsumer.cpp b/tools/clang-cc/AnalysisConsumer.cpp index f19ff1787e..4594a71492 100644 --- a/tools/clang-cc/AnalysisConsumer.cpp +++ b/tools/clang-cc/AnalysisConsumer.cpp @@ -460,10 +460,14 @@ void AnalysisConsumer::HandleTranslationUnit(TranslationUnit& TU) { (*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 |