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

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 07:22:27 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: Tobias Stadler (tobias-stadler)

<details>
<summary>Changes</summary>

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


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


1 Files Affected:

- (modified) llvm/lib/CodeGen/GlobalISel/Combiner.cpp (+1-2) 


``````````diff
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,

``````````

</details>


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


More information about the llvm-commits mailing list