Skip to content

Conversation

@kuhar
Copy link
Member

@kuhar kuhar commented Oct 25, 2025

Suggest the initializer_list overload instead.

3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites.

For more context, see #163117.

Suggest the `initializer_list` overload instead.

3+ args is an arbitrary number that allows for incremental depreciation
without having to update too many call sites.

For more context, see llvm#163117.
@llvmbot
Copy link
Member

llvmbot commented Oct 25, 2025

@llvm/pr-subscribers-lld-wasm
@llvm/pr-subscribers-lld-macho
@llvm/pr-subscribers-clang-tools-extra
@llvm/pr-subscribers-clang-static-analyzer-1
@llvm/pr-subscribers-backend-mips
@llvm/pr-subscribers-lld
@llvm/pr-subscribers-clang-tidy
@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-llvm-adt

Author: Jakub Kuderski (kuhar)

Changes

Suggest the initializer_list overload instead.

3+ args is an arbitrary number that allows for incremental depreciation without having to update too many call sites.

For more context, see #163117.


Full diff: https://github.com/llvm/llvm-project/pull/165119.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/StringSwitch.h (+2)
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index 2262b1162e330..98685de8573fa 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -93,6 +93,7 @@ class StringSwitch {
     return CasesImpl({S0, S1}, Value);
   }
 
