diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2023-10-03 14:55:18 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-10-03 12:49:12 -0700 |
| commit | 0134e5d2a1a5042b1485b7bb121870d2eaeb00b6 (patch) | |
| tree | 1c5e41cffa699a0e396a08771152d6e024a61af5 /src/link/Coff.zig | |
| parent | 0483b4a5126c0d07b1e9ad298729e8d34b5d2272 (diff) | |
| download | zig-0134e5d2a1a5042b1485b7bb121870d2eaeb00b6.tar.gz zig-0134e5d2a1a5042b1485b7bb121870d2eaeb00b6.zip | |
codegen: separate getAnonDeclVAddr into lowerAnonDecl and the former
Implement the stub for Elf.
I believe that separating the concerns, namely, having an interface
function that is responsible for signalling the linker to lower
the anon decl only, and a separate function to obtain the decl's
vaddr is preferable since it allows us to handle codegen errors
in a simpler way.
Diffstat (limited to 'src/link/Coff.zig')
| -rw-r--r-- | src/link/Coff.zig | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/link/Coff.zig b/src/link/Coff.zig index 8aebd0de6a..bfd7c9da46 100644 --- a/src/link/Coff.zig +++ b/src/link/Coff.zig @@ -1727,13 +1727,8 @@ pub fn getDeclVAddr(self: *Coff, decl_index: Module.Decl.Index, reloc_info: link return 0; } -pub fn getAnonDeclVAddr( - self: *Coff, - decl_val: InternPool.Index, - reloc_info: link.File.RelocInfo, -) !u64 { - // This is basically the same as lowerUnnamedConst except it needs - // to return the same thing as `getDeclVAddr` +pub fn lowerAnonDecl(self: *Coff, decl_val: InternPool.Index, src_loc: Module.SrcLoc) !codegen.Result { + // This is basically the same as lowerUnnamedConst. // example: // const ty = mod.intern_pool.typeOf(decl_val).toType(); // const val = decl_val.toValue(); @@ -1744,6 +1739,13 @@ pub fn getAnonDeclVAddr( // ... _ = self; _ = decl_val; + _ = src_loc; + _ = @panic("TODO: link/Coff lowerAnonDecl"); +} + +pub fn getAnonDeclVAddr(self: *Coff, decl_val: InternPool.Index, reloc_info: link.File.RelocInfo) !u64 { + _ = self; + _ = decl_val; _ = reloc_info; _ = @panic("TODO: link/Coff getAnonDeclVAddr"); } |
