aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/ParseAST.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-27 04:23:47 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-27 04:23:47 +0000
commit80f3346981172428a568ccd67e37755fd2d7efbe (patch)
treea79d90c36b34e665a46015daeb4f850961b7db12 /lib/Sema/ParseAST.cpp
parent3b6c493f29c2617196ab6d035312ff83c4166b4b (diff)
Stop leaking the main Sema object. (Leak found using valgrind.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/ParseAST.cpp')
-rw-r--r--lib/Sema/ParseAST.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp
index fcdc27b10a..cff3ef7612 100644
--- a/lib/Sema/ParseAST.cpp
+++ b/lib/Sema/ParseAST.cpp
@@ -38,8 +38,9 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, bool PrintStats) {
PP.getIdentifierTable(), PP.getSelectorTable());
TranslationUnit TU(Context, PP.getLangOptions());
-
- Parser P(PP, *new Sema(PP, Context, *Consumer));
+
+ Sema S(PP, Context, *Consumer);
+ Parser P(PP, S);
PP.EnterMainSourceFile();
// Initialize the parser.