aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/TGParser.cpp
diff options
context:
space:
mode:
authorPaul C. Anagnostopoulos <paul@windfall.com>2020-08-21 23:22:06 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2020-08-21 23:33:57 +0200
commit196e6f9f18933ed33eee39a1c9350ccce6b18e2c (patch)
treed40ae0b507fafb714403019aca3154d05bd8a2f0 /llvm/lib/TableGen/TGParser.cpp
parent503deec2183d466dad64b763bab4e15fd8804239 (diff)
downloadllvm-196e6f9f18933ed33eee39a1c9350ccce6b18e2c.zip
llvm-196e6f9f18933ed33eee39a1c9350ccce6b18e2c.tar.gz
llvm-196e6f9f18933ed33eee39a1c9350ccce6b18e2c.tar.bz2
Replace TableGen range piece punctuator with '...'
The TableGen range piece punctuator is currently '-' (e.g., {0-9}), which interacts oddly with the fact that an integer literal's sign is part of the literal. This patch replaces the '-' with the new punctuator '...'. The '-' punctuator is deprecated. Differential Revision: https://reviews.llvm.org/D85585 Change-Id: I3d53d14e23f878b142d8f84590dd465a0fb6c09c
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r--llvm/lib/TableGen/TGParser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index 39c29d6..7c6902a 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -671,8 +671,10 @@ ParseSubMultiClassReference(MultiClass *CurMC) {
/// ParseRangePiece - Parse a bit/value range.
/// RangePiece ::= INTVAL
+/// RangePiece ::= INTVAL '...' INTVAL
/// RangePiece ::= INTVAL '-' INTVAL
-/// RangePiece ::= INTVAL INTVAL
+/// RangePiece ::= INTVAL INTVAL
+// The last two forms are deprecated.
bool TGParser::ParseRangePiece(SmallVectorImpl<unsigned> &Ranges,
TypedInit *FirstItem) {
Init *CurVal = FirstItem;
@@ -693,6 +695,8 @@ bool TGParser::ParseRangePiece(SmallVectorImpl<unsigned> &Ranges,
default:
Ranges.push_back(Start);
return false;
+
+ case tgtok::dotdotdot:
case tgtok::minus: {
Lex.Lex(); // eat
@@ -2167,7 +2171,7 @@ Init *TGParser::ParseValue(Record *CurRec, RecTy *ItemType, IDParseMode Mode) {
}
break;
}
- case tgtok::period: {
+ case tgtok::dot: {
if (Lex.Lex() != tgtok::Id) { // eat the .
TokError("expected field identifier after '.'");
return nullptr;