[pkg-d-commits] [ldc] 173/211: Reverse parameter order for extern(D) for all other ABIs too
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.1.0
in repository ldc.
commit b34a03ddb6aba4e9e46dd5e726dd3856c00e9f2f
Author: Martin <noone at nowhere.com>
Date: Tue Nov 29 21:29:14 2016 +0100
Reverse parameter order for extern(D) for all other ABIs too
---
gen/abi-aarch64.cpp | 5 +++++
gen/abi-mips64.cpp | 5 +++++
gen/abi-ppc64le.cpp | 5 +++++
3 files changed, 15 insertions(+)
diff --git a/gen/abi-aarch64.cpp b/gen/abi-aarch64.cpp
index 2952814..9cceb64 100644
--- a/gen/abi-aarch64.cpp
+++ b/gen/abi-aarch64.cpp
@@ -64,6 +64,11 @@ struct AArch64TargetABI : TargetABI {
else if (passByVal(arg->type))
arg->attrs.remove(LLAttribute::ByVal);
}
+
+ // extern(D): reverse parameter order for non variadics, for DMD-compliance
+ if (tf->linkage == LINKd && tf->varargs != 1 && fty.args.size() > 1) {
+ fty.reverseParams = true;
+ }
}
void rewriteArgument(IrFuncTy &fty, IrFuncTyArg &arg) override {
diff --git a/gen/abi-mips64.cpp b/gen/abi-mips64.cpp
index b5082af..7f013f0 100644
--- a/gen/abi-mips64.cpp
+++ b/gen/abi-mips64.cpp
@@ -49,6 +49,11 @@ struct MIPS64TargetABI : TargetABI {
rewriteArgument(fty, *arg);
}
}
+
+ // extern(D): reverse parameter order for non variadics, for DMD-compliance
+ if (tf->linkage == LINKd && tf->varargs != 1 && fty.args.size() > 1) {
+ fty.reverseParams = true;
+ }
}
void rewriteArgument(IrFuncTy &fty, IrFuncTyArg &arg) override {
diff --git a/gen/abi-ppc64le.cpp b/gen/abi-ppc64le.cpp
index 2e6c498..731d8a6 100644
--- a/gen/abi-ppc64le.cpp
+++ b/gen/abi-ppc64le.cpp
@@ -83,6 +83,11 @@ struct PPC64LETargetABI : TargetABI {
rewriteArgument(fty, *arg);
}
}
+
+ // extern(D): reverse parameter order for non variadics, for DMD-compliance
+ if (tf->linkage == LINKd && tf->varargs != 1 && fty.args.size() > 1) {
+ fty.reverseParams = true;
+ }
}
void rewriteArgument(IrFuncTy &fty, IrFuncTyArg &arg) override {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git
More information about the pkg-d-commits
mailing list