[cfe-dev] Modifying an AST and Sema's dependency on an AST consumer

Ted Kremenek kremenek at apple.com
Thu Dec 4 08:25:22 PST 2008


On Dec 4, 2008, at 6:54 AM, Lukasz Janyst <ljanyst at cern.ch> wrote:

> On Wed, Dec 3, 2008 at 3:26 PM, Lukasz Janyst <ljanyst at cern.ch> wrote:
>> tables in it. Yet still I seem to experience some strange memory
>> issues when the modified TU gets processed by the CodeGen.
>
> I sorted it out. The problem was the object ownership. It seemed
> natural to me that the identifier table should be owned by the
> ASTContext, but it is owned by the Preprocessor object which I deleted
> after I was done with the parsing.
>
>   Lukasz

Just to clarify, the Preprocessor owns IdentifierTable because (a) one  
needs the IdentifiedTable when preprocessing/lexing a file and (b) one  
can use a Preprocessor object without constructing ASTs.



More information about the cfe-dev mailing list