`this' pointer vs. return pointer

Jim Dehnert dehnert at transmeta.com
Tue Jan 23 20:37:32 UTC 2001



Mark Mitchell wrote:
> 
> Does anyone remember what the resolution was on wehther the `this'
> pointer comes before, or after, the pointer to structures returned by
> value?
> 
> I don't think the document actually *says* at present.

Sure it does.  Section 3.1.4:

  In general, C++ return values are handled just like C return values.
This includes
  class type results returned in registers. However, if the return value
type has a
  non-trivial copy constructor or destructor, the caller allocates space
for a
  temporary, and passes a pointer to the temporary as an implicit first
parameter
  preceding both the this parameter and user parameters. The callee
constructs the
  return value into this temporary. On IA-64, the pointer is passed in
out0,
  different from other large class result buffer pointers, passed in r8. 

> Doing anything else is going to be next to impossible in GCC, I
> suspect.
> 
> Thoughts?

It's a good thing it's that way, then.

-- 
		Jim Dehnert		Transmeta Corp.
		dehnert at transmeta.com	(408) 919-6984
		dehnertj at acm.org




More information about the cxx-abi-dev mailing list