[LLVMbugs] [Bug 7310] New: Wrong ABI on ARM for classes with non trivial copy constructors

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 7 12:00:32 CDT 2010


           Summary: Wrong ABI on ARM for classes with non trivial copy
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

The code

class SMLoc {
 const char *Ptr;
 SMLoc(const SMLoc &RHS);
SMLoc foo(void *p);
void bar(void *x) {


declare arm_aapcscc i32 @_Z3fooPv(i8*) optsize



in 3.1.4 Return Values  says

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.

Is this also true on Darwin or should I special case this for non-Darwin

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the LLVMbugs mailing list