diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:41:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-09-29 19:41:44 +0000 |
commit | fc1f9e49458186e62e6c8f543d1ec2bb45361735 (patch) | |
tree | 1936ec19f808b950cd1a6fe3a20ae13a9a4cd7e0 /clang/lib/Parse/ParseDecl.cpp | |
parent | 1632b142b6d4d486dffa26f44579978805eedbc8 (diff) | |
download | bcm5719-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.cpp | 36 |
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; |