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

Argyrios Kyrtzidis via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 18:12:40 PST 2016


Author: akirtzidis
Date: Tue Mar  8 20:12:40 2016
New Revision: 262984

URL: 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
==============================================================================
--- 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) ||
          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
==============================================================================
--- 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);




More information about the cfe-commits mailing list