Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] Beginners question"
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 Mar 31
2
[LLVMdev] Function pointers
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
store int ()* %function_1, int ()* %function_pointer_1
But, I get the error message from llvm-asm:
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 Feb 24
0
[LLVMdev] Beginners question
On Tue, 24 Feb 2004, Anders Alexandersson wrote:
> I am doing some pre-studies for my masters thesis, which (hopefully)
> will result in a compiler prototype for Ruby to LLVM, and I have a
> question:
Cool! :)
> 1. When reading the reference manual, I do not understand how e.g.
> simple I/O operations as printf() can be implemented in LLVM. Are there
> any external functions
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
>
>
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 May 05
2
[LLVMdev] Not allowed to reuse variables?
Hello!
I am having trouble with identifiers:
%tmpFunction = load int ()** %puts_kernelPTR
...
%tmpFunction = load int ()** %puts_kernelPTR
generates
Redefinition of value named 'tmpFunction' in the 'int () *' type plane!
Is it not allowed to reuse variables? Is there some way to do it?
Anders
----------------------------------------------------------------
Anders
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 Mar 26
1
[LLVMdev] Initial problems having installed LLVM
Hello!
I have compiled LLVM without errors and try to do a simple hello world test using the llvmgcc frontend,
llvmgcc -o hello hello.c
and I get this error message:
gcc: installation problem, cannot exec `gccas': No such file or directory
What have I one wrong/what needs to be done?
Regards
Anders
----------------------------------------------------------------
Anders Alexandersson
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
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" =
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
2004 May 11
1
[LLVMdev] Follow-up on: Dynamic updates of current executed code
Hello!
I am coming back to the below discussion again, regarding the LLVM support of Ruby dynamics. The initial problem description is as follow, to refresh your memory :) After that my questions come:
-----------BEGIN Initial problem description---------------
Problem is though, that the Ruby compiler is integrated in the compilation of the program being executed, to be able to parse &
2004 Mar 28
0
[LLVMdev] Initial problems having installed LLVM
Great, thanks, it solved it!
Anders
-----Original Message-----
From: Chris Lattner <sabre at nondot.org>
To: llvmdev at cs.uiuc.edu
Date: Fri, 26 Mar 2004 10:08:02 -0600 (CST)
Subject: Re: [LLVMdev] Initial problems having installed LLVM
On Fri, 26 Mar 2004, Anders Alexandersson wrote:
> I have compiled LLVM without errors and try to do a simple hello world
> test using the llvmgcc
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 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
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
2004 May 05
0
[LLVMdev] Not allowed to reuse variables?
On Wed, May 05, 2004 at 03:35:46PM +0200, Anders Alexandersson wrote:
> %tmpFunction = load int ()** %puts_kernelPTR
> ...
> %tmpFunction = load int ()** %puts_kernelPTR
>
> generates
>
> Redefinition of value named 'tmpFunction' in the 'int () *' type plane!
>
> Is it not allowed to reuse variables? Is there some way to do it?
LLVM uses the Static
2004 Aug 15
2
[LLVMdev] Re: [llvm-announce] LLVM 1.3 Release!]
Chris Lattner wrote:
> LLVM Compiler Infrastructure -- Release 1.3
> http://llvm.cs.uiuc.edu
>
>We are pleased to announce the release of version 1.3 of the LLVM
>Compiler Infrastructure.
>
>
>
Great news, thanks.
However, I wonder if someone supplies pre-built cfrontend binaries for
cygwin?
I followed the instructions and tried to