[LLVMdev] MinGW/MSVC++ uses different ABI for sret

Óscar Fuentes ofv at wanadoo.es
Wed Oct 7 14:13:03 PDT 2009


DevOllvm <DevOmem at web.de> writes:

> Hi,
>
> is there any news about this problem?
> How hart it will be to resolve this compatibility problem with Visual Studio
> functions ?

Fixing the sret issue is easy: LLVM shall simply ignore it for
*-pc-win32 targets. You can workaround the problem on your compiler
by not using the sret attribute. That's what I did.

Fixing the problem with C++ non-POD classes as function arguments will
be much harder to fix. Most probably it will require to extend LLVM to
accept and call copy constructors and destructors on `byval' arguments.

> This is really great problem for my project with should call may different
> function compiled by Visual Studio!!!
>
> Here is also problem that is looking similar.
> http://llvm.org/bugs/show_bug.cgi?id=5046

The bug id about sret is 5058. The other about C++ non-POD function
arguments is 5064. Please note that the workaround suggested there is
not correct: apart from the other potential issues I mention, it is
doing exactly the same as `byval' does now.

-- 
Óscar




More information about the llvm-dev mailing list