[clang] [llvm] [ADT] Prepare for deprecation of StringSwitch cases with 3+ args. NFC. (PR #165112)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 25 11:13:30 PDT 2025


================
@@ -3533,10 +3533,10 @@ bool X86AsmParser::parseInstruction(ParseInstructionInfo &Info, StringRef Name,
   while (isLockRepeatNtPrefix(Name.lower())) {
     unsigned Prefix =
         StringSwitch<unsigned>(Name)
-            .Cases("lock", "lock", X86::IP_HAS_LOCK)
-            .Cases("rep", "repe", "repz", X86::IP_HAS_REPEAT)
-            .Cases("repne", "repnz", X86::IP_HAS_REPEAT_NE)
-            .Cases("notrack", "notrack", X86::IP_HAS_NOTRACK)
+            .Cases({"lock", "lock"}, X86::IP_HAS_LOCK)
----------------
kazutakahirata wrote:

Not really a problem that your PR should address right now, but I wonder what's going on here listing `lock` twice.  The same applies to `notrack` below.

https://github.com/llvm/llvm-project/pull/165112


More information about the llvm-commits mailing list