[cfe-commits] r142054 - /cfe/trunk/lib/Parse/ParseDeclCXX.cpp
Richard Smith
richard-llvm at metafoo.co.uk
Fri Oct 14 21:21:46 PDT 2011
Author: rsmith
Date: Fri Oct 14 23:21:46 2011
New Revision: 142054
URL: http://llvm.org/viewvc/llvm-project?rev=142054&view=rev
Log:
Refactor: remove redundant check for 'final' specifier when parsing class/struct definition.
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=142054&r1=142053&r2=142054&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Fri Oct 14 23:21:46 2011
@@ -2072,20 +2072,11 @@
// Parse the optional 'final' keyword.
if (getLang().CPlusPlus && Tok.is(tok::identifier)) {
- IdentifierInfo *II = Tok.getIdentifierInfo();
-
- // Initialize the contextual keywords.
- if (!Ident_final) {
- Ident_final = &PP.getIdentifierTable().get("final");
- Ident_override = &PP.getIdentifierTable().get("override");
- }
-
- if (II == Ident_final) {
- FinalLoc = ConsumeToken();
+ assert(isCXX0XFinalKeyword() && "not a class definition");
+ FinalLoc = ConsumeToken();
- if (!getLang().CPlusPlus0x)
- Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
- }
+ if (!getLang().CPlusPlus0x)
+ Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
}
if (Tok.is(tok::colon)) {
More information about the cfe-commits
mailing list