On Tuesday 18 October 2011 11:56:59 Oswald Buddenhagen wrote:
> On Mon, Oct 17, 2011 at 10:25:37PM +0200, Knoll Lars  wrote:
> > Not even to mention the drawbacks in terms of ABI.
> > Classes are not passed in registers to functions, primitive types are.
> 
> in this case https://qt.gitorious.org/qt/qtbase/merge_requests/69 is
> plain bogus. and the previous endeavours to get rid of QLatin1String
> const refs.


FYI:
http://sourcery.mentor.com/public/cxx-abi/abi.html#normal-call


| In general, C++ value parameters are handled just like C parameters. This
| includes class type parameters passed wholly or partially in registers. 
| There are, however, some special cases.
| 1. In the special case where the parameter type has a non-trivial copy   
|    constructor or destructor, the caller must allocate space for a temporary  
|    copy, and pass the resulting copy by reference (below). [...]


So because QChar and QLatin1String do not declare a copy constructor or a 
destructor, they are passed in registers.

I just verified again with gcc -S of simple code.

(That is on Linux, I don't know about others ABI)


_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to