mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
[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
This commit is contained in:
parent
889150360c
commit
9f4bee30b0
@ -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()) {
|
||||
|
@ -10,3 +10,7 @@ class BBB<list<list<int>> vals> : BB<vals>;
|
||||
|
||||
def OneB : BBB<[[1,2,3]]>;
|
||||
def TwoB : BBB<[[1,2,3],[4,5,6]]>;
|
||||
|
||||
def ThreeB: BBB<[[1,2,3],
|
||||
[4,5,6],
|
||||
]>;
|
||||
|
Loading…
Reference in New Issue
Block a user