mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00
Refactoring: Introduce TargetABI::reverseExplicitParams()
This commit is contained in:
parent
92913d4c08
commit
29d609d63d
13 changed files with 19 additions and 47 deletions
10
gen/abi.cpp
10
gen/abi.cpp
|
@ -238,6 +238,14 @@ bool TargetABI::canRewriteAsInt(Type *t, bool include64bit) {
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TargetABI::reverseExplicitParams(TypeFunction *tf) {
|
||||
// Required by druntime for extern(D), except for `, ...`-style variadics.
|
||||
return tf->linkage == LINKd && tf->varargs != 1 &&
|
||||
Parameter::dim(tf->parameters) > 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TargetABI::rewriteVarargs(IrFuncTy &fty,
|
||||
std::vector<IrFuncTyArg *> &args) {
|
||||
for (auto arg : args) {
|
||||
|
@ -355,6 +363,8 @@ struct IntrinsicABI : TargetABI {
|
|||
|
||||
bool passByVal(Type *t) override { return false; }
|
||||
|
||||
bool reverseExplicitParams(TypeFunction *) override { return false; }
|
||||
|
||||
void rewriteArgument(IrFuncTy &fty, IrFuncTyArg &arg) override {
|
||||
Type *ty = arg.type->toBasetype();
|
||||
if (ty->ty != Tstruct) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue