aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-01-11 11:30:53 +0100
committerJakub Konka <kubkon@jakubkonka.com>2022-01-11 11:30:53 +0100
commita615425b513eb981cb2d5f0b780d720203c8defe (patch)
tree20cc2e7305456b4175b1e19040016edb8ad303d2 /src/Compilation.zig
parent4731a6e5d57d5fe6c17c42028aebd9fce3682ddb (diff)
parent247b638ccf8bfd5e0c4729935d230022726f97aa (diff)
downloadzig-a615425b513eb981cb2d5f0b780d720203c8defe.tar.gz
zig-a615425b513eb981cb2d5f0b780d720203c8defe.zip
Merge branch 'linker-eport-symbols' of github.com:Luukdegram/zig into Luukdegram-linker-eport-symbols
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index ea243dd73d..4ad4d3edfa 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -166,6 +166,10 @@ emit_docs: ?EmitLoc,
work_queue_wait_group: WaitGroup,
astgen_wait_group: WaitGroup,
+/// Exported symbol names. This is only for when the target is wasm.
+/// TODO: Remove this when Stage2 becomes the default compiler as it will already have this information.
+export_symbol_names: std.ArrayListUnmanaged([]const u8) = .{},
+
pub const SemaError = Module.SemaError;
pub const CRTFile = struct {
@@ -1878,6 +1882,11 @@ pub fn destroy(self: *Compilation) void {
self.work_queue_wait_group.deinit();
self.astgen_wait_group.deinit();
+ for (self.export_symbol_names.items) |symbol_name| {
+ gpa.free(symbol_name);
+ }
+ self.export_symbol_names.deinit(gpa);
+
// This destroys `self`.
self.arena_state.promote(gpa).deinit();
}