aboutsummaryrefslogtreecommitdiff
path: root/src/link/Coff.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-01-08 23:16:50 +0100
committerAndrew Kelley <andrew@ziglang.org>2021-01-13 14:51:23 -0800
commit5487dd13ea23ad7e547995b9a088ba37bfe17737 (patch)
treed1bc46aed5d4db149d32cb4fca0406f86f1f1790 /src/link/Coff.zig
parenta021c7b1b2428ecda85e79e281d43fa1c92f8c94 (diff)
downloadzig-5487dd13ea23ad7e547995b9a088ba37bfe17737.tar.gz
zig-5487dd13ea23ad7e547995b9a088ba37bfe17737.zip
stage2: lay the groundwork in prep for extern fn
This commit lays the groundwork in preparation for implementing handling of extern functions in various backends.
Diffstat (limited to 'src/link/Coff.zig')
-rw-r--r--src/link/Coff.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/link/Coff.zig b/src/link/Coff.zig
index f7d646356c..f7cd9b69ce 100644
--- a/src/link/Coff.zig
+++ b/src/link/Coff.zig
@@ -662,10 +662,14 @@ pub fn updateDecl(self: *Coff, module: *Module, decl: *Module.Decl) !void {
if (build_options.have_llvm)
if (self.llvm_ir_module) |llvm_ir_module| return try llvm_ir_module.updateDecl(module, decl);
+ const typed_value = decl.typed_value.most_recent.typed_value;
+ if (typed_value.val.tag() == .extern_fn) {
+ return; // TODO Should we do more when front-end analyzed extern decl?
+ }
+
var code_buffer = std.ArrayList(u8).init(self.base.allocator);
defer code_buffer.deinit();
- const typed_value = decl.typed_value.most_recent.typed_value;
const res = try codegen.generateSymbol(&self.base, decl.src(), typed_value, &code_buffer, .none);
const code = switch (res) {
.externally_managed => |x| x,