aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-28 02:35:53 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-28 08:39:59 +0100
commit0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch)
tree2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /src/link/Wasm.zig
parent1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff)
downloadzig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz
zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'src/link/Wasm.zig')
-rw-r--r--src/link/Wasm.zig12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index 749719d5fc..23425a2e7c 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -1169,7 +1169,7 @@ fn setupTLSRelocationsFunction(wasm: *Wasm) !void {
fn validateFeatures(
wasm: *const Wasm,
- to_emit: *[@typeInfo(types.Feature.Tag).Enum.fields.len]bool,
+ to_emit: *[@typeInfo(types.Feature.Tag).@"enum".fields.len]bool,
emit_features_count: *u32,
) !void {
const comp = wasm.base.comp;
@@ -1177,7 +1177,7 @@ fn validateFeatures(
const shared_memory = comp.config.shared_memory;
const cpu_features = target.cpu.features;
const infer = cpu_features.isEmpty(); // when the user did not define any features, we infer them from linked objects.
- const known_features_count = @typeInfo(types.Feature.Tag).Enum.fields.len;
+ const known_features_count = @typeInfo(types.Feature.Tag).@"enum".fields.len;
var allowed = [_]bool{false} ** known_features_count;
var used = [_]u17{0} ** known_features_count;
@@ -1192,7 +1192,7 @@ fn validateFeatures(
// When the user has given an explicit list of features to enable,
// we extract them and insert each into the 'allowed' list.
if (!infer) {
- inline for (@typeInfo(std.Target.wasm.Feature).Enum.fields) |feature_field| {
+ inline for (@typeInfo(std.Target.wasm.Feature).@"enum".fields) |feature_field| {
if (cpu_features.isEnabled(feature_field.value)) {
allowed[feature_field.value] = true;
emit_features_count.* += 1;
@@ -2576,7 +2576,7 @@ pub fn flushModule(wasm: *Wasm, arena: Allocator, tid: Zcu.PerThread.Id, prog_no
if (wasm.base.hasErrors()) return error.FlushFailure;
var emit_features_count: u32 = 0;
- var enabled_features: [@typeInfo(types.Feature.Tag).Enum.fields.len]bool = undefined;
+ var enabled_features: [@typeInfo(types.Feature.Tag).@"enum".fields.len]bool = undefined;
try wasm.validateFeatures(&enabled_features, &emit_features_count);
try wasm.resolveSymbolsInArchives();
if (wasm.base.hasErrors()) return error.FlushFailure;
@@ -2610,7 +2610,7 @@ pub fn flushModule(wasm: *Wasm, arena: Allocator, tid: Zcu.PerThread.Id, prog_no
/// Writes the WebAssembly in-memory module to the file
fn writeToFile(
wasm: *Wasm,
- enabled_features: [@typeInfo(types.Feature.Tag).Enum.fields.len]bool,
+ enabled_features: [@typeInfo(types.Feature.Tag).@"enum".fields.len]bool,
feature_count: u32,
arena: Allocator,
) !void {
@@ -3867,7 +3867,7 @@ fn emitSegmentInfo(wasm: *Wasm, binary_bytes: *std.ArrayList(u8)) !void {
pub fn getUleb128Size(uint_value: anytype) u32 {
const T = @TypeOf(uint_value);
- const U = if (@typeInfo(T).Int.bits < 8) u8 else T;
+ const U = if (@typeInfo(T).int.bits < 8) u8 else T;
var value = @as(U, @intCast(uint_value));
var size: u32 = 0;