[Mlir-commits] [mlir] [mlir][emitc] Add a `declare_func` operation (PR #80297)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Feb 1 12:09:22 PST 2024
AlexDenisov wrote:
> Allow function declarations in function bodies, but disallow declarations for static functions.
> Allow function declarations anyway and check if the output results in legal C in a validation pass (a validation pass is something I am currently working on).
These two sound better than disallowing them completely.
> To make sure I understand what you're proposing: A func.func with empty body should be converted to a emitc.declare_func with an extern specifier?
Yes, exactly. Although, I'm not sure about the `extern` specifier: it would help to have a mechanism to specify `extern "C"` without having a conflict.
https://github.com/llvm/llvm-project/pull/80297
More information about the Mlir-commits
mailing list