From d064951b0dcc95f8604d0d69ae82d9ecbd38c796 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 27 Sep 2007 19:52:15 +0000 Subject: [PATCH] Patch to use case-stmt for keywords used as selectgor names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42416 91177308-0d34-0410-b5e6-96231b3b80d8 --- Parse/ParseObjc.cpp | 51 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp index d8361b07df..ba29edec4b 100644 --- a/Parse/ParseObjc.cpp +++ b/Parse/ParseObjc.cpp @@ -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; } -- 2.50.1