From b79a25b124376262b5df89686bf0c374ada0e977 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 22 May 2019 21:28:20 +0000 Subject: TableGen: Handle nontrivial foreach range bounds This allows using anything that isn't a literal integer as the bounds for a foreach. Some of the diagnostics aren't perfect, but nobody ever accused tablegen of having good errors. For example, the existing wording suggests a bitrange is valid, but as far as I can tell this has never worked. Fixes bug 41958. llvm-svn: 361434 --- llvm/lib/TableGen/TGParser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/TableGen/TGParser.h') diff --git a/llvm/lib/TableGen/TGParser.h b/llvm/lib/TableGen/TGParser.h index 38b782461bd..af2b639f8d5 100644 --- a/llvm/lib/TableGen/TGParser.h +++ b/llvm/lib/TableGen/TGParser.h @@ -190,7 +190,8 @@ private: // Parser methods. bool ParseOptionalRangeList(SmallVectorImpl &Ranges); bool ParseOptionalBitList(SmallVectorImpl &Ranges); void ParseRangeList(SmallVectorImpl &Result); - bool ParseRangePiece(SmallVectorImpl &Ranges); + bool ParseRangePiece(SmallVectorImpl &Ranges, + TypedInit *FirstItem = nullptr); RecTy *ParseType(); Init *ParseOperation(Record *CurRec, RecTy *ItemType); Init *ParseOperationCond(Record *CurRec, RecTy *ItemType); -- cgit v1.2.3