[cfe-dev] Type>>isObjCInterfaceType() blows up

Chris Lattner clattner at apple.com
Tue Apr 22 21:24:00 PDT 2008


On Apr 22, 2008, at 9:21 PM, Sam Bishop wrote:

> Chris Lattner wrote:
>> ASTContext is very useful as a stack-based data structure.  I'm  
>> not  sure what the right fix is, but I don't really want to lose  
>> this  ability...
>
> What do you mean by useful?  (That's an honest question.)
>
> Emerson's proposed patch would allow TranslationUnit objects to  
> safely delete their ASTContext objects.  (Right now, the ASTContext  
> objects are created on the stack in the serializing case and on the  
> heap in deserializing case.  I noticed this when tracking down  
> memory leaks.)

If it makes the two cases more uniform, I would be happy to "give up"  
stack allocation of ASTContext, particularly if the new scheme is for  
TranslationUnit to always own it.

-Chris



More information about the cfe-dev mailing list