summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-01-12 09:16:57 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-01-12 09:16:57 +0000
commit83de336b71c27b660332a1e11e5d390ef4d650cc (patch)
tree855866d5c58eb2f57e90f075d198887f944e7ae9 /clang
parent600ee4ad661225b401882076a340aa84aeed6a41 (diff)
downloadbcm5719-llvm-83de336b71c27b660332a1e11e5d390ef4d650cc.tar.gz
bcm5719-llvm-83de336b71c27b660332a1e11e5d390ef4d650cc.zip
Parse: Get rid of cxx_exceptspec_end, use EOF instead
Similar to r225619, use a special EOF token to mark the end of the exception specification instead of cxx_exceptspec_end. Use the current scope as the marker. llvm-svn: 225622
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/TokenKinds.def1
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp7
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp3
3 files changed, 7 insertions, 4 deletions
diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def
index e0cc3631ff0..da106227c28 100644
--- a/clang/include/clang/Basic/TokenKinds.def
+++ b/clang/include/clang/Basic/TokenKinds.def
@@ -116,7 +116,6 @@ TOK(eof) // End of file.
TOK(eod) // End of preprocessing directive (end of line inside a
// directive).
TOK(code_completion) // Code completion marker
-TOK(cxx_exceptspec_end) // C++ exception-specification end marker
// C99 6.4.9: Comments.
TOK(comment) // Comment (only in -E -C[C] mode)
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 0d5bb2e97d4..03784b4f5ea 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -418,7 +418,7 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
ExceptionSpecTokens);
// Clean up the remaining tokens.
- if (Tok.is(tok::cxx_exceptspec_end))
+ if (Tok.is(tok::eof) && Tok.getEofData() == Actions.CurScope)
ConsumeToken();
else if (EST != EST_None)
Diag(Tok.getLocation(), diag::err_except_spec_unparsed);
@@ -437,8 +437,11 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
// There could be leftover tokens (e.g. because of an error).
// Skip through until we reach the original token position.
- while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof))
+ while (Tok.getLocation() != origLoc) {
+ if (Tok.is(tok::eof) && Tok.getEofData() != Actions.CurScope)
+ break;
ConsumeAnyToken();
+ }
delete Toks;
LM.ExceptionSpecTokens = nullptr;
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 10568b3671b..09239f467ea 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -3163,8 +3163,9 @@ Parser::tryParseExceptionSpecification(bool Delayed,
// Add the 'stop' token.
Token End;
End.startToken();
- End.setKind(tok::cxx_exceptspec_end);
+ End.setKind(tok::eof);
End.setLocation(Tok.getLocation());
+ End.setEofData(Actions.CurScope);
ExceptionSpecTokens->push_back(End);
return EST_Unparsed;
}
OpenPOWER on IntegriCloud