similar to: [LLVMdev] Follow-up on: Dynamic updates of current executed code

Displaying 20 results from an estimated 900 matches similar to: "[LLVMdev] Follow-up on: Dynamic updates of current executed code"

2004 Apr 20
2
[LLVMdev] Dynamic updates of current executed code
Thanks! Problem is though, that the Ruby compiler is integrated in the compilation of the program being executed, to be able to parse & compile dynamic code at run-time. Therefore the calls to ExecutionEngine::getPointerToGlobal(F) need to be made in LLVM code. Here is a detailed simplistic example in pseudocode of what we want to do: First Ruby code is entered at run-time, received as a
2004 Apr 02
0
[LLVMdev] Function pointers
On Fri, 2 Apr 2004, Anders Alexandersson wrote: > OK, I solved it all ( so far :) ), mixing in some load-instructions and > called on the result of that, which worked. > > Here is the skeleton-code: > > %kernel = type { int ()* } > > int puts_kernel(){...} > > ; main() > > %theKernel = malloc %kernel > %puts_kernelPTR = getelementptr %kernel* %theKernel,
2004 Apr 02
2
[LLVMdev] Function pointers
OK, I solved it all ( so far :) ), mixing in some load-instructions and called on the result of that, which worked. Here is the skeleton-code: %kernel = type { int ()* } int puts_kernel(){...} ; main() %theKernel = malloc %kernel %puts_kernelPTR = getelementptr %kernel* %theKernel, long 1, ubyte 0 store int ()* %puts_kernel, int ()** %puts_kernelPTR %tmp.11 = load int ()** %puts_kernelPTR
2004 Apr 02
0
[LLVMdev] Function pointers
I solved that one by substituting alloca into malloc, and forwarded the problem to actually calling the %puts_kernel function via my newly created function pointer. This works: %tmp.1 = call int %puts_kernel() This: %tmp.2 = call int %puts_kernelPTR() issues error: "Reference to an invalid definition: 'puts_kernelPTR' of type 'int () *'" How do I call the function
2004 Apr 02
0
[LLVMdev] Function pointers
So, here comes the next question:) Now the program compiles, but crashes when run, "Segmentation fault". %kernel = type { int ()* } int %puts_kernel() { ret int 0 } int %main() { %theKernel = alloca %kernel %puts_kernelPTR = getelementptr %kernel* %theKernel, long 1, ubyte 0 store int ()* %puts_kernel, int ()** %puts_kernelPTR ret int 0 } I want to learn how to
2004 Apr 19
1
[LLVMdev] Dynamic updates of current executed code
Hello! I saw that you just got the recent llvm paper published in IEEE! Congratulations! :-) More issues regarding the Ruby compiler: Ruby supports the possibility of the user to enter new Ruby code during execution, after which it is executed. Also, all classes are open, meaning that a user is able to redefine a class overriding or replacing methods therein at run-time (this is deep...). My
2012 Nov 11
1
[LLVMdev] wrong value with getPointerToGlobal
I'm having some trouble getting access to a global variable with getPointerToGlobal. The resulting value is not what I am expecting. My assembly looks something like this: @gresult = global i32 undef define i32 @eval_expr() { entry: ... store i32 %3, i32* @gresult ret i32 %3 } Where "gresult" is created with: auto global = new llvm::GlobalVariable( *module, int32Type,
2014 Mar 21
3
[LLVMdev] lli crashes when running cpp programs
Hi all, I need to run c++ prgrams using lli. However, I find lli cannot handle the alias instruction correctly. Following is an example: ------------ example.cc ------------- #include <iostream> using namespace std; class cls { public: cls(); ~cls(); }; cls::cls() { cout << "constructor" << endl; }; cls::~cls() { cout <<
2004 May 11
0
[LLVMdev] Problems accessing structs
Anders Alexandersson wrote: > Hello! > > I get some odd behaviour using my structs: > > "myKernelMap" = type {int (sbyte*)*, int ()*} > "Kernel" = type {"myKernelMap"*} > > The second member ( int()* ) is a pointer to the %getchar() function. > > I want to call getchar using this function: > > int
2004 May 03
2
[LLVMdev] Problems with getelementptr
Hello! I'm having trouble with pointer traversing. I have a design as follows: class -> map -> classFunctions Starting with a pointer to the class, I want to get a pointer to a classFunction via a pointer to the map. I can't get that function pointer! How shall I think to get the traversing right (see code below)? Is it something with the fact that I am using only pointers in my
2012 Nov 12
2
[LLVMdev] getPointerToGlobal() / MCJIT
Hi all, are there any plans to correct/implement the "getPointerToGlobal()" method for accessing global variables that are emitted by MCJIT? (see for details the unit test of MCJIT) Best Regards Armin
2004 May 11
2
[LLVMdev] Problems accessing structs
Hello! I get some odd behaviour using my structs: "myKernelMap" = type {int (sbyte*)*, int ()*} "Kernel" = type {"myKernelMap"*} The second member ( int()* ) is a pointer to the %getchar() function. I want to call getchar using this function: int "callmyKernelgetchar_kernel"("Kernel"* "myKernel") { "PTRMAP" =
2009 Oct 06
0
[LLVMdev] 2.6/trunk Execution Engine question
> > It just occurred to me... in the case where it's failing, the > ExecutionEngine was trying to JIT a global, and it had never JITted > any functions!  I'll work up a small test case, but I think it's > relevant since the thing is trying to allocate the globals with the > functions. > That was it! The following small test program crashes in getPointerToGlobal:
2012 Nov 13
0
[LLVMdev] getPointerToGlobal() / MCJIT
As far as I know, no one is working to fix the test case in question. Patches welcome :) Cheers, Dan On 2012-11-13, at 1:29 AM, "Armin Steinhoff" <armin at steinhoff.de> wrote: > > Hi all, > > are there any plans to correct/implement the "getPointerToGlobal()" method for accessing global variables that are emitted by MCJIT? > (see for details the
2004 May 03
0
[LLVMdev] Problems with getelementptr
On Mon, 3 May 2004, Anders Alexandersson wrote: > Hello! > > I'm having trouble with pointer traversing. I have a design as follows: > class -> map -> classFunctions > > Starting with a pointer to the class, I want to get a pointer to a > classFunction via a pointer to the map. Okay... > I can't get that function pointer! > > How shall I think to get
2010 Jan 22
2
[LLVMdev] Exception handling question
Hi James, > want to send us your testcase code? Then we can give it a whirl. > > > Test code is at http://giantblob.com/ehtest.tar.gz > > Thanks for the help. I apologize in advance if it turns out I'm doing > something stupid! I hope you realise that by running llvm-ld without -native you are actually executing your program from the JIT. I did a native
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
On 12/5/12 2:49 PM, Dong Chen wrote: > here is the thing. i want to know the exact main memory address of the > Global Varibale's address when ExecutionEngine execut the *.ll code. further > more, i want to change the address, is it possible? I assume you want to adjust the value at that address, right? Then you might want to check the ExecutionEngine::getPointerToGlobal method. You
2004 Apr 01
1
[LLVMdev] Function pointers
Yes! :-) What would I do without you folks?! I am the one trying to build a Ruby compiler prototype, so be prepared for more questions...:) Thanks again! Anders ----- Original Message ----- From: "Chris Lattner" <sabre at nondot.org> To: <llvmdev at cs.uiuc.edu> Sent: Wednesday, March 31, 2004 5:49 PM Subject: Re: [LLVMdev] Function pointers On Wed, 31 Mar 2004, Anders
2004 Mar 31
0
[LLVMdev] Function pointers
On Wed, 31 Mar 2004, Anders Alexandersson wrote: > Hello out there! > > I am trying to build a table of 2 function poiters by using an array: > > %kernel = alloca [ 2 x int ()* ] > > I try to access the first pointer to be able to store location of my first function like this: > > %function_pointer_1 = getelementptr [2 x int ()* ]* %kernel, long 0, long 0 > >
2008 Oct 14
2
[LLVMdev] bug in the JIT global variable emitter
[resending since the previous copy was apparently dropped by the mailing list] >> Today I found a nice bug in the JIT global variable emitter. >> The problem may lead to an assert() failure when doing the following: >> 1) compile some function >> 2) emit a global variable >> 3) compile another function. an assert() may trigger in the JIT memory >> manager