diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-05-27 04:23:47 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-05-27 04:23:47 +0000 |
commit | ac0285a6837fa990532a997bba7b44e373d3f1d4 (patch) | |
tree | f4f2498fba0c6c41285554016116d776f88d335f /clang | |
parent | 3e1d35b92d507423b88172a96aef2d8e817b2db2 (diff) | |
download | bcm5719-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.cpp | 5 |
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. |