[cfe-commits] r49142 - in /cfe/trunk: include/clang/AST/TranslationUnit.h lib/AST/TranslationUnit.cpp

Ted Kremenek kremenek at apple.com
Thu Apr 3 11:27:31 PDT 2008


On Apr 3, 2008, at 10:51 AM, Sam Bishop wrote:

> Ted,
>
> Thank you for your help.  I really appreciate it.
>
> Ted Kremenek wrote:
>> So I think the solution is not technically all that hard; it just
>> requires some tedious engineering to make separate instances of all
>> the mentioned methods (and to of course add the necessary "Allocator"
>> argument to the Decl::Create methods, etc.).
>
> As far as I can tell, though, we still wouldn't have an ASTContext
> object to pass to those Decl::Create methods.  Or would the Allocator
> argument replace the ASTContext argument?  Do you think that passing  
> the
> ASTContext around the deserializing code is a bad idea?
>
> Thanks,
> Sam
>

We could potentially create the ASTContext object first, or just pass  
the allocator.  I think I ordered the way things were serialized/ 
deserialized to reduce the amount of pointer backpatching, with the  
ASTContext being deserialized last.  Also, by just passing the  
allocator we remove a dependency between Decls and ASTContext.



More information about the cfe-commits mailing list