mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 04:46:27 +08:00
[index] Make sure that declarations of builtin functions are indexed.
rdar://25154630 llvm-svn: 263689
This commit is contained in:
@@ -290,14 +290,17 @@ bool IndexingContext::handleDeclOccurrence(const Decl *D, SourceLocation Loc,
|
||||
Roles |= (unsigned)SymbolRole::Declaration;
|
||||
|
||||
D = getCanonicalDecl(D);
|
||||
if (D->isImplicit() && !isa<ObjCMethodDecl>(D)) {
|
||||
if (D->isImplicit() && !isa<ObjCMethodDecl>(D) &&
|
||||
!(isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->getBuiltinID())) {
|
||||
// operator new declarations will link to the implicit one as canonical.
|
||||
return true;
|
||||
}
|
||||
Parent = adjustParent(Parent);
|
||||
if (Parent)
|
||||
Parent = getCanonicalDecl(Parent);
|
||||
assert((!Parent || !Parent->isImplicit() || isa<FunctionDecl>(Parent) ||
|
||||
assert((!Parent || !Parent->isImplicit() ||
|
||||
(isa<FunctionDecl>(Parent) &&
|
||||
cast<FunctionDecl>(Parent)->getBuiltinID()) ||
|
||||
isa<ObjCInterfaceDecl>(Parent) || isa<ObjCMethodDecl>(Parent)) &&
|
||||
"unexpected implicit parent!");
|
||||
|
||||
|
||||
@@ -68,5 +68,6 @@ enum {
|
||||
|
||||
// CHECK: [[@LINE+1]]:13 | typedef/C | jmp_buf | c:index-source.m@T@jmp_buf | <no-cgname> | Def | rel: 0
|
||||
typedef int jmp_buf[(18)];
|
||||
// CHECK: [[@LINE+2]]:12 | function/C | setjmp | c:@F@setjmp | _setjmp | Decl | rel: 0
|
||||
// CHECK: [[@LINE+1]]:19 | typedef/C | jmp_buf | c:index-source.m@T@jmp_buf | <no-cgname> | Ref | rel: 0
|
||||
extern int setjmp(jmp_buf);
|
||||
|
||||
Reference in New Issue
Block a user