[mlir][LLVM] Add support for adding a garbage collector to a LLVM function

This patch simply adds an optional garbage collector attribute to LLVMFuncOp which maps 1:1 to the "gc" property of functions in LLVM.

Differential Revision: https://reviews.llvm.org/D119492
This commit is contained in:
Markus Böck
2022-02-11 10:23:35 +01:00
parent e714b98fff
commit 1bf7921374
5 changed files with 19 additions and 0 deletions

View File

@@ -797,6 +797,9 @@ LogicalResult ModuleTranslation::convertOneFunction(LLVMFuncOp func) {
llvmFunc->setPersonalityFn(pfunc);
}
if (auto gc = func.getGarbageCollector())
llvmFunc->setGC(gc->str());
// First, create all blocks so we can jump to them.
llvm::LLVMContext &llvmContext = llvmFunc->getContext();
for (auto &bb : func) {