[Mlir-commits] [mlir] [mlir][emitc] Add a `declare_func` operation (PR #80297)

Marius Brehler llvmlistbot at llvm.org
Sat Feb 3 13:24:47 PST 2024


================
@@ -393,6 +393,24 @@ FunctionType CallOp::getCalleeType() {
   return FunctionType::get(getContext(), getOperandTypes(), getResultTypes());
 }
 
+//===----------------------------------------------------------------------===//
+// DeclareFuncOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult
+DeclareFuncOp::verifySymbolUses(SymbolTableCollection &symbolTable) {
+  // Check that the callee attribute was specified.
+  auto fnAttr = (*this)->getAttrOfType<FlatSymbolRefAttr>("callee");
+  if (!fnAttr)
+    return emitOpError("requires a 'callee' symbol reference attribute");
----------------
marbre wrote:

(Will adjust `emitc.call` in a follow up if this is landed this way.)

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


More information about the Mlir-commits mailing list