[clang] [CIR] Fix warnings related to unused variables in release builds (PR #151412)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 31 04:48:33 PDT 2025


================
@@ -216,8 +216,7 @@ void CIRGenFunction::emitAndUpdateRetAlloca(QualType type, mlir::Location loc,
 void CIRGenFunction::declare(mlir::Value addrVal, const Decl *var, QualType ty,
                              mlir::Location loc, CharUnits alignment,
                              bool isParam) {
-  const auto *namedVar = dyn_cast_or_null<NamedDecl>(var);
-  assert(namedVar && "Needs a named decl");
+  assert(mlir::isa<NamedDecl>(var) && "Needs a named decl");
----------------
xlauko wrote:

This is not mlir thing:

```suggestion
  assert(isa<NamedDecl>(var) && "Needs a named decl");
```

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


More information about the cfe-commits mailing list