[pkg-d-commits] [ldc] 89/95: Add specific warning for @fmf("contract") when it's not supported by LLVM
Matthias Klumpp
mak at moszumanska.debian.org
Thu Jul 13 20:54:04 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.3.0-beta1
in repository ldc.
commit bc119d453b667d121082525aeec18722a8eb2560
Author: Johan Engelen <jbc.engelen at gmail.com>
Date: Wed Apr 12 22:34:20 2017 +0200
Add specific warning for @fmf("contract") when it's not supported by LLVM
---
gen/uda.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gen/uda.cpp b/gen/uda.cpp
index b6fee39..7e1711b 100644
--- a/gen/uda.cpp
+++ b/gen/uda.cpp
@@ -215,9 +215,13 @@ void applyAttrLLVMFastMathFlag(StructLiteralExp *sle, IrFunction *irFunc) {
irFunc->FMF.clear();
} else if (value == "fast") {
irFunc->FMF.setUnsafeAlgebra();
-#if LDC_LLVM_VER >= 500
} else if (value == "contract") {
+#if LDC_LLVM_VER >= 500
irFunc->FMF.setAllowContract(true);
+#else
+ sle->warning("ignoring parameter \"contract\" for @ldc.attributes.%s: "
+ "LDC needs to be built against LLVM 5.0+ for support",
+ sle->sd->ident->toChars());
#endif
} else if (value == "nnan") {
irFunc->FMF.setNoNaNs();
--
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