зеркало из https://github.com/microsoft/clang-1.git
[libclang] Make sure that all top-level decls in a @implementation are
marked as such. Previously we missed tag declarations; fixes rdar://10902015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151283 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cd42724e01
Коммит
644af7b50b
|
@ -5477,6 +5477,9 @@ public:
|
|||
IdentifierInfo *CatName,
|
||||
SourceLocation CatLoc);
|
||||
|
||||
DeclGroupPtrTy ActOnFinishObjCImplementation(Decl *ObjCImpDecl,
|
||||
ArrayRef<Decl *> Decls);
|
||||
|
||||
DeclGroupPtrTy ActOnForwardClassDeclaration(SourceLocation Loc,
|
||||
IdentifierInfo **IdentList,
|
||||
SourceLocation *IdentLocs,
|
||||
|
|
|
@ -1532,9 +1532,7 @@ Parser::ParseObjCAtImplementationDeclaration(SourceLocation AtLoc) {
|
|||
}
|
||||
}
|
||||
|
||||
DeclsInGroup.push_back(ObjCImpDecl);
|
||||
return Actions.BuildDeclaratorGroup(
|
||||
DeclsInGroup.data(), DeclsInGroup.size(), false);
|
||||
return Actions.ActOnFinishObjCImplementation(ObjCImpDecl, DeclsInGroup);
|
||||
}
|
||||
|
||||
Parser::DeclGroupPtrTy
|
||||
|
|
|
@ -988,6 +988,25 @@ Decl *Sema::ActOnStartClassImplementation(
|
|||
return ActOnObjCContainerStartDefinition(IMPDecl);
|
||||
}
|
||||
|
||||
Sema::DeclGroupPtrTy
|
||||
Sema::ActOnFinishObjCImplementation(Decl *ObjCImpDecl, ArrayRef<Decl *> Decls) {
|
||||
SmallVector<Decl *, 64> DeclsInGroup;
|
||||
DeclsInGroup.reserve(Decls.size() + 1);
|
||||
|
||||
for (unsigned i = 0, e = Decls.size(); i != e; ++i) {
|
||||
Decl *Dcl = Decls[i];
|
||||
if (!Dcl)
|
||||
continue;
|
||||
if (Dcl->getDeclContext()->isFileContext())
|
||||
Dcl->setTopLevelDeclInObjCContainer();
|
||||
DeclsInGroup.push_back(Dcl);
|
||||
}
|
||||
|
||||
DeclsInGroup.push_back(ObjCImpDecl);
|
||||
|
||||
return BuildDeclaratorGroup(DeclsInGroup.data(), DeclsInGroup.size(), false);
|
||||
}
|
||||
|
||||
void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
|
||||
ObjCIvarDecl **ivars, unsigned numIvars,
|
||||
SourceLocation RBrace) {
|
||||
|
|
|
@ -26,6 +26,18 @@
|
|||
@synthesize name = _name;
|
||||
@end
|
||||
|
||||
@interface rdar10902015
|
||||
@end
|
||||
|
||||
@implementation rdar10902015
|
||||
|
||||
struct S {};
|
||||
|
||||
-(void)mm:(struct S*)s {
|
||||
rdar10902015 *i = 0;
|
||||
}
|
||||
@end
|
||||
|
||||
// RUN: c-index-test -cursor-at=%s:4:28 -cursor-at=%s:5:28 %s | FileCheck -check-prefix=CHECK-PROP %s
|
||||
// CHECK-PROP: ObjCPropertyDecl=foo1:4:26
|
||||
// CHECK-PROP: ObjCPropertyDecl=foo2:5:27
|
||||
|
@ -35,3 +47,6 @@
|
|||
|
||||
// RUN: c-index-test -cursor-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-METHOD %s
|
||||
// CHECK-METHOD: ObjCInstanceMethodDecl=name:20:1
|
||||
|
||||
// RUN: c-index-test -cursor-at=%s:37:17 %s | FileCheck -check-prefix=CHECK-IN-IMPL %s
|
||||
// CHECK-IN-IMPL: VarDecl=i:37:17
|
||||
|
|
Загрузка…
Ссылка в новой задаче