]> granicus.if.org Git - clang/commitdiff
Use a single integer type for a sub-doubleword part of a byval structure.
authorAkira Hatanaka <ahatanaka@mips.com>
Thu, 3 Nov 2011 23:31:00 +0000 (23:31 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Thu, 3 Nov 2011 23:31:00 +0000 (23:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143666 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp

index 2c93249e3b6ac7905e8f2b9a9cd1d3425b74d2fd..c3d5ee19d682b9937cae77be33093400bd5ce5cf 100644 (file)
@@ -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);
 }