[cfe-commits] r42416 - /cfe/trunk/Parse/ParseObjc.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Sep 27 12:52:16 PDT 2007
Author: fjahanian
Date: Thu Sep 27 14:52:15 2007
New Revision: 42416
URL: http://llvm.org/viewvc/llvm-project?rev=42416&view=rev
Log:
Patch to use case-stmt for keywords used as selectgor names.
Modified:
cfe/trunk/Parse/ParseObjc.cpp
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=42416&r1=42415&r2=42416&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Thu Sep 27 14:52:15 2007
@@ -399,13 +399,52 @@
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;
}
More information about the cfe-commits
mailing list