================
@@ -447,6 +447,20 @@ convertOperationImpl(Operation &opInst,
llvm::IRBuilderBase &builder,
"modular-format",
modFormat.getValue()));
+ if (ArrayAttr noBuiltins = callOp.getNobuiltinsAttr()) {
+ if (noBuiltins.empty())
+
call->addFnAttr(llvm::Attribute::get(moduleTranslation.getLLVMContext(),
+ "no-builtins"));
+
+ for (Attribute a : noBuiltins) {
+ if (auto str = dyn_cast<StringAttr>(a)) {
+ std::string attrName = ("no-builtin-" + str.getValue()).str();
+ call->addFnAttr(llvm::Attribute::get(
+ moduleTranslation.getLLVMContext(), attrName));
----------------
gysit wrote:
Any chance we can add a public helper to ModuleTranslation class that
translates from an ArrayAttr to an llvm::Attribute? That should allow us to
avoid the code duplication between the call and function export.
https://github.com/llvm/llvm-project/pull/178899
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits