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

Daniel Dunbar daniel at zuster.org
Thu Dec 4 09:21:10 PST 2008


On Thu, Dec 4, 2008 at 9:12 AM, Ted Kremenek <kremenek at apple.com> wrote:
> On Dec 4, 2008, at 8:44 AM, Daniel Dunbar <daniel at zuster.org> wrote:
>> Does this mean we should have another
>> context object?
>
> That's a possibilty, but what would such a context object represent?  My
> main concern is that at some point a proliferation of such objects becomes
> more cumbersome than the benefit they provide.

I'm not exactly sure what it means, I imagine it would be a high level
context which captures any information that should be available
whenever a client is using parts of the clang API. This doesn't
necessarily mean a proliferation of contexts, for example it may make
sense for this object to hold the language options or target
information. This is no different than forcing the clients to allocate
an identifier table up front, it just moves it to a common place.

 - Daniel

>
>> On Thu, Dec 4, 2008 at 8:27 AM, Ted Kremenek <kremenek at apple.com> wrote:
>>>
>>> On Dec 4, 2008, at 7:26 AM, steve naroff <snaroff at apple.com> wrote:
>>>
>>>>
>>>> On Dec 4, 2008, at 9:54 AM, Lukasz Janyst 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.
>>>>>
>>>>
>>>> The IdentifierTable should be owned by ASTContext (as you expected).
>>>>
>>>> This is a bug (that I thought we fixed a long time ago...apparently
>>>> not).
>>>>
>>>> snaroff
>>>
>>> I don't think this is a bug.  See my other email.
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>



More information about the cfe-dev mailing list