diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-02-24 17:54:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-02-24 17:54:50 +0000 |
commit | c34348a7ef1a6b3f92a644a227953800cd1f9947 (patch) | |
tree | 5c41fb25b5d08155409083ea9d8987f68513470c /lib/Parse/ParseExprCXX.cpp | |
parent | 5fa05cb906e9ddd34ef2ae2a872014aeaf4bc04d (diff) |
Retain complete source-location information for C++
nested-name-specifiers throughout the parser, and provide a new class
(NestedNameSpecifierLoc) that contains a nested-name-specifier along
with its type-source information.
Right now, this information is completely useless, because we don't
actually store the source-location information anywhere in the
AST. Call this Step 1/N.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index ee87135601..2abec6f0cc 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -65,8 +65,9 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, "Call sites of this function should be guarded by checking for C++"); if (Tok.is(tok::annot_cxxscope)) { - SS.Adopt(static_cast<NestedNameSpecifier*>(Tok.getAnnotationValue()), - Tok.getAnnotationRange()); + Actions.RestoreNestedNameSpecifierAnnotation(Tok.getAnnotationValue(), + Tok.getAnnotationRange(), + SS); ConsumeToken(); return false; } @@ -207,10 +208,8 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, assert(Tok.is(tok::coloncolon) && "NextToken() not working properly!"); SourceLocation CCLoc = ConsumeToken(); - if (!HasScopeSpecifier) { - SS.setBeginLoc(TypeToken.getLocation()); + if (!HasScopeSpecifier) HasScopeSpecifier = true; - } if (ParsedType T = getTypeAnnotation(TypeToken)) { if (Actions.ActOnCXXNestedNameSpecifier(getCurScope(), T, CCLoc, SS)) |