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

Marius Brehler llvmlistbot at llvm.org
Fri Feb 2 03:05:53 PST 2024


marbre wrote:

> I agree with the need to declare external functions. We can't rewrite an external func.func to a emitc.declare_func though. The former provides a symbol while the latter refrences an existing symbol. We can convert it to an emitc.func with empty body and adjust the emitter to print it correctly as a declaration. Then `extern "C"` would simply go into the specifier attribute.

I'll prototype something and see if we have other options. If those don't work out and if we follow this approach, we could (more or less) land the current implementation of `emitc.declare_func` as is. Any objections @simon-camp @AlexDenisov?

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


More information about the Mlir-commits mailing list