aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler/aro
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2024-05-02 20:20:41 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-06-13 10:18:59 -0400
commit76fb2b685b202ea665b850338e353c7816f5b2bb (patch)
tree16b4b39db7541febd2b4bf92c041239bdd45f144 /lib/compiler/aro
parent4aa15440c7a12bcc6bc0cd589ade02295549d48c (diff)
downloadzig-76fb2b685b202ea665b850338e353c7816f5b2bb.tar.gz
zig-76fb2b685b202ea665b850338e353c7816f5b2bb.zip
std: Convert deprecated aliases to compile errors and fix usages
Deprecated aliases that are now compile errors: - `std.fs.MAX_PATH_BYTES` (renamed to `std.fs.max_path_bytes`) - `std.mem.tokenize` (split into `tokenizeAny`, `tokenizeSequence`, `tokenizeScalar`) - `std.mem.split` (split into `splitSequence`, `splitAny`, `splitScalar`) - `std.mem.splitBackwards` (split into `splitBackwardsSequence`, `splitBackwardsAny`, `splitBackwardsScalar`) - `std.unicode` + `utf16leToUtf8Alloc`, `utf16leToUtf8AllocZ`, `utf16leToUtf8`, `fmtUtf16le` (all renamed to have capitalized `Le`) + `utf8ToUtf16LeWithNull` (renamed to `utf8ToUtf16LeAllocZ`) - `std.zig.CrossTarget` (moved to `std.Target.Query`) Deprecated `lib/std/std.zig` decls were deleted instead of made a `@compileError` because the `refAllDecls` in the test block would trigger the `@compileError`. The deleted top-level `std` namespaces are: - `std.rand` (renamed to `std.Random`) - `std.TailQueue` (renamed to `std.DoublyLinkedList`) - `std.ChildProcess` (renamed/moved to `std.process.Child`) This is not exhaustive. Deprecated aliases that I didn't touch: + `std.io.*` + `std.Build.*` + `std.builtin.Mode` + `std.zig.c_translation.CIntLiteralRadix` + anything in `src/`
Diffstat (limited to 'lib/compiler/aro')
-rw-r--r--lib/compiler/aro/aro/Driver.zig2
-rw-r--r--lib/compiler/aro/aro/Driver/Filesystem.zig4
-rw-r--r--lib/compiler/aro/aro/Driver/GCCDetector.zig4
-rw-r--r--lib/compiler/aro/aro/Toolchain.zig6
-rw-r--r--lib/compiler/aro/aro/Value.zig2
-rw-r--r--lib/compiler/aro/aro/toolchains/Linux.zig2
6 files changed, 10 insertions, 10 deletions
diff --git a/lib/compiler/aro/aro/Driver.zig b/lib/compiler/aro/aro/Driver.zig
index 66b1563e49..af2677626e 100644
--- a/lib/compiler/aro/aro/Driver.zig
+++ b/lib/compiler/aro/aro/Driver.zig
@@ -792,7 +792,7 @@ pub fn invokeLinker(d: *Driver, tc: *Toolchain, comptime fast_exit: bool) !void
var argv = std.ArrayList([]const u8).init(d.comp.gpa);
defer argv.deinit();
- var linker_path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var linker_path_buf: [std.fs.max_path_bytes]u8 = undefined;
const linker_path = try tc.getLinkerPath(&linker_path_buf);
try argv.append(linker_path);
diff --git a/lib/compiler/aro/aro/Driver/Filesystem.zig b/lib/compiler/aro/aro/Driver/Filesystem.zig
index f9a652ac76..3889ec73b3 100644
--- a/lib/compiler/aro/aro/Driver/Filesystem.zig
+++ b/lib/compiler/aro/aro/Driver/Filesystem.zig
@@ -46,7 +46,7 @@ fn canExecuteFake(entries: []const Filesystem.Entry, path: []const u8) bool {
fn existsFake(entries: []const Filesystem.Entry, path: []const u8) bool {
@setCold(true);
- var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&buf);
const resolved = std.fs.path.resolvePosix(fib.allocator(), &.{path}) catch return false;
for (entries) |entry| {
@@ -181,7 +181,7 @@ pub const Filesystem = union(enum) {
}
pub fn joinedExists(fs: Filesystem, parts: []const []const u8) bool {
- var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&buf);
const joined = std.fs.path.join(fib.allocator(), parts) catch return false;
return fs.exists(joined);
diff --git a/lib/compiler/aro/aro/Driver/GCCDetector.zig b/lib/compiler/aro/aro/Driver/GCCDetector.zig
index 4524fcade8..d13a63985d 100644
--- a/lib/compiler/aro/aro/Driver/GCCDetector.zig
+++ b/lib/compiler/aro/aro/Driver/GCCDetector.zig
@@ -397,7 +397,7 @@ fn collectLibDirsAndTriples(
}
pub fn discover(self: *GCCDetector, tc: *Toolchain) !void {
- var path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var path_buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&path_buf);
const target = tc.getTarget();
@@ -589,7 +589,7 @@ fn scanLibDirForGCCTriple(
gcc_dir_exists: bool,
gcc_cross_dir_exists: bool,
) !void {
- var path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var path_buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&path_buf);
for (0..2) |i| {
if (i == 0 and !gcc_dir_exists) continue;
diff --git a/lib/compiler/aro/aro/Toolchain.zig b/lib/compiler/aro/aro/Toolchain.zig
index 4c62aebca9..1313675f6c 100644
--- a/lib/compiler/aro/aro/Toolchain.zig
+++ b/lib/compiler/aro/aro/Toolchain.zig
@@ -221,7 +221,7 @@ pub fn addFilePathLibArgs(tc: *const Toolchain, argv: *std.ArrayList([]const u8)
/// If not found there, just use `name`
/// Writes the result to `buf` and returns a slice of it
fn getProgramPath(tc: *const Toolchain, name: []const u8, buf: []u8) []const u8 {
- var path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var path_buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&path_buf);
var tool_specific_buf: [64]u8 = undefined;
@@ -251,7 +251,7 @@ pub fn getSysroot(tc: *const Toolchain) []const u8 {
/// Search for `name` in a variety of places
/// TODO: cache results based on `name` so we're not repeatedly allocating the same strings?
pub fn getFilePath(tc: *const Toolchain, name: []const u8) ![]const u8 {
- var path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var path_buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&path_buf);
const allocator = fib.allocator();
@@ -304,7 +304,7 @@ const PathKind = enum {
/// Join `components` into a path. If the path exists, dupe it into the toolchain arena and
/// add it to the specified path list.
pub fn addPathIfExists(tc: *Toolchain, components: []const []const u8, dest_kind: PathKind) !void {
- var path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var path_buf: [std.fs.max_path_bytes]u8 = undefined;
var fib = std.heap.FixedBufferAllocator.init(&path_buf);
const candidate = try std.fs.path.join(fib.allocator(), components);
diff --git a/lib/compiler/aro/aro/Value.zig b/lib/compiler/aro/aro/Value.zig
index 6a2aa4d48a..45d49c99ff 100644
--- a/lib/compiler/aro/aro/Value.zig
+++ b/lib/compiler/aro/aro/Value.zig
@@ -706,7 +706,7 @@ pub fn printString(bytes: []const u8, ty: Type, comp: *const Compilation, w: any
switch (size) {
inline .@"1", .@"2" => |sz| {
const data_slice: []const sz.Type() = @alignCast(std.mem.bytesAsSlice(sz.Type(), without_null));
- const formatter = if (sz == .@"1") std.zig.fmtEscapes(data_slice) else std.unicode.fmtUtf16le(data_slice);
+ const formatter = if (sz == .@"1") std.zig.fmtEscapes(data_slice) else std.unicode.fmtUtf16Le(data_slice);
try w.print("\"{}\"", .{formatter});
},
.@"4" => {
diff --git a/lib/compiler/aro/aro/toolchains/Linux.zig b/lib/compiler/aro/aro/toolchains/Linux.zig
index b70ffc1053..f166e9e683 100644
--- a/lib/compiler/aro/aro/toolchains/Linux.zig
+++ b/lib/compiler/aro/aro/toolchains/Linux.zig
@@ -478,7 +478,7 @@ test Linux {
var argv = std.ArrayList([]const u8).init(driver.comp.gpa);
defer argv.deinit();
- var linker_path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
+ var linker_path_buf: [std.fs.max_path_bytes]u8 = undefined;
const linker_path = try toolchain.getLinkerPath(&linker_path_buf);
try argv.append(linker_path);