+  [[deprecated("Pass cases in std::initializer_list instead")]]
   StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
                       T Value) {
     return CasesImpl({S0, S1, S2}, Value);
@@ -176,6 +177,7 @@ class StringSwitch {
     return CasesLowerImpl({S0, S1}, Value);
   }
 
+  [[deprecated("Pass cases in std::initializer_list instead")]]
   StringSwitch &CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2,
                            T Value) {
     return CasesLowerImpl({S0, S1, S2}, Value);

Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@kuhar kuhar enabled auto-merge (squash) October 25, 2025 22:04
@kuhar kuhar requested a review from JDevlieghere as a code owner October 25, 2025 22:28
@llvmbot llvmbot added clang Clang issues not falling into any other category clang-tools-extra lld lldb backend:MIPS clang-tidy clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:static analyzer lld:MachO lld:ELF lld:COFF lld:wasm labels Oct 25, 2025
@kuhar kuhar disabled auto-merge October 25, 2025 22:29
@github-actions
Copy link

github-actions bot commented Oct 25, 2025

✅ With the latest revision this PR passed the C/C++ code linter.

@kuhar kuhar merged commit 3526bb0 into llvm:main Oct 25, 2025
10 of 11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 26, 2025

LLVM Buildbot has detected a new failure on builder clang-x64-windows-msvc running on windows-gcebot2 while building clang-tools-extra,clang,lld,lldb,llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/63/builds/11476

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/clang-windows.py ...' (failure)
...
  Passed           : 72545 (98.94%)
  Expectedly Failed:    36 (0.05%)
[1365/1366] Running the LLVM regression tests
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:57: note: using lit tools: C:\Program Files\Git\usr\bin
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using ld.lld: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\ld.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using lld-link: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\lld-link.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using ld64.lld: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\ld64.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using wasm-ld: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\wasm-ld.exe
-- Testing: 61160 tests, 32 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: LLVM :: tools/llvm-exegesis/RISCV/rvv/filter.test (57300 of 61160, 3 of 3 attempts)
******************** TEST 'LLVM :: tools/llvm-exegesis/RISCV/rvv/filter.test' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\llvm-exegesis.exe -mtriple=riscv64 -mcpu=sifive-x280 -benchmark-phase=assemble-measured-code --mode=inverse_throughput --opcode-name=PseudoVNCLIPU_WX_M1_MASK     --riscv-filter-config='vtype = {VXRM: rod, AVL: VLMAX, SEW: e(8|16), Policy: ta/mu}' --max-configs-per-opcode=1000 --min-instructions=10 | c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\filecheck.exe C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\test\tools\llvm-exegesis\RISCV\rvv\filter.test
# executed command: 'c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\llvm-exegesis.exe' -mtriple=riscv64 -mcpu=sifive-x280 -benchmark-phase=assemble-measured-code --mode=inverse_throughput --opcode-name=PseudoVNCLIPU_WX_M1_MASK '--riscv-filter-config=vtype = {VXRM: rod, AVL: VLMAX, SEW: e(8|16), Policy: ta/mu}' --max-configs-per-opcode=1000 --min-instructions=10
# .---command stderr------------
# | PseudoVNCLIPU_WX_M1_MASK: Failed to produce any snippet via: instruction has tied variables, avoiding Read-After-Write issue, picking random def and use registers not aliasing each other, for uses, one unique register for each position
# `-----------------------------
# executed command: 'c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\filecheck.exe' 'C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\test\tools\llvm-exegesis\RISCV\rvv\filter.test'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\filecheck.exe C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\test\tools\llvm-exegesis\RISCV\rvv\filter.test
# `-----------------------------
# error: command failed with exit status: 2

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM :: tools/llvm-exegesis/RISCV/rvv/filter.test


Testing Time: 400.27s

Total Discovered Tests: 70217
  Skipped          :    26 (0.04%)
  Unsupported      :  1389 (1.98%)
  Passed           : 68604 (97.70%)
  Expectedly Failed:   197 (0.28%)
  Failed           :     1 (0.00%)
FAILED: test/CMakeFiles/check-llvm C:/b/slave/clang-x64-windows-msvc/build/stage2/test/CMakeFiles/check-llvm 
cmd.exe /C "cd /D C:\b\slave\clang-x64-windows-msvc\build\stage2\test && C:\Python39\python.exe C:/b/slave/clang-x64-windows-msvc/build/stage2/./bin/llvm-lit.py -sv -j 32 C:/b/slave/clang-x64-windows-msvc/build/stage2/test"
ninja: build stopped: subcommand failed.
Step 12 (stage 2 check) failure: stage 2 check (failure)
...
  Passed           : 72545 (98.94%)
  Expectedly Failed:    36 (0.05%)
[1365/1366] Running the LLVM regression tests
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:57: note: using lit tools: C:\Program Files\Git\usr\bin
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using ld.lld: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\ld.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using lld-link: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\lld-link.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using ld64.lld: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\ld64.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:531: note: using wasm-ld: c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\wasm-ld.exe
-- Testing: 61160 tests, 32 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: LLVM :: tools/llvm-exegesis/RISCV/rvv/filter.test (57300 of 61160, 3 of 3 attempts)
******************** TEST 'LLVM :: tools/llvm-exegesis/RISCV/rvv/filter.test' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\llvm-exegesis.exe -mtriple=riscv64 -mcpu=sifive-x280 -benchmark-phase=assemble-measured-code --mode=inverse_throughput --opcode-name=PseudoVNCLIPU_WX_M1_MASK     --riscv-filter-config='vtype = {VXRM: rod, AVL: VLMAX, SEW: e(8|16), Policy: ta/mu}' --max-configs-per-opcode=1000 --min-instructions=10 | c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\filecheck.exe C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\test\tools\llvm-exegesis\RISCV\rvv\filter.test
# executed command: 'c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\llvm-exegesis.exe' -mtriple=riscv64 -mcpu=sifive-x280 -benchmark-phase=assemble-measured-code --mode=inverse_throughput --opcode-name=PseudoVNCLIPU_WX_M1_MASK '--riscv-filter-config=vtype = {VXRM: rod, AVL: VLMAX, SEW: e(8|16), Policy: ta/mu}' --max-configs-per-opcode=1000 --min-instructions=10
# .---command stderr------------
# | PseudoVNCLIPU_WX_M1_MASK: Failed to produce any snippet via: instruction has tied variables, avoiding Read-After-Write issue, picking random def and use registers not aliasing each other, for uses, one unique register for each position
# `-----------------------------
# executed command: 'c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\filecheck.exe' 'C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\test\tools\llvm-exegesis\RISCV\rvv\filter.test'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\b\slave\clang-x64-windows-msvc\build\stage2\bin\filecheck.exe C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\test\tools\llvm-exegesis\RISCV\rvv\filter.test
# `-----------------------------
# error: command failed with exit status: 2

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM :: tools/llvm-exegesis/RISCV/rvv/filter.test


Testing Time: 400.27s

Total Discovered Tests: 70217
  Skipped          :    26 (0.04%)
  Unsupported      :  1389 (1.98%)
  Passed           : 68604 (97.70%)
  Expectedly Failed:   197 (0.28%)
  Failed           :     1 (0.00%)
FAILED: test/CMakeFiles/check-llvm C:/b/slave/clang-x64-windows-msvc/build/stage2/test/CMakeFiles/check-llvm 
cmd.exe /C "cd /D C:\b\slave\clang-x64-windows-msvc\build\stage2\test && C:\Python39\python.exe C:/b/slave/clang-x64-windows-msvc/build/stage2/./bin/llvm-lit.py -sv -j 32 C:/b/slave/clang-x64-windows-msvc/build/stage2/test"
ninja: build stopped: subcommand failed.

varun-r-mallya pushed a commit to varun-r-mallya/llvm-project that referenced this pull request Oct 27, 2025
Suggest the `initializer_list` overload instead.

3+ args is an arbitrary number that allows for incremental depreciation
without having to update too many call sites.

For more context, see llvm#163117.
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
Suggest the `initializer_list` overload instead.

3+ args is an arbitrary number that allows for incremental depreciation
without having to update too many call sites.

For more context, see llvm#163117.
dtzSiFive added a commit to llvm/circt that referenced this pull request Oct 28, 2025
dtzSiFive added a commit to llvm/circt that referenced this pull request Oct 28, 2025
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
Suggest the `initializer_list` overload instead.

3+ args is an arbitrary number that allows for incremental depreciation
without having to update too many call sites.

For more context, see llvm#163117.
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
Suggest the `initializer_list` overload instead.

3+ args is an arbitrary number that allows for incremental depreciation
without having to update too many call sites.

For more context, see llvm#163117.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:MIPS clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:static analyzer clang Clang issues not falling into any other category clang-tidy clang-tools-extra lld:COFF lld:ELF lld:MachO lld:wasm lld lldb llvm:adt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants