mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 10:55:58 +08:00
[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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user