summaryrefslogtreecommitdiffstats
path: root/clang
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
commitac0285a6837fa990532a997bba7b44e373d3f1d4 (patch)
treef4f2498fba0c6c41285554016116d776f88d335f /clang
parent3e1d35b92d507423b88172a96aef2d8e817b2db2 (diff)
downloadbcm5719-llvm-ac0285a6837fa990532a997bba7b44e373d3f1d4.tar.gz
bcm5719-llvm-ac0285a6837fa990532a997bba7b44e373d3f1d4.zip
Stop leaking the main Sema object. (Leak found using valgrind.)
llvm-svn: 51580
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/ParseAST.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/ParseAST.cpp b/clang/lib/Sema/ParseAST.cpp
index fcdc27b10ae..cff3ef7612e 100644
--- a/clang/lib/Sema/ParseAST.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud