[cfe-dev] SourceRange for QualifiedTypeLoc
John McCall
rjmccall at apple.com
Fri May 21 10:29:22 PDT 2010
On May 21, 2010, at 3:33 AM, Abramo Bagnara wrote:
> Il 20/05/2010 19:10, John McCall ha scritto:
>>
>> On May 20, 2010, at 6:05 AM, Abramo Bagnara wrote:
>>
>>> Il 20/05/2010 12:11, Abramo Bagnara ha scritto:
>>>> Il 19/05/2010 21:43, John McCall ha scritto:
>>>>>
>>>>> ...also, the names aren't great; I wouldn't object to a couple of renames:
>>>>> getSourceRange -> getLocalSourceRange
>>>>> getFullSourceRange -> getSourceRange
>>>>
>>>> Done in r104220.
>>
>> Thanks.
>>
>>> I'm under the impression that *every* use of getLocalSourceRange outside
>>> TypeLoc.hh and TypeLoc.cpp is bogus...
>>
>> No; the index support uses it legitimately in order to narrow down where the
>> query location is.
>>
>> Feel free to rework that code if it makes your task easier; just keep in mind that
>> its performance is quite important.
>
> I've attached the patch to fix typeloc sourcerange for review/approval.
> <TypeLocRange.patch>
1. These are really too large to be in TypeLoc.h; please move them to
TypeLoc.cpp.
2. DependentNameTypeLoc does not have an inner type and therefore does not
need this logic.
As a side note, even if we added source locations to QualifiedTypeLoc they would
not be reliably ordered w.r.t. the inner type; in fact, in most places they come *after*
the inner type, not before.
John.
More information about the cfe-dev
mailing list