aboutsummaryrefslogtreecommitdiff
path: root/src/Zcu.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-06-04 21:45:31 -0400
committerAndrew Kelley <andrew@ziglang.org>2025-06-06 23:42:14 -0700
commit0bf8617d963dc432ed0204b10285cc414becf2fd (patch)
treeb4a28f10bd66183cd949e6f0fbb4a786bfc1aa04 /src/Zcu.zig
parent178ee8aef1b9f765da916f3e1e4cab66437f8e0a (diff)
downloadzig-0bf8617d963dc432ed0204b10285cc414becf2fd.tar.gz
zig-0bf8617d963dc432ed0204b10285cc414becf2fd.zip
x86_64: add support for pie executables
Diffstat (limited to 'src/Zcu.zig')
-rw-r--r--src/Zcu.zig12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Zcu.zig b/src/Zcu.zig
index d4a0adf284..7223e5a55e 100644
--- a/src/Zcu.zig
+++ b/src/Zcu.zig
@@ -2047,6 +2047,7 @@ pub const SrcLoc = struct {
.init_field_library,
.init_field_thread_local,
.init_field_dll_import,
+ .init_field_relocation,
=> |builtin_call_node| {
const wanted = switch (src_loc.lazy) {
.init_field_name => "name",
@@ -2059,6 +2060,7 @@ pub const SrcLoc = struct {
.init_field_library => "library",
.init_field_thread_local => "thread_local",
.init_field_dll_import => "dll_import",
+ .init_field_relocation => "relocation",
else => unreachable,
};
const tree = try src_loc.file_scope.getTree(zcu);
@@ -2506,6 +2508,7 @@ pub const LazySrcLoc = struct {
init_field_library: Ast.Node.Offset,
init_field_thread_local: Ast.Node.Offset,
init_field_dll_import: Ast.Node.Offset,
+ init_field_relocation: Ast.Node.Offset,
/// The source location points to the value of an item in a specific
/// case of a `switch`.
switch_case_item: SwitchItem,
@@ -4562,15 +4565,6 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
return .ok;
}
-/// Given that a `Nav` has value `val`, determine if a ref of that `Nav` gives a `const` pointer.
-pub fn navValIsConst(zcu: *const Zcu, val: InternPool.Index) bool {
- return switch (zcu.intern_pool.indexToKey(val)) {
- .variable => false,
- .@"extern" => |e| e.is_const,
- else => true,
- };
-}
-
pub const CodegenFailError = error{
/// Indicates the error message has been already stored at `Zcu.failed_codegen`.
CodegenFail,