Chris Lattner wrote:> On Jul 20, 2008, at 6:25 AM, Richard Pennington wrote: > Yes, that is supposed to work in theory. In practice, most targets > only support returning up to two values in registers. Eventually, we > want the code generator to support returning excess return values on > the stack, but we don't have that code yet.Thanks for the info. Is the intention to implement this in an ABI compatible manner? That is, pass the address to put the return value as a hidden first parameter, for example? -Rich
On Jul 20, 2008, at 10:59 AM, Richard Pennington wrote:> Chris Lattner wrote: >> On Jul 20, 2008, at 6:25 AM, Richard Pennington wrote: >> Yes, that is supposed to work in theory. In practice, most targets >> only support returning up to two values in registers. Eventually, we >> want the code generator to support returning excess return values on >> the stack, but we don't have that code yet. > > Thanks for the info. Is the intention to implement this in an ABI > compatible manner? That is, pass the address to put the return value > as > a hidden first parameter, for example?I'm sure the implementation will take the same approach, but it won't necessarily be ABI compatible. I don't know enough to say at this point... it may end up being ABI compatible or not depending on implementation details. -Chris
Chris Lattner wrote:> On Jul 20, 2008, at 10:59 AM, Richard Pennington wrote: > I'm sure the implementation will take the same approach, but it won't > necessarily be ABI compatible. I don't know enough to say at this > point... it may end up being ABI compatible or not depending on > implementation details.Hi Chris, I was thinking about my problem and thought that there might be a good interim solution. I would like not to clutter my front end with stuff that will go away. How about a pass that runs before code generation that changes functions returning structs to void functions with the return pointer first parameter? I've not written an LLVM pass (yet), and I'd I'd like to get my feet wet. Does this seem like a reasonable (temporary) solution to this problem? -Rich
Possibly Parallel Threads
- [LLVMdev] Structs as first class values.
- [LLVMdev] Plans considering first class structs and multiple return values
- [LLVMdev] Plans considering first class structs and multiple return values
- [LLVMdev] Plans considering first class structs and multiple return values
- [LLVMdev] Missing passes