[cfe-commits] r51580 - /cfe/trunk/lib/Sema/ParseAST.cpp

Eli Friedman eli.friedman at gmail.com
Mon May 26 21:23:48 PDT 2008


Author: efriedma
Date: Mon May 26 23:23:47 2008
New Revision: 51580

URL: http://llvm.org/viewvc/llvm-project?rev=51580&view=rev
Log:
Stop leaking the main Sema object. (Leak found using valgrind.)


Modified:
    cfe/trunk/lib/Sema/ParseAST.cpp

Modified: cfe/trunk/lib/Sema/ParseAST.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/ParseAST.cpp?rev=51580&r1=51579&r2=51580&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/ParseAST.cpp (original)
+++ cfe/trunk/lib/Sema/ParseAST.cpp Mon May 26 23:23:47 2008
@@ -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.





More information about the cfe-commits mailing list