]> granicus.if.org Git - clang/commitdiff
Patch to use case-stmt for keywords used as selectgor names.
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 27 Sep 2007 19:52:15 +0000 (19:52 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 27 Sep 2007 19:52:15 +0000 (19:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42416 91177308-0d34-0410-b5e6-96231b3b80d8

Parse/ParseObjc.cpp

index d8361b07df129f7702cff15bc2b7dc16bc83265d..ba29edec4bf83e6abbba777f2ad2b18c8422729b 100644 (file)
@@ -399,13 +399,52 @@ Parser::DeclTy *Parser::ParseObjCMethodPrototype(DeclTy *IDecl,
 IdentifierInfo *Parser::ParseObjCSelector() {
   tok::TokenKind tKind = Tok.getKind();
   IdentifierInfo *II = 0;
+  switch (tKind) {
+    case tok::identifier:
+    case tok::kw_typeof:
+    case tok::kw___alignof:
+    case tok::kw_auto:
+    case tok::kw_break:                    
+    case tok::kw_case:                        
+    case tok::kw_char:                        
+    case tok::kw_const:                       
+    case tok::kw_continue:                    
+    case tok::kw_default:                     
+    case tok::kw_do:                          
+    case tok::kw_double:                      
+    case tok::kw_else:                        
+    case tok::kw_enum:                        
+    case tok::kw_extern:                      
+    case tok::kw_float:                       
+    case tok::kw_for:                         
+    case tok::kw_goto:                        
+    case tok::kw_if:                       
+    case tok::kw_inline:                     
+    case tok::kw_int:                         
+    case tok::kw_long:                        
+    case tok::kw_register:                    
+    case tok::kw_restrict:
+    case tok::kw_return:                      
+    case tok::kw_short:                       
+    case tok::kw_signed:                      
+    case tok::kw_sizeof:                      
+    case tok::kw_static:                      
+    case tok::kw_struct:                      
+    case tok::kw_switch:                      
+    case tok::kw_typedef:                     
+    case tok::kw_union:                       
+    case tok::kw_unsigned:                    
+    case tok::kw_void:                        
+    case tok::kw_volatile:                    
+    case tok::kw_while:                       
+    case tok::kw__Bool:
+    case tok::kw__Complex:
+      II = Tok.getIdentifierInfo();
+      ConsumeToken();
+    default:
+      break;
+  }
   
-  if (tKind == tok::identifier   || tKind == tok::kw_typeof ||
-      tKind == tok::kw___alignof ||
-      (tKind >= tok::kw_auto && tKind <= tok::kw__Complex)) {
-    II = Tok.getIdentifierInfo();
-    ConsumeToken();
-  } 
   return II;
 }