While compiling C++ code, I’m trying to make different function and template from the same TU go into different IR modules, in order to support sort of lazy compilation with the MCJIT.
I have tried to replace Sema CodeGen in the middle of TU. It sometimes worked but mostly crashed while running the code.
It’s clear that something is wrong but I am not sure if it’s because it breaks something in Sema-CodeGen interface assumptions or for other reason, possibly related to MCJIT dynamic linker.
Can I use Sema+CodeGen like that?