summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2018-03-09 12:24:20 +0000
committerNicolai Haehnle <nhaehnle@gmail.com>2018-03-09 12:24:20 +0000
commit2435855abe6ccb1cd874f0e5e699815a2697b73d (patch)
tree9f254aa1997ec2331c32cdbc0789a62aa67faca7 /llvm/lib/TableGen/TGParser.cpp
parent64da6990366551f803474f93030866ae2c283b59 (diff)
downloadbcm5719-llvm-2435855abe6ccb1cd874f0e5e699815a2697b73d.tar.gz
bcm5719-llvm-2435855abe6ccb1cd874f0e5e699815a2697b73d.zip
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
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp4
1 files changed, 2 insertions, 2 deletions
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<ListInit>(List);
if (!ForeachListValue) {
TokError("Expected a Value list");
OpenPOWER on IntegriCloud