rnk added inline comments.
================
Comment at: lib/CodeGen/TargetInfo.cpp:3516
+ // calling convention is used.
if (IsRegCall && FI.getReturnType()->getTypePtr()->isRecordType() &&
!FI.getReturnType()->getTypePtr()->isUnionType()) {
----------------
This is incorrect. We should consult the CXXABI first, and then only do these
regcall-specific things if it returns false. Consider adding this test case to
find the bug:
```
struct NonTrivial {
int x, y;
~NonTrivial();
};
NonTrivial __regcall f() { return NonTrivial(); }
```
This should not return in registers, but it does today.
================
Comment at: lib/CodeGen/TargetInfo.cpp:3526
}
+ } else if (IsRegCall && FI.getReturnType()->getAs<ComplexType>()) {
+ const ComplexType *CT = FI.getReturnType()->getAs<ComplexType>();
----------------
This isn't necessarily a bug, but please always do C++ ABI classifications
first so it's easy to spot the bug above.
https://reviews.llvm.org/D35259
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits