]> granicus.if.org Git - clang/commitdiff
Refactor: remove redundant check for 'final' specifier when parsing class/struct...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 15 Oct 2011 04:21:46 +0000 (04:21 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 15 Oct 2011 04:21:46 +0000 (04:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142054 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp

index ceb988db9bbc3fe72a55f911b9fbef90ef1fdf18..b9e2e9e7016b15b4de8e6a757762c747a07d6d6e 100644 (file)
@@ -2072,20 +2072,11 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
 
   // 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)) {