diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-03 06:24:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-03 06:24:16 +0000 |
commit | 31e6c7ddfeeefe05b67220bc87fa23d4338d1056 (patch) | |
tree | f445f70ad9a9bb949af7c23aa2f92a873ca51060 /Driver/clang.cpp | |
parent | 8aab17e82aab6b3f266ef1884253226d2cb8b8d8 (diff) |
Fix ownership model of ParseAST to allow the dtor of
ASTConsumer to process the AST before it is destroyed.
This allows elimination of HandleObjcMetaDataEmission.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r-- | Driver/clang.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 77779f7e80..f568302444 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -821,11 +821,10 @@ static void ProcessInputFile(Preprocessor &PP, unsigned MainFileID, if (Consumer) { if (VerifyDiagnostics) - exit (CheckASTConsumer(PP, MainFileID, Consumer)); - else - ParseAST(PP, MainFileID, *Consumer, Stats); - - delete Consumer; + exit(CheckASTConsumer(PP, MainFileID, Consumer)); + + // This deletes Consumer. + ParseAST(PP, MainFileID, Consumer, Stats); } if (Stats) { |