================
@@ -351,22 +351,38 @@ class ModuleTranslation {
 
   // A helper callback that takes an attribute, and if it is a StringAttr,
   // properly converts it to the 'no-builtin-VALUE' form.
-  static std::optional<std::string> convertNoBuiltin(mlir::Attribute a) {
+  static std::optional<llvm::Attribute> convertNoBuiltin(llvm::LLVMContext 
&ctx,
+                                                         mlir::Attribute a) {
     if (auto str = dyn_cast<StringAttr>(a))
-      return ("no-builtin-" + str.getValue()).str();
+      return llvm::Attribute::get(ctx, ("no-builtin-" + str.getValue()).str());
+    return std::nullopt;
+  }
+
+  static std::optional<llvm::Attribute>
+  convertDefaultFuncAttr(llvm::LLVMContext &ctx,
----------------
gysit wrote:

nit: It may make sense to move the implementation of these conversion functions 
to ModuleTranslation.cpp? Especially this one is quite long.

https://github.com/llvm/llvm-project/pull/179811
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to