[Mlir-commits] [mlir] [mlir][NFC] Use DefaultUnreachable in TypeSwitch (PR #230333)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Oct 8 17:48:35 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-llvm
Author: Benjamin Wu (benjaminwuTT)
<details>
<summary>Changes</summary>
Simplify unreachable case in `TypeSwitch` to use `DefaultUnreachable`.
Similar to #<!-- -->162010.
---
Full diff: https://github.com/llvm/llvm-project/pull/230333.diff
1 Files Affected:
- (modified) mlir/lib/Target/LLVMIR/DebugTranslation.cpp (+2-3)
``````````diff
diff --git a/mlir/lib/Target/LLVMIR/DebugTranslation.cpp b/mlir/lib/Target/LLVMIR/DebugTranslation.cpp
index 6934aab253070..6c091389f22e8 100644
--- a/mlir/lib/Target/LLVMIR/DebugTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/DebugTranslation.cpp
@@ -276,9 +276,8 @@ llvm::DIDerivedType *DebugTranslation::translateImpl(DIDerivedTypeAttr attr) {
return llvm::ConstantAsMetadata::get(
llvm::ConstantInt::get(llvmCtx, intAttr.getValue()));
})
- .Default([](Attribute) -> llvm::Metadata * {
- llvm_unreachable("verifier guarantees DINodeAttr or IntegerAttr");
- });
+ .DefaultUnreachable(
+ "verifier guarantees DINodeAttr or IntegerAttr");
}
return llvm::DIDerivedType::get(
``````````
</details>
https://github.com/llvm/llvm-project/pull/230333
More information about the Mlir-commits
mailing list