Displaying 6 results from an estimated 6 matches for "cast210".
2007 Jun 12
2
[LLVMdev] Problems with the tools
...; [13 x i8 ]*
; External declaration of the puts function
declare i32 %puts(i8 *) ; i32(i8 *)*
; Definition of main function
define i32 %main() { ; i32()*
; Convert [13x i8 ]* to i8 *...
%cast210 = getelementptr [13 x i8 ]* %.LC0, i64 0, i64 0 ; i8 *
; Call puts function to write out the string to stdout...
call i32 %puts(i8 * %cast210) ; i32
ret i32 0
}
-----------------------------------------------------------------------------------...
2006 Dec 21
1
[LLVMdev] lli, llvm-ld and runtime libraries
Hello again,
I'm exploring llvm's intermediary representation with this code:
////////////////////////////////////
%.LC0 = internal constant [13 x sbyte] c"hello world\0A\00"
declare int %puts(sbyte*)
implementation
int %main() {
%cast210 = getelementptr [13 x sbyte]* %.LC0, long 0, long 0;
call int %puts(sbyte* %cast210)
ret int 0
}
////////////////////////////////////
And I can compile and run it like this:
llvm-as foo.ll
lli foo.bc
or
llvm-ld foo.bc -o foo
Which prints "hello world". This is great, but I can...
2008 Apr 30
0
[LLVMdev] newbie question regarding llvm-mingw
...; [13
x i8]*
; External declaration of the puts function
declare i32 @puts(i8 *) ;
i32(i8 *)*
; Definition of main function
define i32 @main() { ;
i32()*
; Convert [13x i8 ]* to i8 *...
%cast210 = getelementptr [13 x i8 ]* @.LC0, i64 0, i64 0 ; i8 *
; Call puts function to write out the string to stdout...
call i32 @puts(i8 * %cast210) ; i32
ret i32 0
}
----------------------------------------------------------------------------------...
2007 Nov 08
3
[LLVMdev] Newbie JITter
...i8]*\n"
"\n"
"declare i32 @puts(i8 *) ;
i32(i8 *)* \n"
"\n"
"define i32 @main() { ;
i32()* \n"
" ; Convert [19 x i8 ]* to i8 *...\n"
" %cast210 = getelementptr [19 x i8]* @.LC0, i64 0, i64 0 ; i8
*\n"
" call i32 @puts(i8 * %cast210) ;
i32\n"
" ret i32 0\n"
"};\n";
int exitCode = 0;
try {
ParseError ParseErr;
Module* M = ParseAssemblyString(assembler, ne...
2007 Nov 09
0
[LLVMdev] Newbie JITter
...t; "declare i32 @puts(i8 *) ;
> i32(i8 *)* \n"
> "\n"
> "define i32 @main() { ;
> i32()* \n"
> " ; Convert [19 x i8 ]* to i8 *...\n"
> " %cast210 = getelementptr [19 x i8]* @.LC0, i64 0, i64 0 ; i8
> *\n"
> " call i32 @puts(i8 * %cast210) ;
> i32\n"
> " ret i32 0\n"
> "};\n";
>
> int exitCode = 0;
> try {
> ParseError ParseErr;
>...
2002 Sep 10
0
[LLVMdev] Re: Qustion about LLVM docs (fwd)
...ure
>
> There is a piece of code which looks like this:
>
> ; Declare the string constant as a global constant...
> %.LC0 = internal constant [13 x sbyte] c"hello world\0A\00"
>
> Which is then followed by this:
>
> ; Convert [13x sbyte]* to sbyte *...
> %cast210 = getelementptr [13 x sbyte]* %.LC0, uint 0, uint 0 ;
>
> Shouldn't the getelementptr have only one "uint 0"? Or am I just not
> understanding the documentation? Thanks
The example is correct (but the getElementPtr is one of the more confusing
things in LLVM, so it's a...