diff options
| author | Ted Kremenek <kremenek@apple.com> | 2009-02-13 00:51:30 +0000 | 
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2009-02-13 00:51:30 +0000 | 
| commit | c14725d9eb016baca46ab6c73dafa5bc454fe161 (patch) | |
| tree | e3b6808be4761e64313fb4e2614d4dcfd09dee8a /clang | |
| parent | 837b990c539921cca8366476ebf0cb0dc76f9280 (diff) | |
| download | bcm5719-llvm-c14725d9eb016baca46ab6c73dafa5bc454fe161.tar.gz bcm5719-llvm-c14725d9eb016baca46ab6c73dafa5bc454fe161.zip  | |
AnalysisConsumer: Explicitly destroy the PathDiagnosticClient at the end of HandleTranslationUnit to ensure that the client's destructor is called even with --disable-free.
llvm-svn: 64422
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/Driver/AnalysisConsumer.cpp | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/Driver/AnalysisConsumer.cpp b/clang/Driver/AnalysisConsumer.cpp index 73ce3f66258..a5c253c62d4 100644 --- a/clang/Driver/AnalysisConsumer.cpp +++ b/clang/Driver/AnalysisConsumer.cpp @@ -355,14 +355,15 @@ void AnalysisConsumer::HandleTranslationUnit(TranslationUnit& TU) {        (*I)(mgr);      } -  if (ObjCImplementationActions.empty()) -    return; -     -  for (TranslationUnit::iterator I = TU.begin(), E = TU.end(); I!=E; ++I) { -     -    if (ObjCImplementationDecl* ID = dyn_cast<ObjCImplementationDecl>(*I)) -      HandleCode(ID, 0, ObjCImplementationActions); -  } +  if (!ObjCImplementationActions.empty()) +    for (TranslationUnit::iterator I = TU.begin(), E = TU.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 +  // destructor of the PathDiagnosticClient to get executed. +  PD.reset();  }  void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions& actions) {  | 

