aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-03 06:37:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-10-03 06:37:04 +0000
commit491306a83c4f0f49f95a3bcbca8580cb98a91c7a (patch)
tree2011c1e6e59dcea3f9eaad6f2160eb7e8295e3c2 /lib/Serialization/ASTReaderDecl.cpp
parentb994e6c7d57b00e3e0f69d152065e2cf85d1de33 (diff)
Allow getting all source locations of selector identifiers in a ObjCMethodDecl.
Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index f370f86686..360fcabf51 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -493,7 +493,15 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
Params.reserve(NumParams);
for (unsigned I = 0; I != NumParams; ++I)
Params.push_back(ReadDeclAs<ParmVarDecl>(Record, Idx));
- MD->setMethodParams(Reader.getContext(), Params.data(), NumParams);
+
+ MD->SelLocsKind = Record[Idx++];
+ unsigned NumStoredSelLocs = Record[Idx++];
+ SmallVector<SourceLocation, 16> SelLocs;
+ SelLocs.reserve(NumStoredSelLocs);
+ for (unsigned i = 0; i != NumStoredSelLocs; ++i)
+ SelLocs.push_back(ReadSourceLocation(Record, Idx));
+
+ MD->setParamsAndSelLocs(Reader.getContext(), Params, SelLocs);
}
void ASTDeclReader::VisitObjCContainerDecl(ObjCContainerDecl *CD) {
@@ -1614,7 +1622,6 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) {
case DECL_OBJC_METHOD:
D = ObjCMethodDecl::Create(Context, SourceLocation(), SourceLocation(),
- ArrayRef<SourceLocation>(),
Selector(), QualType(), 0, 0);
break;
case DECL_OBJC_INTERFACE: