[clang] [mlir] [CIR] Add tons of function infra, plus a handful of attributes (PR #179811)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 5 10:56:49 PST 2026
================
@@ -351,22 +351,25 @@ 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) {
- if (auto str = dyn_cast<StringAttr>(a))
- return ("no-builtin-" + str.getValue()).str();
- return std::nullopt;
- }
+ static std::optional<llvm::Attribute> convertNoBuiltin(llvm::LLVMContext &ctx,
+ mlir::Attribute a);
+
+ static std::optional<llvm::Attribute>
+ convertDefaultFuncAttr(llvm::LLVMContext &ctx,
+ mlir::NamedAttribute namedAttr);
/// A template that takes an ArrayAttr, converts it via a user provided
/// callback, then adds each element to as function attributes to the provided
/// operation.
- template <typename Operation, typename Converter>
- void convertFunctionArrayAttr(ArrayAttr array, Operation *op,
+ template <typename ArrayTy, typename Operation, typename Converter>
+ void convertFunctionArrayAttr(ArrayTy arrayAttr, Operation *op,
----------------
xlauko wrote:
A bit misleading comment and name as it now takes both Dictionary and Array attributes. Maybe `convertFunctionAttrs` and `AttrsTy` is more appropriate?
https://github.com/llvm/llvm-project/pull/179811
More information about the cfe-commits
mailing list