summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-09-29 19:41:44 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-09-29 19:41:44 +0000
commitfc1f9e49458186e62e6c8f543d1ec2bb45361735 (patch)
tree1936ec19f808b950cd1a6fe3a20ae13a9a4cd7e0 /clang/lib/Parse/ParseDecl.cpp
parent1632b142b6d4d486dffa26f44579978805eedbc8 (diff)
downloadbcm5719-llvm-fc1f9e49458186e62e6c8f543d1ec2bb45361735.tar.gz
bcm5719-llvm-fc1f9e49458186e62e6c8f543d1ec2bb45361735.zip
Keep protocol source locations when parsing protocol references.
llvm-svn: 83091
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index d885558e1f3..e15a4cd6880 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -848,10 +848,13 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
if (!Tok.is(tok::less) || !getLang().ObjC1)
continue;
- SourceLocation EndProtoLoc;
+ SourceLocation LAngleLoc, EndProtoLoc;
llvm::SmallVector<DeclPtrTy, 8> ProtocolDecl;
- ParseObjCProtocolReferences(ProtocolDecl, false, EndProtoLoc);
- DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size());
+ llvm::SmallVector<SourceLocation, 8> ProtocolLocs;
+ ParseObjCProtocolReferences(ProtocolDecl, ProtocolLocs, false,
+ LAngleLoc, EndProtoLoc);
+ DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size(),
+ ProtocolLocs.data(), LAngleLoc);
DS.SetRangeEnd(EndProtoLoc);
continue;
@@ -908,10 +911,13 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
if (!Tok.is(tok::less) || !getLang().ObjC1)
continue;
- SourceLocation EndProtoLoc;
+ SourceLocation LAngleLoc, EndProtoLoc;
llvm::SmallVector<DeclPtrTy, 8> ProtocolDecl;
- ParseObjCProtocolReferences(ProtocolDecl, false, EndProtoLoc);
- DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size());
+ llvm::SmallVector<SourceLocation, 8> ProtocolLocs;
+ ParseObjCProtocolReferences(ProtocolDecl, ProtocolLocs, false,
+ LAngleLoc, EndProtoLoc);
+ DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size(),
+ ProtocolLocs.data(), LAngleLoc);
DS.SetRangeEnd(EndProtoLoc);
@@ -1154,10 +1160,13 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
goto DoneWithDeclSpec;
{
- SourceLocation EndProtoLoc;
+ SourceLocation LAngleLoc, EndProtoLoc;
llvm::SmallVector<DeclPtrTy, 8> ProtocolDecl;
- ParseObjCProtocolReferences(ProtocolDecl, false, EndProtoLoc);
- DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size());
+ llvm::SmallVector<SourceLocation, 8> ProtocolLocs;
+ ParseObjCProtocolReferences(ProtocolDecl, ProtocolLocs, false,
+ LAngleLoc, EndProtoLoc);
+ DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size(),
+ ProtocolLocs.data(), LAngleLoc);
DS.SetRangeEnd(EndProtoLoc);
Diag(Loc, diag::warn_objc_protocol_qualifier_missing_id)
@@ -1268,10 +1277,13 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
if (!Tok.is(tok::less) || !getLang().ObjC1)
return true;
- SourceLocation EndProtoLoc;
+ SourceLocation LAngleLoc, EndProtoLoc;
llvm::SmallVector<DeclPtrTy, 8> ProtocolDecl;
- ParseObjCProtocolReferences(ProtocolDecl, false, EndProtoLoc);
- DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size());
+ llvm::SmallVector<SourceLocation, 8> ProtocolLocs;
+ ParseObjCProtocolReferences(ProtocolDecl, ProtocolLocs, false,
+ LAngleLoc, EndProtoLoc);
+ DS.setProtocolQualifiers(ProtocolDecl.data(), ProtocolDecl.size(),
+ ProtocolLocs.data(), LAngleLoc);
DS.SetRangeEnd(EndProtoLoc);
return true;
OpenPOWER on IntegriCloud