diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-19 01:11:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-19 01:11:05 +0000 |
commit | 2ee9b408a5cf3055fd974f01025b80fb3fd5f7e6 (patch) | |
tree | 56123aa172b87d5995fe21d322c34056836271c4 /lib/Parse/ParseTentative.cpp | |
parent | 11b88eb5c345b166d5ba33496005118a04baf2cf (diff) |
eliminate a call to NextToken() when parsing ::foo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTentative.cpp')
-rw-r--r-- | lib/Parse/ParseTentative.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp index f521bc3a7a..51c56706bb 100644 --- a/lib/Parse/ParseTentative.cpp +++ b/lib/Parse/ParseTentative.cpp @@ -680,9 +680,10 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() { // Otherwise, not a typename. return TPResult::False(); - case tok::coloncolon: // ::foo::bar - if (NextToken().is(tok::kw_new) || // ::new - NextToken().is(tok::kw_delete)) // ::delete + case tok::coloncolon: { // ::foo::bar + const Token &Next = NextToken(); + if (Next.is(tok::kw_new) || // ::new + Next.is(tok::kw_delete)) // ::delete return TPResult::False(); // Annotate typenames and C++ scope specifiers. If we get one, just @@ -691,7 +692,8 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() { return isCXXDeclarationSpecifier(); // Otherwise, not a typename. return TPResult::False(); - + } + // decl-specifier: // storage-class-specifier // type-specifier @@ -699,7 +701,6 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() { // 'friend' // 'typedef' // 'constexpr' - case tok::kw_friend: case tok::kw_typedef: case tok::kw_constexpr: |