r262984 - [index] Fix assertion hit when indexing re-declarations of built-in functions.

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 19:35:21 PST 2016


Thanks!

> On Mar 8, 2016, at 7:00 PM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
> 
>> 
>> On Mar 8, 2016, at 6:28 PM, Ben Langmuir <blangmuir at apple.com <mailto:blangmuir at apple.com>> wrote:
>> 
>>> 
>>> On Mar 8, 2016, at 6:12 PM, Argyrios Kyrtzidis via cfe-commits <cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>> wrote:
>>> 
>>> Author: akirtzidis
>>> Date: Tue Mar  8 20:12:40 2016
>>> New Revision: 262984
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=262984&view=rev <http://llvm.org/viewvc/llvm-project?rev=262984&view=rev>
>>> Log:
>>> [index] Fix assertion hit when indexing re-declarations of built-in functions.
>>> 
>>> Modified:
>>>   cfe/trunk/lib/Index/IndexingContext.cpp
>>>   cfe/trunk/test/Index/Core/index-source.m
>>> 
>>> Modified: cfe/trunk/lib/Index/IndexingContext.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexingContext.cpp?rev=262984&r1=262983&r2=262984&view=diff <http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexingContext.cpp?rev=262984&r1=262983&r2=262984&view=diff>
>>> ==============================================================================
>>> --- cfe/trunk/lib/Index/IndexingContext.cpp (original)
>>> +++ cfe/trunk/lib/Index/IndexingContext.cpp Tue Mar  8 20:12:40 2016
>>> @@ -298,6 +298,7 @@ bool IndexingContext::handleDeclOccurren
>>>  if (Parent)
>>>    Parent = getCanonicalDecl(Parent);
>>>  assert(!Parent || !Parent->isImplicit() ||
>>> +         isa<FunctionDecl>(Parent) ||
>> 
>> What is this assertion trying to cover?  Can we add a message or comment?
> 
> Checks whether the parent being implicit is expected or not; added a message in r262991, let me know if it is still unclear.
> 
>> 
>>>         isa<ObjCInterfaceDecl>(Parent) || isa<ObjCMethodDecl>(Parent));
>>> 
>>>  SmallVector<SymbolRelation, 6> FinalRelations;
>>> 
>>> Modified: cfe/trunk/test/Index/Core/index-source.m
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.m?rev=262984&r1=262983&r2=262984&view=diff <http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.m?rev=262984&r1=262983&r2=262984&view=diff>
>>> ==============================================================================
>>> --- cfe/trunk/test/Index/Core/index-source.m (original)
>>> +++ cfe/trunk/test/Index/Core/index-source.m Tue Mar  8 20:12:40 2016
>>> @@ -65,3 +65,8 @@ enum {
>>>  // CHECK-NEXT: RelChild | <no-name> | c:@Ea at One
>>>  Two,
>>> };
>>> +
>>> +// CHECK: [[@LINE+1]]:13 | typedef/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Def | rel: 0
>>> +typedef int jmp_buf[(18)];
>>> +// CHECK: [[@LINE+1]]:19 | typedef/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Ref | rel: 0
>>> +extern int setjmp(jmp_buf);
>>> 
>>> 
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at lists.llvm.org <mailto:cfe-commits at lists.llvm.org>
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160308/5fb5952b/attachment-0001.html>


More information about the cfe-commits mailing list