[Mlir-commits] [mlir] [MLIR][DLTI] Enable types as keys in DLTI-query utils (PR #105995)

Renato Golin llvmlistbot at llvm.org
Sun Aug 25 15:26:47 PDT 2024


================
@@ -438,6 +438,17 @@ FailureOr<Attribute> dlti::query(Operation *op, ArrayRef<StringAttr> keys,
     return failure();
   }
 
+  auto keyToStr = [](DataLayoutEntryKey key) -> std::string {
+    if (auto strKey = llvm::dyn_cast<StringAttr>(key))
+      return "\"" + std::string(strKey.getValue()) + "\"";
----------------
rengolin wrote:

Is there no other way to automatically quote?

Will the `value` always able to be converted to string in the future? For example, if we want to add more attributes here.

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


More information about the Mlir-commits mailing list