diff options
author | Javed Absar <javed.absar@arm.com> | 2019-03-26 11:16:01 +0000 |
---|---|---|
committer | Javed Absar <javed.absar@arm.com> | 2019-03-26 11:16:01 +0000 |
commit | c85cb2fb5d7533ef7dffe1e2729c003fa1c9574b (patch) | |
tree | 630f3317d40a0c9c4fa134cf2c9fff4b91ea0416 /llvm/lib/TableGen | |
parent | 33888ff66b1950da4af2025da5d368f6a0038fd1 (diff) | |
download | bcm5719-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.cpp | 4 |
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()) { |