[llvm] [GlobalISel] Combiner: Fix warning after #102163 (PR #104441)

Tobias Stadler via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 07:21:57 PDT 2024


https://github.com/tobias-stadler created https://github.com/llvm/llvm-project/pull/104441

Default case in covered switches is illegal.
https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations


>From c061d281daa31516fa6cb64da79c373130e8b75f Mon Sep 17 00:00:00 2001
From: Tobias Stadler <mail at stadler-tobias.de>
Date: Thu, 15 Aug 2024 16:21:39 +0200
Subject: [PATCH] [spr] initial version

Created using spr 1.3.6-wip
---
 llvm/lib/CodeGen/GlobalISel/Combiner.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
index 75b2525e368af6..c5ec73cd5c65d8 100644
--- a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -217,9 +217,8 @@ Combiner::WorkListMaintainer::create(Level Lvl, WorkListTy &WorkList,
   case Level::SinglePass:
     return std::make_unique<WorkListMaintainerImpl<Level::SinglePass>>(WorkList,
                                                                        MRI);
-  default:
-    llvm_unreachable("Illegal ObserverLevel");
   }
+  llvm_unreachable("Illegal ObserverLevel");
 }
 
 Combiner::Combiner(MachineFunction &MF, CombinerInfo &CInfo,



More information about the llvm-commits mailing list