[LLVMdev] Handling SRet on Windows x86

Timur Iskhodzhanov timurrrr at google.com
Tue Oct 2 08:31:17 PDT 2012

On Tue, Oct 2, 2012 at 7:03 PM, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> Hello Timur,
>> I'd like to ask for advice:
>> a) Is it OK to change the SRet/ThisCall behaviour on non-Windows platforms?
>>     [I suppose no]
> no
>> b) Should I be altering CC_X86_32_ThisCall
>>     OR should I introduce CC_X86_Win32_ThisCall instead?
>>     [Answer not clear to me - is there any platform besides Windows
>>     that uses thiscall?]
> no
Can you please clarify which question you've answered here?
Sorry for making the ambiguous questions in the first place :)

> It seems for me that you're trying to solve the problem from the wrong
> end. As far as I remember, there is a difference - "simple" (probable
> POD-like stuff) are returned in the regs, while classes with
> non-trivial ctors, etc. are passed / returned on stack.
Sort of.

> It's frontend responsibility to emit proper IR in this case.
Isn't it what's SRet is supposed to be?

> See http://llvm.org/bugs/show_bug.cgi?id=5064 and around. This seems
> to be the correct description of what's going on.
FTR, http://llvm.org/bugs/show_bug.cgi?id=5058 seems to be more up-to-date.

Thanks for your reply!

More information about the llvm-dev mailing list