[llvm-commits] [llvm-gcc-4.2] r87052 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h
Bob Wilson
bob.wilson at apple.com
Thu Nov 12 17:10:29 PST 2009
Author: bwilson
Date: Thu Nov 12 19:10:29 2009
New Revision: 87052
URL: http://llvm.org/viewvc/llvm-project?rev=87052&view=rev
Log:
Revert 86892.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-abi.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=87052&r1=87051&r2=87052&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Thu Nov 12 19:10:29 2009
@@ -629,18 +629,19 @@
Elts.push_back(ATy);
}
- // Put any left over bytes into one last register. This target-independent
- // code does not know the size of the argument registers, so use the
- // smallest size that will work.
- if (Size > 4) {
- Elts.push_back(Type::getInt64Ty(getGlobalContext()));
- } else if (Size > 2) {
+ if (Size >= 4) {
Elts.push_back(Type::getInt32Ty(getGlobalContext()));
- } else if (Size > 1) {
+ Size -= 4;
+ }
+ if (Size >= 2) {
Elts.push_back(Type::getInt16Ty(getGlobalContext()));
- } else {
+ Size -= 2;
+ }
+ if (Size >= 1) {
Elts.push_back(Type::getInt8Ty(getGlobalContext()));
+ Size -= 1;
}
+ assert(Size == 0 && "Didn't cover value?");
const StructType *STy = StructType::get(getGlobalContext(), Elts, false);
unsigned i = 0;
@@ -1072,18 +1073,19 @@
Elts.push_back(ATy);
}
- // Put any left over bytes into one last register. This target-independent
- // code does not know the size of the argument registers, so use the
- // smallest size that will work.
- if (Size > 4) {
- Elts.push_back(Type::getInt64Ty(getGlobalContext()));
- } else if (Size > 2) {
+ if (Size >= 4) {
Elts.push_back(Type::getInt32Ty(getGlobalContext()));
- } else if (Size > 1) {
+ Size -= 4;
+ }
+ if (Size >= 2) {
Elts.push_back(Type::getInt16Ty(getGlobalContext()));
- } else {
+ Size -= 2;
+ }
+ if (Size >= 1) {
Elts.push_back(Type::getInt8Ty(getGlobalContext()));
+ Size -= 1;
}
+ assert(Size == 0 && "Didn't cover value?");
const StructType *STy = StructType::get(getGlobalContext(), Elts, false);
unsigned i = 0;
More information about the llvm-commits
mailing list