[Mlir-commits] [mlir] [MLIR][LLVM] Allow strings in module flag value (PR #136793)

Tobias Gysi llvmlistbot at llvm.org
Tue Apr 22 23:00:49 PDT 2025


================
@@ -375,3 +375,13 @@ TargetFeaturesAttr TargetFeaturesAttr::featuresAt(Operation *op) {
   return parentFunction.getOperation()->getAttrOfType<TargetFeaturesAttr>(
       getAttributeName());
 }
+
+LogicalResult
+ModuleFlagAttr::verify(function_ref<InFlightDiagnostic()> emitError,
+                       mlir::LLVM::ModFlagBehavior flagBehavior,
+                       mlir::StringAttr key, mlir::Attribute value) {
+  if (!isa<mlir::IntegerAttr, mlir::StringAttr>(value))
----------------
gysit wrote:

```suggestion
                       LLVM::ModFlagBehavior flagBehavior,
                       StringAttr key, Attribute value) {
  if (!isa<IntegerAttr, StringAttr>(value))
```
nit: the mlir namespace is probably not necessary

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


More information about the Mlir-commits mailing list