[pkg-d-commits] [ldc] 07/12: Reverse parameter order for extern(D) for all other ABIs too
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:35:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v0.17.3
in repository ldc.
commit 66057c8635f72234a5e5ccdf53d44a1dc11a5691
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 95c52d0..5a63613 100644
--- a/gen/abi-aarch64.cpp
+++ b/gen/abi-aarch64.cpp
@@ -63,6 +63,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 bc268d4..7220b03 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