namespace {
class MipsABIInfo : public ABIInfo {
static const unsigned MinABIStackAlignInBytes = 4;
+ bool IsO32;
public:
- MipsABIInfo(CodeGenTypes &CGT) : ABIInfo(CGT) {}
+ MipsABIInfo(CodeGenTypes &CGT, bool _IsO32) : ABIInfo(CGT), IsO32(_IsO32) {}
ABIArgInfo classifyReturnType(QualType RetTy) const;
ABIArgInfo classifyArgumentType(QualType RetTy) const;
class MIPSTargetCodeGenInfo : public TargetCodeGenInfo {
unsigned SizeOfUnwindException;
public:
- MIPSTargetCodeGenInfo(CodeGenTypes &CGT, unsigned SZ)
- : TargetCodeGenInfo(new MipsABIInfo(CGT)), SizeOfUnwindException(SZ) {}
+ MIPSTargetCodeGenInfo(CodeGenTypes &CGT, bool IsO32)
+ : TargetCodeGenInfo(new MipsABIInfo(CGT, IsO32)),
+ SizeOfUnwindException(IsO32 ? 24 : 32) {}
int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const {
return 29;
return ABIArgInfo::getIgnore();
if (isAggregateTypeForABI(RetTy)) {
- if (RetTy->isAnyComplexType())
+ if ((IsO32 && RetTy->isAnyComplexType()) ||
+ (!IsO32 && (getContext().getTypeSize(RetTy) <= 128)))
return ABIArgInfo::getDirect();
return ABIArgInfo::getIndirect(0);
case llvm::Triple::mips:
case llvm::Triple::mipsel:
- return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, 24));
+ return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, true));
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
- return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, 32));
+ return *(TheTargetCodeGenInfo = new MIPSTargetCodeGenInfo(Types, false));
case llvm::Triple::arm:
case llvm::Triple::thumb: