authorgravatar for manlio.perillo@gmail.comManlio Perillo <manlio.perillo@gmail.com> 2024-02-04 16:29:53+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-06 16:09:55-08:00
log3da6043e2c3fa657cc7261e8cffdf3564c02dda9
tree9b27b0479dc923db70201752f72fabb2f7a69a13
parent476ba04753ede5f81c0d411f017383a1f50d5e80

compiler: remove unnecessary pub declarations in main.zig

Some declarations, like zig subcommands and usage strings, are unnecessary marked as public, even thought they are only referenced by main.zig.

1 files changed, 19 insertions(+), 19 deletions(-)

src/main.zig+19-19
......@@ -52,7 +52,7 @@ pub fn wasi_cwd() fs.Dir {
5252 return .{ .fd = cwd_fd };
5353}
5454
55pub fn getWasiPreopen(name: []const u8) Compilation.Directory {
55fn getWasiPreopen(name: []const u8) Compilation.Directory {
5656 return .{
5757 .path = name,
5858 .handle = .{
......@@ -68,11 +68,11 @@ pub fn fatal(comptime format: []const u8, args: anytype) noreturn {
6868
6969/// There are many assumptions in the entire codebase that Zig source files can
7070/// be byte-indexed with a u32 integer.
71pub const max_src_size = std.math.maxInt(u32);
71const max_src_size = std.math.maxInt(u32);
7272
73pub const debug_extensions_enabled = builtin.mode == .Debug;
73const debug_extensions_enabled = builtin.mode == .Debug;
7474
75pub const Color = enum {
75const Color = enum {
7676 auto,
7777 off,
7878 on,
......@@ -234,7 +234,7 @@ fn verifyLibcxxCorrectlyLinked() void {
234234 }
235235}
236236
237pub fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
237fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
238238 if (args.len <= 1) {
239239 std.log.info("{s}", .{usage});
240240 fatal("expected command argument", .{});
......@@ -778,7 +778,7 @@ const CliModule = struct {
778778 rc_source_files_start: usize,
779779 rc_source_files_end: usize,
780780
781 pub const Dep = struct {
781 const Dep = struct {
782782 key: []const u8,
783783 value: []const u8,
784784 };
......@@ -4933,7 +4933,7 @@ fn detectRcIncludeDirs(arena: Allocator, zig_lib_dir: []const u8, auto_includes:
49334933 }
49344934}
49354935
4936pub const usage_libc =
4936const usage_libc =
49374937 \\Usage: zig libc
49384938 \\
49394939 \\ Detect the native libc installation and print the resulting
......@@ -4952,7 +4952,7 @@ pub const usage_libc =
49524952 \\
49534953;
49544954
4955pub fn cmdLibC(gpa: Allocator, args: []const []const u8) !void {
4955fn cmdLibC(gpa: Allocator, args: []const []const u8) !void {
49564956 var input_file: ?[]const u8 = null;
49574957 var target_arch_os_abi: []const u8 = "native";
49584958 var print_includes: bool = false;
......@@ -5063,7 +5063,7 @@ pub fn cmdLibC(gpa: Allocator, args: []const []const u8) !void {
50635063 }
50645064}
50655065
5066pub const usage_init =
5066const usage_init =
50675067 \\Usage: zig init
50685068 \\
50695069 \\ Initializes a `zig build` project in the current working
......@@ -5075,7 +5075,7 @@ pub const usage_init =
50755075 \\
50765076;
50775077
5078pub fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
5078fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
50795079 {
50805080 var i: usize = 0;
50815081 while (i < args.len) : (i += 1) {
......@@ -5126,7 +5126,7 @@ pub fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void
51265126 return cleanExit();
51275127}
51285128
5129pub const usage_build =
5129const usage_build =
51305130 \\Usage: zig build [steps] [options]
51315131 \\
51325132 \\ Build a project from build.zig.
......@@ -5150,7 +5150,7 @@ pub const usage_build =
51505150 \\
51515151;
51525152
5153pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
5153fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
51545154 var progress: std.Progress = .{ .dont_print_on_dumb = true };
51555155
51565156 var build_file: ?[]const u8 = null;
......@@ -5772,7 +5772,7 @@ fn readSourceFileToEndAlloc(
57725772 return source_code;
57735773}
57745774
5775pub const usage_fmt =
5775const usage_fmt =
57765776 \\Usage: zig fmt [file]...
57775777 \\
57785778 \\ Formats the input files and modifies them in-place.
......@@ -5803,7 +5803,7 @@ const Fmt = struct {
58035803 const SeenMap = std.AutoHashMap(fs.File.INode, void);
58045804};
58055805
5806pub fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
5806fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
58075807 var color: Color = .auto;
58085808 var stdin_flag: bool = false;
58095809 var check_flag: bool = false;
......@@ -6190,7 +6190,7 @@ pub fn putAstErrorsIntoBundle(
61906190 try Compilation.addZirErrorMessages(wip_errors, &file);
61916191}
61926192
6193pub const info_zen =
6193const info_zen =
61946194 \\
61956195 \\ * Communicate intent precisely.
61966196 \\ * Edge cases matter.
......@@ -6655,7 +6655,7 @@ const usage_ast_check =
66556655 \\
66566656;
66576657
6658pub fn cmdAstCheck(
6658fn cmdAstCheck(
66596659 gpa: Allocator,
66606660 arena: Allocator,
66616661 args: []const []const u8,
......@@ -6816,7 +6816,7 @@ pub fn cmdAstCheck(
68166816}
68176817
68186818/// This is only enabled for debug builds.
6819pub fn cmdDumpZir(
6819fn cmdDumpZir(
68206820 gpa: Allocator,
68216821 arena: Allocator,
68226822 args: []const []const u8,
......@@ -6876,7 +6876,7 @@ pub fn cmdDumpZir(
68766876}
68776877
68786878/// This is only enabled for debug builds.
6879pub fn cmdChangelist(
6879fn cmdChangelist(
68806880 gpa: Allocator,
68816881 arena: Allocator,
68826882 args: []const []const u8,
......@@ -7377,7 +7377,7 @@ fn parseRcIncludes(arg: []const u8) Compilation.RcIncludes {
73777377 fatal("unsupported rc includes type: '{s}'", .{arg});
73787378}
73797379
7380pub const usage_fetch =
7380const usage_fetch =
73817381 \\Usage: zig fetch [options] <url>
73827382 \\Usage: zig fetch [options] <path>
73837383 \\