[llvm-dev] Passing arguments and returning value of struct or class
mayuyu.io via llvm-dev
llvm-dev at lists.llvm.org
Tue Dec 4 21:06:58 PST 2018
I remember as pointed out by someone else on the mailing list. (Tim, I believe) This is Clang trying to match the platform’s ABI specification
Zhang
> 在 2018年12月5日,03:59,Chanhyun Park via llvm-dev <llvm-dev at lists.llvm.org> 写道:
>
> Hi all.
>
> I'm new to LLVM and I'm having fun with LLVM.
> Recently, I fount that function calls are changed based on the types of return value and arguments.
>
> For example, as following codes, the generated LLVM IRs are efferent from what I expected them would be.
> -------------------
> // simple C code
> struct Float2
> {
> float x; float y;
> }
> Float2 foo(Float2 a)
> -------------------
> // simple LLVM IR
> i64 foo(i64 a)
> ------------------------
>
> Even, if the size of structure is bigger than 64bit, the LLVM IRs are as follow.
> ------------------------
> void foo( struct. Float2* , struct.Float2 * )
> ------------------------
>
> So. I wonder where can I find these rules? I googled but I could not found official documents or something likes that.
>
> Please help me.
>
> Thanks.
> Chanhyun.
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
More information about the llvm-dev
mailing list