[cfe-commits] r76159 - in /cfe/trunk: include/clang/Index/ASTLocation.h lib/Index/ASTLocation.cpp

Zhongxing Xu xuzhongxing at gmail.com
Fri Jul 17 00:28:44 PDT 2009


On Fri, Jul 17, 2009 at 3:23 PM, Argyrios Kyrtzidis<kyrtzidis at apple.com> wrote:
> On Jul 16, 2009, at 11:58 PM, Zhongxing Xu wrote:
>
>> Author: zhongxingxu
>> Date: Fri Jul 17 01:58:08 2009
>> New Revision: 76159
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=76159&view=rev
>> Log:
>> Relax the assertion in ASTLocation's ctor: if the decl is not the
>> immediate
>> parent of the stmt, find the immediate parent for the stmt.
>>
>> This is because sometimes we cannot get the immediate decl of the stmt
>> when
>> creating the ASTLocation. We can only get a parent of the stmt.
>
> Hi Zhongxing,
>
> Instead of removing the assertion and subtly changing the Decl that is
> stored in the ASTLocation,
> how about we make "FindImmediateParent" a public static method of
> ASTLocation so it can be used
> for the cases when "we cannot get the immediate decl of the stmt when
> creating the ASTLocation" ?

I had the same idea when I modified the code. :-) I agree to the idea.



More information about the cfe-commits mailing list