[clang] [CIR] Lower pointer const_array globals without insertvalue chains (PR #198427)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 1 11:47:56 PDT 2026


================
@@ -12,28 +12,47 @@
 
 #include "clang/CIR/LoweringHelpers.h"
 #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
+#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
+#include "mlir/IR/SymbolTable.h"
 #include "clang/CIR/MissingFeatures.h"
 
+static unsigned getIntOrBoolBitWidth(mlir::Type ty) {
+  if (auto intTy = mlir::dyn_cast<cir::IntType>(ty))
+    return intTy.getWidth();
+  if (mlir::isa<cir::BoolType>(ty))
----------------
erichkeane wrote:

```suggestion
  assert(mlir::isa<cir::BoolType>(ty));
```
Then you can just remove the unreachable.

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


More information about the cfe-commits mailing list