aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Cache.zig2
-rw-r--r--src/Compilation.zig2
-rw-r--r--src/link/MachO.zig2
-rw-r--r--src/link/Wasm.zig2
-rw-r--r--src/link/Wasm/Object.zig2
-rw-r--r--src/main.zig8
-rw-r--r--src/register_manager.zig2
-rw-r--r--src/translate_c.zig13
8 files changed, 15 insertions, 18 deletions
diff --git a/src/Cache.zig b/src/Cache.zig
index 829d903e5a..0d4b51492d 100644
--- a/src/Cache.zig
+++ b/src/Cache.zig
@@ -747,7 +747,7 @@ pub const Manifest = struct {
file.stat.inode,
file.stat.mtime,
&encoded_digest,
- file.path.?,
+ file.path,
});
}
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 300a02a881..5204910193 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1465,7 +1465,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
.handle = artifact_dir,
.path = try options.local_cache_directory.join(arena, &[_][]const u8{artifact_sub_dir}),
};
- log.debug("zig_cache_artifact_directory='{?s}' use_stage1={}", .{
+ log.debug("zig_cache_artifact_directory='{s}' use_stage1={}", .{
zig_cache_artifact_directory.path, use_stage1,
});
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index b90bc8bdee..0f2cbfa844 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -363,7 +363,7 @@ pub fn openPath(allocator: Allocator, options: link.Options) !*MachO {
// Create dSYM bundle.
const dir = options.module.?.zig_cache_artifact_directory;
- log.debug("creating {s}.dSYM bundle in {?s}", .{ emit.sub_path, dir.path });
+ log.debug("creating {s}.dSYM bundle in {s}", .{ emit.sub_path, dir.path });
const d_sym_path = try fmt.allocPrint(
allocator,
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index 30e2192268..41ee8392ec 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -1629,7 +1629,7 @@ fn setupMemory(self: *Wasm) !void {
return error.MemoryTooBig;
}
self.memories.limits.max = @intCast(u32, max_memory / page_size);
- log.debug("Maximum memory pages: {?d}", .{self.memories.limits.max});
+ log.debug("Maximum memory pages: {d}", .{self.memories.limits.max});
}
}
diff --git a/src/link/Wasm/Object.zig b/src/link/Wasm/Object.zig
index a1308ec045..9dba838d27 100644
--- a/src/link/Wasm/Object.zig
+++ b/src/link/Wasm/Object.zig
@@ -548,7 +548,7 @@ fn Parser(comptime ReaderType: type) type {
.index = try leb.readULEB128(u32, reader),
.addend = if (rel_type_enum.addendIsPresent()) try leb.readULEB128(u32, reader) else null,
};
- log.debug("Found relocation: type({s}) offset({d}) index({d}) addend({?d})", .{
+ log.debug("Found relocation: type({s}) offset({d}) index({d}) addend({d})", .{
@tagName(relocation.relocation_type),
relocation.offset,
relocation.index,
diff --git a/src/main.zig b/src/main.zig
index c9b9d1c0af..27682003f2 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -3168,7 +3168,7 @@ fn parseCrossTargetOrReportFatalError(
@tagName(diags.arch.?), help_text.items,
});
}
- fatal("Unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?});
+ fatal("Unknown CPU feature: '{s}'", .{diags.unknown_feature_name});
},
else => |e| return e,
};
@@ -3496,8 +3496,7 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, enable_cache: bool, stage
} else {
const out_zig_path = try fs.path.join(arena, &[_][]const u8{ "o", &digest, translated_zig_basename });
const zig_file = comp.local_cache_directory.handle.openFile(out_zig_path, .{}) catch |err| {
- const path = comp.local_cache_directory.path orelse ".";
- fatal("unable to open cached translated zig file '{s}{s}{s}': {s}", .{ path, fs.path.sep_str, out_zig_path, @errorName(err) });
+ fatal("unable to open cached translated zig file '{s}{s}{s}': {s}", .{ comp.local_cache_directory.path, fs.path.sep_str, out_zig_path, @errorName(err) });
};
defer zig_file.close();
try io.getStdOut().writeFileAll(zig_file, .{});
@@ -3627,8 +3626,7 @@ pub fn cmdInit(
.Exe => "init-exe",
};
var template_dir = zig_lib_directory.handle.openDir(template_sub_path, .{}) catch |err| {
- const path = zig_lib_directory.path orelse ".";
- fatal("unable to open zig project template directory '{s}{s}{s}': {s}", .{ path, s, template_sub_path, @errorName(err) });
+ fatal("unable to open zig project template directory '{s}{s}{s}': {s}", .{ zig_lib_directory.path, s, template_sub_path, @errorName(err) });
};
defer template_dir.close();
diff --git a/src/register_manager.zig b/src/register_manager.zig
index 0ab9d103b8..0bd9ef62e9 100644
--- a/src/register_manager.zig
+++ b/src/register_manager.zig
@@ -301,7 +301,7 @@ pub fn RegisterManager(
/// register.
pub fn getReg(self: *Self, reg: Register, inst: ?Air.Inst.Index) AllocateRegistersError!void {
const index = indexOfRegIntoTracked(reg) orelse return;
- log.debug("getReg {} for inst {?}", .{ reg, inst });
+ log.debug("getReg {} for inst {}", .{ reg, inst });
self.markRegAllocated(reg);
if (inst) |tracked_inst|
diff --git a/src/translate_c.zig b/src/translate_c.zig
index a64d00829a..53481c8f5d 100644
--- a/src/translate_c.zig
+++ b/src/translate_c.zig
@@ -2765,7 +2765,7 @@ fn transInitListExpr(
qual_type,
));
} else {
- const type_name = try c.str(qual_type.getTypeClassName());
+ const type_name = c.str(qual_type.getTypeClassName());
return fail(c, error.UnsupportedType, source_loc, "unsupported initlist type: '{s}'", .{type_name});
}
}
@@ -4812,11 +4812,11 @@ fn transType(c: *Context, scope: *Scope, ty: *const clang.Type, source_loc: clan
});
},
.BitInt, .ExtVector => {
- const type_name = try c.str(ty.getTypeClassName());
+ const type_name = c.str(ty.getTypeClassName());
return fail(c, error.UnsupportedType, source_loc, "TODO implement translation of type: '{s}'", .{type_name});
},
else => {
- const type_name = try c.str(ty.getTypeClassName());
+ const type_name = c.str(ty.getTypeClassName());
return fail(c, error.UnsupportedType, source_loc, "unsupported type: '{s}'", .{type_name});
},
}
@@ -5052,8 +5052,8 @@ fn finishTransFnProto(
}
fn warn(c: *Context, scope: *Scope, loc: clang.SourceLocation, comptime format: []const u8, args: anytype) !void {
- const str = try c.locStr(loc);
- const value = try std.fmt.allocPrint(c.arena, "// {s}: warning: " ++ format, .{str} ++ args);
+ const args_prefix = .{c.locStr(loc)};
+ const value = try std.fmt.allocPrint(c.arena, "// {s}: warning: " ++ format, args_prefix ++ args);
try scope.appendNode(try Tag.warning.create(c.arena, value));
}
@@ -5073,8 +5073,7 @@ pub fn failDecl(c: *Context, loc: clang.SourceLocation, name: []const u8, compti
// pub const name = @compileError(msg);
const fail_msg = try std.fmt.allocPrint(c.arena, format, args);
try addTopLevelDecl(c, name, try Tag.fail_decl.create(c.arena, .{ .actual = name, .mangled = fail_msg }));
- const str = try c.locStr(loc);
- const location_comment = try std.fmt.allocPrint(c.arena, "// {s}", .{str});
+ const location_comment = try std.fmt.allocPrint(c.arena, "// {s}", .{c.locStr(loc)});
try c.global_scope.nodes.append(try Tag.warning.create(c.arena, location_comment));
}