[cfe-commits] r143666 - /cfe/trunk/lib/CodeGen/TargetInfo.cpp

Akira Hatanaka ahatanaka at mips.com
Thu Nov 3 16:31:01 PDT 2011


Author: ahatanak
Date: Thu Nov  3 18:31:00 2011
New Revision: 143666

URL: http://llvm.org/viewvc/llvm-project?rev=143666&view=rev
Log:
Use a single integer type for a sub-doubleword part of a byval structure.


Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=143666&r1=143665&r2=143666&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Thu Nov  3 18:31:00 2011
@@ -3082,18 +3082,11 @@
   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);
 }





More information about the cfe-commits mailing list