forked from OSchip/llvm-project
Take into account the pointer to an aggregate that is passed as a hidden
argument when Offset is initialized. llvm-svn: 147986
This commit is contained in:
parent
02e13e5005
commit
32604a9708
|
@ -3248,8 +3248,12 @@ ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {
|
void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {
|
||||||
FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
|
ABIArgInfo &RetInfo = FI.getReturnInfo();
|
||||||
uint64_t Offset = 0;
|
RetInfo = classifyReturnType(FI.getReturnType());
|
||||||
|
|
||||||
|
// Check if a pointer to an aggregate is passed as a hidden argument.
|
||||||
|
uint64_t Offset = RetInfo.isIndirect() ? 8 : 0;
|
||||||
|
|
||||||
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
|
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
|
||||||
it != ie; ++it)
|
it != ie; ++it)
|
||||||
it->info = classifyArgumentType(it->type, Offset);
|
it->info = classifyArgumentType(it->type, Offset);
|
||||||
|
|
|
@ -29,3 +29,15 @@ void foo3(int a0, long double a1) {
|
||||||
foo4(1, 2, a0, a1);
|
foo4(1, 2, a0, a1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insert padding after hidden argument.
|
||||||
|
//
|
||||||
|
// CHECK: define void @foo5(%struct.S0* noalias nocapture sret %agg.result, i64, fp128 %a0)
|
||||||
|
// CHECK: call void @foo6(%struct.S0* sret %tmp, i32 1, i32 2, i64 undef, fp128 %a0)
|
||||||
|
// CHECK: declare void @foo6(%struct.S0* sret, i32, i32, i64, fp128)
|
||||||
|
|
||||||
|
extern S0 foo6(int, int, long double);
|
||||||
|
|
||||||
|
S0 foo5(long double a0) {
|
||||||
|
foo6(1, 2, a0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue