[cfe-dev] Source information for types

Chris Lattner clattner at apple.com
Wed Jul 15 20:56:31 PDT 2009


On Jul 15, 2009, at 6:45 PM, Argyrios Kyrtzidis wrote:

> On Jul 15, 2009, at 6:30 PM, Devang Patel wrote:
>
>> On Wed, Jul 8, 2009 at 6:56 PM, Argyrios
>> Kyrtzidis<kyrtzidis at apple.com> wrote:
>>>> Ah, so SourceType inherits from Type?  That feels slightly nasty,
>>>> but
>>>> it works, I guess.
>>>
>>> Yes, it will be a Type subclass that the type system should not deal
>>> with and should not be aware of (e.g. CodeGen will never come
>>> across a
>>> SourceType).
>>
>> Why not ? Right now CodeGen uses
>> Ty->getDecl()->getLocation();
>> to find the type def location for debug info entries.
>
> If you have:
>
> typedef int foo; // #1
> foo x; #2
> foo y; #3
>
> Isn't the interesting location for debug info the one on #1 ? (the
> location where 'foo' is declared)
>
> Is there a reason for the debugger to know where exactly 'foo' was
> written inside the 'x' and 'y' declarations ? (in #2 and #3)

No, the debugger just wants to know where the decls are.

-Chris



More information about the cfe-dev mailing list