[pkg-d-commits] [ldc] 68/149: Fix detection of special reference variables
Matthias Klumpp
mak at moszumanska.debian.org
Sun Apr 23 22:36:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
mak pushed a commit to annotated tag v1.2.0
in repository ldc.
commit 9d4961ae2797912418c8e2bf021a17f6cf3bab3a
Author: Martin <noone at nowhere.com>
Date: Wed Feb 1 22:52:43 2017 +0100
Fix detection of special reference variables
D2.072 apparently doesn't set the STCforeach storage class for each
special reference anymore. So let's consider all references which aren't
parameters, i.e., all locals with STCref, as special references.
By-ref parameters are different as we simply use the LL pointer parameter as
lvalue for the variable, no extra alloca required. Special references are
automatically dereferenced pointers and as such occupy a dedicated alloca for
the address.
---
gen/llvmhelpers.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp
index 30e8a8c..9b85d03 100644
--- a/gen/llvmhelpers.cpp
+++ b/gen/llvmhelpers.cpp
@@ -1392,7 +1392,7 @@ void callPostblit(Loc &loc, Expression *exp, LLValue *val) {
////////////////////////////////////////////////////////////////////////////////
bool isSpecialRefVar(VarDeclaration *vd) {
- return (vd->storage_class & STCref) && (vd->storage_class & STCforeach);
+ return (vd->storage_class & (STCref | STCparameter)) == STCref;
}
////////////////////////////////////////////////////////////////////////////////
--
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