don't poke at TranslationUnit directly

llvm-svn: 67900
This commit is contained in:
Chris Lattner 2009-03-28 03:29:40 +00:00
parent 754d5ac658
commit a0b08dcd6b
1 changed files with 6 additions and 2 deletions

View File

@ -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