The bug was reported here https://bugs.llvm.org/show_bug.cgi?id=52030
This patch follows the idea that @lhames commented in the above webpage.
Differential D110990
[Orc] Fix global variable destructor function support when --jit-kind=orc-lazy StephenFan on Oct 2 2021, 2:40 AM. Authored by
Details The bug was reported here https://bugs.llvm.org/show_bug.cgi?id=52030 This patch follows the idea that @lhames commented in the above webpage.
Diff Detail
Event TimelineComment Actions LGTM. Thanks Stephen!
Comment Actions Solves my original problem that lead to https://bugs.llvm.org/show_bug.cgi?id=52030. Thank you for working on this!
|
It would be good to use a DeInitFunctionPrefix here (along the same lines as InitFunctionPrefix).
Once the deinit functions are named with a known prefix we can look them up in GenericLLVMIRPlatformSupport::notifyAdding and add them to the DeInitFunctions map automatically. This will make destructors work from cached objects. This could be done in this patch, or in a follow-up.