Displaying 2 results from an estimated 2 matches for "cpp_return_struct".
2011 Aug 12
1
[LLVMdev] Using sret AND thiscall calling convention
...calls an external C++ function
returning a structure by copy:
vec3 vec3::Cross(const vec3& iV) const;
Here is the LLVM IR that I am generating for win32 ABI, which says that the
first parameter should be a pointer to the return value:
%vec3 = type <{ float, float, float }>
define void @CPP_Return_Struct(%vec3* %v1, %vec3* %v2) inlinehint
alignstack(16) {
ENTRY:
%"@0" = alloca %vec3, align 4
call x86_thiscallcc void @vec3_Cross(%vec3* sret %"@0", %vec3* %v1, %vec3*
%v2)
ret void
}
declare x86_thiscallcc void @vec3_Cross(%vec3* sret, %vec3*, %vec3*) align 2
It seems that...
2011 Aug 12
1
[LLVMdev] Using sret AND thiscall calling convention
...ing a structure by copy:
> vec3 vec3::Cross(const vec3& iV) const;
>
> Here is the LLVM IR that I am generating for win32 ABI, which says that the
> first parameter should be a pointer to the return value:
>
> %vec3 = type <{ float, float, float }>
>
> define void @CPP_Return_Struct(%vec3* %v1, %vec3* %v2) inlinehint
> alignstack(16) {
> ENTRY:
> %"@0" = alloca %vec3, align 4
> call x86_thiscallcc void @vec3_Cross(%vec3* sret %"@0", %vec3* %v1, %vec3*
> %v2)
> ret void
> }
>
> declare x86_thiscallcc void @vec3_Cross(%vec3* sret...