mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
[PCH] When keeping track of top-level decls for "targeted deserialization"
make sure we don't mistake ParmVarDecls for top-level decls. Fixes rdar://10920009. llvm-svn: 151330
This commit is contained in:
parent
3a21e2c33e
commit
ffe055a86f
@ -3860,6 +3860,9 @@ void ASTWriter::associateDeclWithFile(const Decl *D, DeclID ID) {
|
||||
// We only keep track of the file-level declarations of each file.
|
||||
if (!D->getLexicalDeclContext()->isFileContext())
|
||||
return;
|
||||
// FIXME: We should never have ParmVarDecls with TU as context.
|
||||
if (isa<ParmVarDecl>(D))
|
||||
return;
|
||||
|
||||
SourceManager &SM = Context->getSourceManager();
|
||||
SourceLocation FileLoc = SM.getFileLoc(Loc);
|
||||
|
6
clang/test/Index/targeted-cursor.m
Normal file
6
clang/test/Index/targeted-cursor.m
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
// rdar://10920009
|
||||
// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %S/targeted-cursor.m.h -Xclang -detailed-preprocessing-record
|
||||
// RUN: c-index-test -cursor-at=%S/targeted-cursor.m.h:5:13 %s -include %t.h | FileCheck %s
|
||||
|
||||
// CHECK: ObjCClassRef=I:2:12
|
7
clang/test/Index/targeted-cursor.m.h
Normal file
7
clang/test/Index/targeted-cursor.m.h
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
@interface I
|
||||
|
||||
-(void)mm:(void (^)(I*))block;
|
||||
-(void)mm2:(I*)i;
|
||||
|
||||
@end
|
Loading…
Reference in New Issue
Block a user