From 2435855abe6ccb1cd874f0e5e699815a2697b73d Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Fri, 9 Mar 2018 12:24:20 +0000 Subject: TableGen: Remove unused ParseForeachMode Use the default ParseValueMode instead of ParseForeachMode when parsing the rule ForeachDeclaration ::= ID '=' '[' ValueList ']' because the only difference between the two is how an open brace '{' is handled at the end. In the context of foreach, the 'in' keyword will appear after the ForeachDeclaration, so this special handling of '{' is not required. Change-Id: I4d86bb73bab9ec26752e1273e5213df77cf28d1d llvm-svn: 327119 --- llvm/lib/TableGen/TGParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/TableGen/TGParser.cpp') diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 47c734502f0..59f5e6e5866 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -1761,7 +1761,7 @@ Init *TGParser::ParseValue(Record *CurRec, RecTy *ItemType, IDParseMode Mode) { switch (Lex.getCode()) { default: return Result; case tgtok::l_brace: { - if (Mode == ParseNameMode || Mode == ParseForeachMode) + if (Mode == ParseNameMode) // This is the beginning of the object body. return Result; @@ -2064,7 +2064,7 @@ VarInit *TGParser::ParseForeachDeclaration(ListInit *&ForeachListValue) { switch (Lex.getCode()) { default: TokError("Unknown token when expecting a range list"); return nullptr; case tgtok::l_square: { // '[' ValueList ']' - Init *List = ParseSimpleValue(nullptr, nullptr, ParseForeachMode); + Init *List = ParseSimpleValue(nullptr); ForeachListValue = dyn_cast(List); if (!ForeachListValue) { TokError("Expected a Value list"); -- cgit v1.2.3