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
diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp
index fcdc27b..cff3ef7 100644
--- a/lib/Sema/ParseAST.cpp
+++ b/lib/Sema/ParseAST.cpp
@@ -38,8 +38,9 @@
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.