Follow the D ABI and pass the last arg in a register if it is a struct that fits.

This commit is contained in:
Christian Kamm
2009-02-03 21:46:46 +01:00
parent aa2cd42536
commit bbcea86cf2
4 changed files with 54 additions and 20 deletions

View File

@@ -2691,10 +2691,11 @@ TypeFunction::TypeFunction(Arguments *parameters, Type *treturn, int varargs, en
this->retInPtr = false;
this->usesThis = false;
this->usesNest = false;
this->structInregArg = false;
this->retAttrs = 0;
this->thisAttrs = 0;
this->reverseParams = false;
this->reverseIndex = 0;
this->firstRealArg = 0;
}
Type *TypeFunction::syntaxCopy()
@@ -2708,7 +2709,7 @@ Type *TypeFunction::syntaxCopy()
t->retAttrs = retAttrs;
t->thisAttrs = thisAttrs;
t->reverseParams = reverseParams;
t->reverseIndex = reverseIndex;
t->firstRealArg = firstRealArg;
return t;
}

View File

@@ -438,11 +438,13 @@ struct TypeFunction : Type
bool retInPtr;
bool usesThis;
bool usesNest;
bool structInregArg;
unsigned retAttrs;
unsigned thisAttrs; // also used for nest
// parameter index in the llvm function that contains the first not-implicit arg
size_t firstRealArg;
bool reverseParams;
size_t reverseIndex;
};
struct TypeDelegate : Type