forked from OSchip/llvm-project
Use a single integer type for a sub-doubleword part of a byval structure.
llvm-svn: 143666
This commit is contained in:
parent
1bd49deec0
commit
f3879ee666
|
@ -3082,18 +3082,11 @@ llvm::Type* MipsABIInfo::HandleStructTy(QualType Ty) const {
|
||||||
for (unsigned N = (StructSize - LastOffset) / 64; N; --N)
|
for (unsigned N = (StructSize - LastOffset) / 64; N; --N)
|
||||||
ArgList.push_back(I64);
|
ArgList.push_back(I64);
|
||||||
|
|
||||||
// Whatever is left over goes into a structure consisting of sub-doubleword
|
// If the size of the remainder is not zero, add one more integer type to
|
||||||
// types. For example, if the size of the remainder is 40-bytes,
|
// ArgList.
|
||||||
// struct {i32, i8} is added to ArgList.
|
|
||||||
unsigned R = (StructSize - LastOffset) % 64;
|
unsigned R = (StructSize - LastOffset) % 64;
|
||||||
SmallVector<llvm::Type*, 3> ArgList2;
|
if (R)
|
||||||
|
ArgList.push_back(llvm::IntegerType::get(getVMContext(), R));
|
||||||
for (; R; R &= (R - 1))
|
|
||||||
ArgList2.insert(ArgList2.begin(),
|
|
||||||
llvm::IntegerType::get(getVMContext(), (R & (R - 1)) ^ R));
|
|
||||||
|
|
||||||
if (!ArgList2.empty())
|
|
||||||
ArgList.push_back(llvm::StructType::get(getVMContext(), ArgList2));
|
|
||||||
|
|
||||||
return llvm::StructType::get(getVMContext(), ArgList);
|
return llvm::StructType::get(getVMContext(), ArgList);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue