http://llvm.org/bugs/show_bug.cgi?id=7310

           Summary: Wrong ABI on ARM for classes with non trivial copy
                    constructors
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The code

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

Produces

declare arm_aapcscc i32 @_Z3fooPv(i8*) optsize

but

http://www.codesourcery.com/public/cxx-abi/abi.html

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
systems?

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to