summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorJaved Absar <javed.absar@arm.com>2019-03-26 11:16:01 +0000
committerJaved Absar <javed.absar@arm.com>2019-03-26 11:16:01 +0000
commitc85cb2fb5d7533ef7dffe1e2729c003fa1c9574b (patch)
tree630f3317d40a0c9c4fa134cf2c9fff4b91ea0416 /llvm/lib/TableGen
parent33888ff66b1950da4af2025da5d368f6a0038fd1 (diff)
downloadbcm5719-llvm-c85cb2fb5d7533ef7dffe1e2729c003fa1c9574b.tar.gz
bcm5719-llvm-c85cb2fb5d7533ef7dffe1e2729c003fa1c9574b.zip
[TableGen] Let list elements have a trailing comma
Let lists have an trailing comma to allow cleaner diffs e.g: def : Features<[FeatureA, FeatureB, ]>; Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D59247 llvm-svn: 356986
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index 3fc2e53f208..f9486d4469d 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -2283,6 +2283,10 @@ void TGParser::ParseValueList(SmallVectorImpl<Init*> &Result, Record *CurRec,
while (Lex.getCode() == tgtok::comma) {
Lex.Lex(); // Eat the comma
+ // ignore trailing comma for lists
+ if (Lex.getCode() == tgtok::r_square)
+ return;
+
if (ArgsRec && !EltTy) {
ArrayRef<Init *> TArgs = ArgsRec->getTemplateArgs();
if (ArgN >= TArgs.size()) {
OpenPOWER on IntegriCloud