Displaying 3 results from an estimated 3 matches for "changecontext".
2015 Jun 02
2
[LLVMdev] Linking modules across contexts crashes
...ible, without changing most of the objects at all. It should cause the source context to disappear.
If you want to work on a solution, I think a better approach would be
adding API for one (or both) of:
class Module {
public:
/// Move this module to the given context.
void changeContext(LLVMContext &NewContext);
};
/// Remap the given module in a different context.
std::unique_ptr<Module> remapModuleToContext(
const Module &M, LLVMContext &NewContext);
I'm not sure what your exact use case is, but I could see either/both
interfaces being...
2015 Jun 04
2
[LLVMdev] Linking modules across contexts crashes
> 1. How to find all constants in Module? Does this code find all of them, or
> they are somewhere else too?
> for (GlobalVariable &GV : globals()) {
> if (auto C = static_cast<Constant*>(GV.Op<0>().get())) {
> ... C is Constant*
> }
> }
Constants are unfortunately part of the Context, not the module :-(
Cheers,
Rafael
2015 Jun 01
2
[LLVMdev] Linking modules across contexts crashes
> On 2015-Jun-01, at 11:06, Reid Kleckner <rnk at google.com> wrote:
>
> I'm pretty sure module linking is expected to occur in the same LLVM context.
Correct.
> IIRC Duncan had some proposal for how ld64 could do something clever with multiple contexts, but I've totally forgotten what it was.
This was for LTO (probably unrelated to Yuri's scenario?).
1.