summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2011-11-03 23:31:00 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2011-11-03 23:31:00 +0000
commitf3879ee6660ad275329401298be15ea58baeb7c4 (patch)
tree6bdee8af5da3b537da65d5d4169b2712040c82c6 /clang/lib/CodeGen/TargetInfo.cpp
parent1bd49deec07c9b88f28a5430d32244ee707e4ecc (diff)
downloadbcm5719-llvm-f3879ee6660ad275329401298be15ea58baeb7c4.tar.gz
bcm5719-llvm-f3879ee6660ad275329401298be15ea58baeb7c4.zip
Use a single integer type for a sub-doubleword part of a byval structure.
llvm-svn: 143666
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 2c93249e3b6..c3d5ee19d68 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -3082,18 +3082,11 @@ llvm::Type* MipsABIInfo::HandleStructTy(QualType Ty) const {
for (unsigned N = (StructSize - LastOffset) / 64; N; --N)
ArgList.push_back(I64);
- // Whatever is left over goes into a structure consisting of sub-doubleword
- // types. For example, if the size of the remainder is 40-bytes,
- // struct {i32, i8} is added to ArgList.
+ // If the size of the remainder is not zero, add one more integer type to
+ // ArgList.
unsigned R = (StructSize - LastOffset) % 64;
- SmallVector<llvm::Type*, 3> ArgList2;
-
- 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));
+ if (R)
+ ArgList.push_back(llvm::IntegerType::get(getVMContext(), R));
return llvm::StructType::get(getVMContext(), ArgList);
}
OpenPOWER on IntegriCloud