[cfe-commits] r51768 - /cfe/trunk/Driver/ASTConsumers.cpp

Ted Kremenek kremenek at apple.com
Fri May 30 09:54:36 PDT 2008


Eli,

It seems like a better fix would be to just pass TranslationUnit to  
ASTConsumer::Initialize instead of ASTContext.  It seems silly to  
create two TranslationUnits objects.  Clients that want an ASTContext&  
can just get it from the TranslationUnit.  What do you think?

Ted

On May 30, 2008, at 4:28 AM, Eli Friedman wrote:

> Author: efriedma
> Date: Fri May 30 06:28:30 2008
> New Revision: 51768
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51768&view=rev
> Log:
> Fix crash with -serialize (reported to cfe-dev). The issue was
> essentially that we were destroying the declarations twice.
>
> (Note that we don't use -serialize directly in the testsuite, only
> SerializeTest.)
>
>
> Modified:
>    cfe/trunk/Driver/ASTConsumers.cpp
>
> Modified: cfe/trunk/Driver/ASTConsumers.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=51768&r1=51767&r2=51768&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/Driver/ASTConsumers.cpp (original)
> +++ cfe/trunk/Driver/ASTConsumers.cpp Fri May 30 06:28:30 2008
> @@ -879,6 +879,7 @@
>
>   virtual void Initialize(ASTContext &Context) {
>     if (!TU) TU = new TranslationUnit(Context, lang);
> +    TU->SetOwnsDecls(false);
>   }
>
>   virtual void HandleTopLevelDecl(Decl *D) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list