all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
This commit is contained in:
committed by
Andrew Kelley
parent
a6c8ee5231
commit
50339f595a
@@ -246,10 +246,10 @@ fn orderGlobalsInto(
|
||||
const global = self.globalPtr(decl_index).?;
|
||||
const insts = self.globals.section.instructions.items[global.begin_inst..global.end_inst];
|
||||
|
||||
seen.set(@enumToInt(decl_index));
|
||||
seen.set(@intFromEnum(decl_index));
|
||||
|
||||
for (deps) |dep| {
|
||||
if (!seen.isSet(@enumToInt(dep))) {
|
||||
if (!seen.isSet(@intFromEnum(dep))) {
|
||||
try self.orderGlobalsInto(dep, section, seen);
|
||||
}
|
||||
}
|
||||
@@ -267,7 +267,7 @@ fn orderGlobals(self: *Module) !Section {
|
||||
errdefer ordered_globals.deinit(self.gpa);
|
||||
|
||||
for (globals) |decl_index| {
|
||||
if (!seen.isSet(@enumToInt(decl_index))) {
|
||||
if (!seen.isSet(@intFromEnum(decl_index))) {
|
||||
try self.orderGlobalsInto(decl_index, &ordered_globals, &seen);
|
||||
}
|
||||
}
|
||||
@@ -284,14 +284,14 @@ fn addEntryPointDeps(
|
||||
const decl = self.declPtr(decl_index);
|
||||
const deps = self.decl_deps.items[decl.begin_dep..decl.end_dep];
|
||||
|
||||
seen.set(@enumToInt(decl_index));
|
||||
seen.set(@intFromEnum(decl_index));
|
||||
|
||||
if (self.globalPtr(decl_index)) |global| {
|
||||
try interface.append(global.result_id);
|
||||
}
|
||||
|
||||
for (deps) |dep| {
|
||||
if (!seen.isSet(@enumToInt(dep))) {
|
||||
if (!seen.isSet(@intFromEnum(dep))) {
|
||||
try self.addEntryPointDeps(dep, seen, interface);
|
||||
}
|
||||
}
|
||||
@@ -516,7 +516,7 @@ pub fn allocDecl(self: *Module, kind: DeclKind) !Decl.Index {
|
||||
.begin_dep = undefined,
|
||||
.end_dep = undefined,
|
||||
});
|
||||
const index = @intToEnum(Decl.Index, @intCast(u32, self.decls.items.len - 1));
|
||||
const index = @enumFromInt(Decl.Index, @intCast(u32, self.decls.items.len - 1));
|
||||
switch (kind) {
|
||||
.func => {},
|
||||
// If the decl represents a global, also allocate a global node.
|
||||
@@ -531,7 +531,7 @@ pub fn allocDecl(self: *Module, kind: DeclKind) !Decl.Index {
|
||||
}
|
||||
|
||||
pub fn declPtr(self: *Module, index: Decl.Index) *Decl {
|
||||
return &self.decls.items[@enumToInt(index)];
|
||||
return &self.decls.items[@intFromEnum(index)];
|
||||
}
|
||||
|
||||
pub fn globalPtr(self: *Module, index: Decl.Index) ?*Global {
|
||||
|
||||
Reference in New Issue
Block a user