aboutsummaryrefslogtreecommitdiff
path: root/src/Value.zig
diff options
context:
space:
mode:
authorkcbanner <kcbanner@gmail.com>2024-10-20 16:30:12 -0400
committerkcbanner <kcbanner@gmail.com>2024-10-22 12:41:35 -0400
commita4690ecb1fc8a9ac5f7dfccfdf9f67c7a74e1569 (patch)
treec957ba83ecc602392fc4275a53ef9b958b5dbdf1 /src/Value.zig
parentee2575724597f214f8f4653f4a4ec1d2a6d97b8b (diff)
downloadzig-a4690ecb1fc8a9ac5f7dfccfdf9f67c7a74e1569.tar.gz
zig-a4690ecb1fc8a9ac5f7dfccfdf9f67c7a74e1569.zip
Cause a compilation error to occur if using @extern with is_dll_import in a comptime scope.
Add a note about thread local / dll import being the cause.
Diffstat (limited to 'src/Value.zig')
-rw-r--r--src/Value.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Value.zig b/src/Value.zig
index 157f47bc7e..464ee7f5e1 100644
--- a/src/Value.zig
+++ b/src/Value.zig
@@ -1340,11 +1340,11 @@ pub fn isLazySize(val: Value, zcu: *Zcu) bool {
};
}
-pub fn isPtrToThreadLocal(val: Value, zcu: *Zcu) bool {
+pub fn isPtrRuntimeValue(val: Value, zcu: *Zcu) bool {
const ip = &zcu.intern_pool;
const nav = ip.getBackingNav(val.toIntern()).unwrap() orelse return false;
return switch (ip.indexToKey(ip.getNav(nav).status.resolved.val)) {
- .@"extern" => |e| e.is_threadlocal,
+ .@"extern" => |e| e.is_threadlocal or e.is_dll_import,
.variable => |v| v.is_threadlocal,
else => false,
};