Displaying 4 results from an estimated 4 matches for "call_by_value".
2011 Aug 11
2
[LLVMdev] Pass a struct on windows
...getelementptr inbounds %0* %agg_addr, i32 0, i32 1
%result.1 = load i64* %agg_addr.1, align 8
ret i64 %result.1
}
(2) Pass the struct by value (minor modifications on above code).
The only difference is that we build the structure inside callee
@foo_by_value
and pass it by value to the caller @call_by_value. The returned value of
@call_by_value is a random number on windows XP ia32. But on linux
ubuntu x64 it is correct, 4.
define %0 @foo_by_value(i8*, i64) nounwind {
entry:
%agg_addr = alloca %0, align 8
%agg_addr.0 = getelementptr inbounds %0* %agg_addr, i32 0, i32 0
store i8* %0, i8** %agg_a...
2011 Aug 11
0
[LLVMdev] Pass a struct on windows
..., i32 0, i32 1
> %result.1 = load i64* %agg_addr.1, align 8
> ret i64 %result.1
> }
>
> (2) Pass the struct by value (minor modifications on above code).
> The only difference is that we build the structure inside callee @foo_by_value
> and pass it by value to the caller @call_by_value. The returned value of
> @call_by_value is a random number on windows XP ia32. But on linux
> ubuntu x64 it is correct, 4.
>
> define %0 @foo_by_value(i8*, i64) nounwind {
> entry:
> %agg_addr = alloca %0, align 8
> %agg_addr.0 = getelementptr inbounds %0* %agg_addr, i32...
2011 Aug 11
1
[LLVMdev] Pass a struct on windows
...load i64* %agg_addr.1, align 8
> > ret i64 %result.1
> > }
> >
> > (2) Pass the struct by value (minor modifications on above code).
> > The only difference is that we build the structure inside callee
> @foo_by_value
> > and pass it by value to the caller @call_by_value. The returned value of
> > @call_by_value is a random number on windows XP ia32. But on linux
> > ubuntu x64 it is correct, 4.
> >
> > define %0 @foo_by_value(i8*, i64) nounwind {
> > entry:
> > %agg_addr = alloca %0, align 8
> > %agg_addr.0 = getelem...
2011 Aug 15
3
[LLVMdev] structured types as function arguments
Hi,
When calling a function, does the llvm code generator support passing structured types (arrays, structs, etc.) by _value_? I wrote some small examples, and it seemed
to work, but I was wondering if anything can go wrong if the structured types are very large...
Thanks,
N