search for: runstaticconstructorsdestructor

Displaying 20 results from an estimated 26 matches for "runstaticconstructorsdestructor".

2010 Jun 18
0
[LLVMdev] having troubles mixing ExecutionEngine::runStaticConstructorsDestructors() and Linker::LinkModules()
...(create a new module B and use Linker::LinkModules() to merge into A, and be able to JIT the new symbols). This appears to work ok, except that static constructors are giving me a headache. Generally, I start like this: Create module A (e.g. via Clang, LLVM API etc.) EE->addModule(A); EE->runStaticConstructorsDestructors(A, false); EE->getPointerToFunction(A->getFunction(funcname)); Then, create module B (e.g. via Clang, LLVM API etc.) to be used to extend module A. I've tried out the following sequences of calls to get this to work with statics, with the following difficulties: Option 1); Linker::Li...
2011 Sep 09
3
[LLVMdev] runStaticConstructorsDestructors not calling static destructors
Hi there, I'm having trouble getting ExecutionEngine->runStaticConstructorsDestructors(module, true) to actually trigger static destructors in my code. The static constructors however do get called. I don't know if this is an LLVM or Clang issue, from looking at the IR (see below) it looks like the destructor is being tied to cxa_atexit, and I wonder if that is not called by r...
2011 Sep 09
0
[LLVMdev] runStaticConstructorsDestructors not calling static destructors
On Fri, Sep 9, 2011 at 1:36 PM, Graham Wakefield <wakefield at mat.ucsb.edu> wrote: > Hi there, > > I'm having trouble getting ExecutionEngine->runStaticConstructorsDestructors(module, true) to actually trigger static destructors in my code. The static constructors however do get called. > > I don't know if this is an LLVM or Clang issue, from looking at the IR (see below) it looks like the destructor is being tied to cxa_atexit, and I wonder if that is not cal...
2018 Jun 14
3
runStaticConstructorsDestructors() causes crash on exit
Greetings, LLVM wizards. I am using clang to compile a C++ module, and an ExecutionEngine (MCJIT) to execute a function it defines. That works (or pretends to). However, if I call the module's constructors first: exec_engine->runStaticConstructorsDestructors(false); exec_engine->runFunctionAsMain(function, argvec, NULL); execution still works, but my program crashes when it exits, in __run_exit_handlers(). I can't tell from gdb what exit handler is crashing, but no calls are made to atexit() or on_exit(); all exit handlers are installed via __...
2018 Jun 19
2
runStaticConstructorsDestructors() causes crash on exit
...; > > > Greetings, LLVM wizards. > > > > I am using clang to compile a C++ module, and an ExecutionEngine (MCJIT) > to execute a function it defines. That works (or pretends to). However, if > I call the module's constructors first: > > > > exec_engine->runStaticConstructorsDestructors(false); > > exec_engine->runFunctionAsMain(function, argvec, NULL); > > > > execution still works, but my program crashes when it exits, in > __run_exit_handlers(). I can't tell from gdb what exit handler is crashing, > but no calls are made to atexit() or on_exit();...
2008 Aug 31
1
[LLVMdev] Correct way of JITing multiple modules?
...as to create a new ExecutionEngine for each Module, however this generates an assert failure. If I create a new ModuleProvider for each new Module and then add this to a single ExecutionEngine then I have a problem with static constructors not being run. With a single module, I can call runStaticConstructorsDestructors(). With the second one, neither ommitting this nor calling it a second time appears to work (I don't think either of these is exactly correct, since I don't want to run the static constructors on pre-existing modules twice, I just want static ctors to run in the new module). Can...
2013 Oct 22
1
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy, I added the runStaticConstructorsDestructors and FindFunctionNamed functions. This also required making them virtual in EE.h. I'm not sure about FindFunctionNamed: In addition to searching finalized modules, should it search Added and Loaded modules? If it finds a Function in these, should it compile and finalize it before returning the...
2018 Jun 21
2
runStaticConstructorsDestructors() causes crash on exit
...etings, LLVM wizards. > > > > > > I am using clang to compile a C++ module, and an ExecutionEngine > (MCJIT) to execute a function it defines. That works (or pretends to). > However, if I call the module's constructors first: > > > > > > exec_engine->runStaticConstructorsDestructors(false); > > > exec_engine->runFunctionAsMain(function, argvec, NULL); > > > > > > execution still works, but my program crashes when it exits, in > __run_exit_handlers(). I can't tell from gdb what exit handler is crashing, > but no calls are made to atexit(...
2019 Mar 14
2
Static constructors with ORC JIT?
Hi all, Is there way to tell the ORC JIT infrastructure to run the static constructors in a module that has just been compiled? I see that the ExecutionEngine class has a runStaticConstructorsDestructors function, is that relevant with ORC and if so, how should it be accessed? Thanks, Daniele -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190314/2775cb9f/attachment.html>
2018 Jun 25
2
runStaticConstructorsDestructors() causes crash on exit
.... > > > > > > > > I am using clang to compile a C++ module, and an ExecutionEngine > (MCJIT) to execute a function it defines. That works (or pretends to). > However, if I call the module's constructors first: > > > > > > > > exec_engine->runStaticConstructorsDestructors(false); > > > > exec_engine->runFunctionAsMain(function, argvec, NULL); > > > > > > > > execution still works, but my program crashes when it exits, in > __run_exit_handlers(). I can't tell from gdb what exit handler is crashing, > but no calls are...
2019 Mar 15
2
Static constructors with ORC JIT?
...> On 14. Mar 2019, at 22:15, Daniele Vettorel via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi all, > > Is there way to tell the ORC JIT infrastructure to run the static constructors in a module that has just been compiled? I see that the ExecutionEngine class has a > runStaticConstructorsDestructors > function, is that relevant with ORC and if so, how should it be accessed? Thanks, Daniele > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
2013 Oct 22
0
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Yaron, Overall this looks great. There are a couple of remaining holes. Specifically, MCJIT inherits implementations of the FindFunctionNamed and runStaticConstructorsDestructors methods from ExecutionEngine which use the old Modules vector, so you'll need to override these in MCJIT. (The implementations are fairly trivial.) Beyond that I just have a couple of questions. First, OwningModuleContainer::hasModuleBeenAdded seems wrong. It seems to me that it should be...
2010 Nov 02
1
[LLVMdev] Forcing the Interpreter segfaults
...REFunc jit = u.func; int ret = jit("aaa"); std::cout << std::endl << ret << std::endl; // This code interprets the function llvm::initializeCore(); llvm::ExecutionEngine * EI = llvm::EngineBuilder(&M).setEngineKind(llvm::EngineKind::Interpreter).create(); EI->runStaticConstructorsDestructors(false); std::vector<llvm::GenericValue> args; llvm::GenericValue arg1((void*)"aaabc"); args.push_back(arg1); llvm::APInt res = EI->runFunction(func, args).IntVal; llvm::outs() << res << "\n"; The first block of code works very well and write the expected...
2013 Oct 22
2
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy, Here is the patch. it incorporates: 1) your latest patch to SVN. 2) mcjit-module-state-optimization.patch. 3) the PtrSet changes. Other than the OwnedModules implementation there were other differences between 1) and 2), especially in the Finalize* functions, so please review that I got the right code. I got bitten by subtle bugs arising from MCJIT inheriting from EE: First, MCJIT
2010 Jan 29
2
[LLVMdev] Redefining function
...Module *file1(LoadFile("file1.bc",Context)); Module *file2(LoadFile("file2.bc",Context)); Module *file3(LoadFile("file3.bc",Context)); Linker::LinkModules(file1, file2, NULL); EngineBuilder builder(file1); ExecutionEngine *EE = builder.create(); EE->runStaticConstructorsDestructors(false); func = EE->FindFunctionNamed("do_print"); EE->runFunction(func, std::vector<GenericValue>()); //swap the definition of the function "print" from the one in File2.c to File3.c swap (file1, file2, file3); EE->runFunction(func, std::vector<Ge...
2010 Jan 31
1
[LLVMdev] Boehm GC + static variables?
...#39;t necessarily the case. The default JMM allocates slabs with mmap, which doesn't guarantee that they're in order. > - llvm.global_ctors for a given module is run before any other code can > reference static variables belonging to that module. llvm.global_ctors runs when you call runStaticConstructorsDestructors(false), which lli does before running any other user code. There could be other global constructors that access the globals, though, before your constructor runs. > Can anyone confirm if I can rely on these assumptions? > > -- James > > > On 31 January 2010 12:53, James Williams...
2010 Nov 02
2
[LLVMdev] Forcing the Interpreter segfaults
...); >> std::cout << std::endl << ret << std::endl; >> // This code interprets the function >> llvm::initializeCore(); >> llvm::ExecutionEngine * EI  = >> llvm::EngineBuilder(&M).setEngineKind(llvm::EngineKind::Interpreter).create(); >> EI->runStaticConstructorsDestructors(false); >> std::vector<llvm::GenericValue> args; >> llvm::GenericValue arg1((void*)"aaabc"); >> args.push_back(arg1); >> llvm::APInt res = EI->runFunction(func, args).IntVal; >> llvm::outs() << res << "\n"; >> The first b...
2009 Jun 22
0
[LLVMdev] X86 JIT
On Jun 22, 2009, at 2:19 PM, Kasra wrote: > Hi, > > for some reason I could not get the machine code generator for x86 > working. The interpreter is the only thing that works, is there > anything that I am missing here? This recently changed. In your main program, please #include "llvm/ Target/TargetSelect.h" and call InitializeNativeTarget(); before setting up
2009 Jun 22
2
[LLVMdev] X86 JIT
Hi, for some reason I could not get the machine code generator for x86 working. The interpreter is the only thing that works, is there anything that I am missing here? -- Kasra -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090622/89dca208/attachment.html>
2010 Jan 31
0
[LLVMdev] Boehm GC + static variables?
I've implemented this by adding calls to GC_add_roots(<first global in module>,<last global in module>+1) to the llvm.global_ctors before any other static initialization code for the module. This should be safe assuming that: - global variables are laid out in memory in the order they appear in their module (and ideally contiguously without being interleaved with any other values)