diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-03 06:36:17 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-03 06:36:17 +0000 |
commit | 951376242c076c3f62dd78bf672909fc011991db (patch) | |
tree | 6a21e6bb37bedc547fc336991a42aec28e4ef22e /lib/Parse/ParseObjc.cpp | |
parent | d2deee17ade564dc9ab672c4ae8d7d4c2002d507 (diff) |
Pass all the locations of the selector identifiers for a message expression from the parser.
They are not kept in the AST yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 6ebe3b2df1..44808c8922 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -2219,15 +2219,15 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, SourceLocation Loc; IdentifierInfo *selIdent = ParseObjCSelectorPiece(Loc); - SourceLocation SelectorLoc = Loc; - SmallVector<IdentifierInfo *, 12> KeyIdents; + SmallVector<SourceLocation, 12> KeyLocs; ExprVector KeyExprs(Actions); if (Tok.is(tok::colon)) { while (1) { // Each iteration parses a single keyword argument. KeyIdents.push_back(selIdent); + KeyLocs.push_back(Loc); if (Tok.isNot(tok::colon)) { Diag(Tok, diag::err_expected_colon); @@ -2342,24 +2342,26 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, SourceLocation RBracLoc = ConsumeBracket(); // consume ']' unsigned nKeys = KeyIdents.size(); - if (nKeys == 0) + if (nKeys == 0) { KeyIdents.push_back(selIdent); + KeyLocs.push_back(Loc); + } Selector Sel = PP.getSelectorTable().getSelector(nKeys, &KeyIdents[0]); if (SuperLoc.isValid()) return Actions.ActOnSuperMessage(getCurScope(), SuperLoc, Sel, - LBracLoc, SelectorLoc, RBracLoc, + LBracLoc, KeyLocs, RBracLoc, MultiExprArg(Actions, KeyExprs.take(), KeyExprs.size())); else if (ReceiverType) return Actions.ActOnClassMessage(getCurScope(), ReceiverType, Sel, - LBracLoc, SelectorLoc, RBracLoc, + LBracLoc, KeyLocs, RBracLoc, MultiExprArg(Actions, KeyExprs.take(), KeyExprs.size())); return Actions.ActOnInstanceMessage(getCurScope(), ReceiverExpr, Sel, - LBracLoc, SelectorLoc, RBracLoc, + LBracLoc, KeyLocs, RBracLoc, MultiExprArg(Actions, KeyExprs.take(), KeyExprs.size())); |