[Mlir-commits] [mlir] [mlir] Add nodiscard attribute to allowsUnregisteredDialects (PR #105530)

Jonas Rickert llvmlistbot at llvm.org
Wed Aug 21 07:00:45 PDT 2024


https://github.com/jorickert created https://github.com/llvm/llvm-project/pull/105530

This getter can easily be confused with the similar named allowUnregisteredDialects setter

>From 0094d8f77f0e5b9618220ec30418b4270c026807 Mon Sep 17 00:00:00 2001
From: "Rickert, Jonas" <Jonas.Rickert at amd.com>
Date: Wed, 21 Aug 2024 11:05:01 +0100
Subject: [PATCH] [mlir] Add nodiscard attribute to allowsUnregisteredDialects

This getter can easily be confused with the similar named
allowUnregisteredDialects setter
---
 mlir/include/mlir/IR/MLIRContext.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/include/mlir/IR/MLIRContext.h b/mlir/include/mlir/IR/MLIRContext.h
index 11e5329f43e681..d17bbac81655b5 100644
--- a/mlir/include/mlir/IR/MLIRContext.h
+++ b/mlir/include/mlir/IR/MLIRContext.h
@@ -133,7 +133,7 @@ class MLIRContext {
   Dialect *getOrLoadDialect(StringRef name);
 
   /// Return true if we allow to create operation for unregistered dialects.
-  bool allowsUnregisteredDialects();
+  [[nodiscard]] bool allowsUnregisteredDialects();
 
   /// Enables creating operations in unregistered dialects.
   /// This option is **heavily discouraged**: it is convenient during testing



More information about the Mlir-commits mailing list