[llvm] [NFC][SpecialCaseList] Use helper for version checks (PR #203023)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 09:09:07 PDT 2026
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/203023
>From 56281e964492aa7492d01cf87adaa6bab9791810 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 10 Jun 2026 08:34:46 -0700
Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=
=?UTF-8?q?itial=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.7
---
llvm/lib/Support/SpecialCaseList.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 7495308675c1d..7407e2c172d61 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -328,14 +328,17 @@ bool SpecialCaseList::parse(unsigned FileIdx, const MemoryBuffer *MB,
if (Header.consume_front("#!special-case-list-v"))
consumeUnsignedInteger(Header, 10, Version);
+ auto MinVersion = [&](unsigned V) { return Version >= V; };
+
// In https://reviews.llvm.org/D154014 we added glob support and planned
// to remove regex support in patterns. We temporarily support the
// original behavior using regexes if "#!special-case-list-v1" is the
// first line of the file. For more details, see
// https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666
- bool UseGlobs = Version > 1;
- bool RemoveDotSlash = Version > 2;
+ bool UseGlobs = MinVersion(2);
+
+ bool RemoveDotSlash = MinVersion(3);
auto ErrOrSection = addSection("*", FileIdx, 1, true);
if (auto Err = ErrOrSection.takeError()) {
>From dd4012d27ff0f60cd423b680fab266b65c31cc14 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 10 Jun 2026 08:36:30 -0700
Subject: [PATCH 2/2] space
Created using spr 1.3.7
---
llvm/lib/Support/SpecialCaseList.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index 7407e2c172d61..10377b747e93e 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -335,7 +335,6 @@ bool SpecialCaseList::parse(unsigned FileIdx, const MemoryBuffer *MB,
// original behavior using regexes if "#!special-case-list-v1" is the
// first line of the file. For more details, see
// https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666
-
bool UseGlobs = MinVersion(2);
bool RemoveDotSlash = MinVersion(3);
More information about the llvm-commits
mailing list