[Mlir-commits] [clang] [mlir] [CIR] Add tons of function infra, plus a handful of attributes (PR #179811)
Tobias Gysi
llvmlistbot at llvm.org
Wed Feb 4 22:02:39 PST 2026
================
@@ -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
More information about the Mlir-commits
mailing list