| author | |
| committer | |
| log | 87528630ddf4182594f6f3554d9d6c1fd550e261 |
| tree | f383a038179f9366058f93bdfa1a11d8494f04d3 |
| parent | 8d6eb13c725f409270fc34c104da4c206b70c376 |
8 files changed, 55 insertions(+), 55 deletions(-)
lib/std/debug/Dwarf.zig+3-3| ... | @@ -571,8 +571,8 @@ fn scanAllCompileUnits(di: *Dwarf, gpa: Allocator, endian: Endian) ScanError!voi | ... | @@ -571,8 +571,8 @@ fn scanAllCompileUnits(di: *Dwarf, gpa: Allocator, endian: Endian) ScanError!voi |
| 571 | var fr: Reader = .fixed(di.section(.debug_info).?); | 571 | var fr: Reader = .fixed(di.section(.debug_info).?); |
| 572 | var this_unit_offset: u64 = 0; | 572 | var this_unit_offset: u64 = 0; |
| 573 | 573 | ||
| 574 | var attrs_buf = std.array_list.Managed(Die.Attr).init(gpa); | 574 | var attrs_buf: std.ArrayList(Die.Attr) = .empty; |
| 575 | defer attrs_buf.deinit(); | 575 | defer attrs_buf.deinit(gpa); |
| 576 | 576 | ||
| 577 | while (this_unit_offset < fr.buffer.len) { | 577 | while (this_unit_offset < fr.buffer.len) { |
| 578 | fr.seek = @intCast(this_unit_offset); | 578 | fr.seek = @intCast(this_unit_offset); |
| ... | @@ -603,7 +603,7 @@ fn scanAllCompileUnits(di: *Dwarf, gpa: Allocator, endian: Endian) ScanError!voi | ... | @@ -603,7 +603,7 @@ fn scanAllCompileUnits(di: *Dwarf, gpa: Allocator, endian: Endian) ScanError!voi |
| 603 | for (abbrev_table.abbrevs) |abbrev| { | 603 | for (abbrev_table.abbrevs) |abbrev| { |
| 604 | max_attrs = @max(max_attrs, abbrev.attrs.len); | 604 | max_attrs = @max(max_attrs, abbrev.attrs.len); |
| 605 | } | 605 | } |
| 606 | try attrs_buf.resize(max_attrs); | 606 | try attrs_buf.resize(gpa, max_attrs); |
| 607 | 607 | ||
| 608 | var compile_unit_die = (try parseDie( | 608 | var compile_unit_die = (try parseDie( |
| 609 | &fr, | 609 | &fr, |
lib/std/hash_map.zig+6-6| ... | @@ -1802,15 +1802,15 @@ test "put and remove loop in random order" { | ... | @@ -1802,15 +1802,15 @@ test "put and remove loop in random order" { |
| 1802 | var map = AutoHashMap(u32, u32).init(std.testing.allocator); | 1802 | var map = AutoHashMap(u32, u32).init(std.testing.allocator); |
| 1803 | defer map.deinit(); | 1803 | defer map.deinit(); |
| 1804 | 1804 | ||
| 1805 | var keys = std.array_list.Managed(u32).init(std.testing.allocator); | 1805 | var keys: std.ArrayList(u32) = .empty; |
| 1806 | defer keys.deinit(); | 1806 | defer keys.deinit(std.testing.allocator); |
| 1807 | 1807 | ||
| 1808 | const size = 32; | 1808 | const size = 32; |
| 1809 | const iterations = 100; | 1809 | const iterations = 100; |
| 1810 | 1810 | ||
| 1811 | var i: u32 = 0; | 1811 | var i: u32 = 0; |
| 1812 | while (i < size) : (i += 1) { | 1812 | while (i < size) : (i += 1) { |
| 1813 | try keys.append(i); | 1813 | try keys.append(std.testing.allocator, i); |
| 1814 | } | 1814 | } |
| 1815 | var prng = std.Random.DefaultPrng.init(std.testing.random_seed); | 1815 | var prng = std.Random.DefaultPrng.init(std.testing.random_seed); |
| 1816 | const random = prng.random(); | 1816 | const random = prng.random(); |
| ... | @@ -1836,12 +1836,12 @@ test "remove many elements in random order" { | ... | @@ -1836,12 +1836,12 @@ test "remove many elements in random order" { |
| 1836 | var map = Map.init(std.heap.page_allocator); | 1836 | var map = Map.init(std.heap.page_allocator); |
| 1837 | defer map.deinit(); | 1837 | defer map.deinit(); |
| 1838 | 1838 | ||
| 1839 | var keys = std.array_list.Managed(u32).init(std.heap.page_allocator); | 1839 | var keys: std.ArrayList(u32) = .empty; |
| 1840 | defer keys.deinit(); | 1840 | defer keys.deinit(std.heap.page_allocator); |
| 1841 | 1841 | ||
| 1842 | var i: u32 = 0; | 1842 | var i: u32 = 0; |
| 1843 | while (i < n) : (i += 1) { | 1843 | while (i < n) : (i += 1) { |
| 1844 | keys.append(i) catch unreachable; | 1844 | keys.append(std.heap.page_allocator, i) catch unreachable; |
| 1845 | } | 1845 | } |
| 1846 | 1846 | ||
| 1847 | var prng = std.Random.DefaultPrng.init(std.testing.random_seed); | 1847 | var prng = std.Random.DefaultPrng.init(std.testing.random_seed); |
lib/std/http/test.zig+9-9| ... | @@ -336,17 +336,17 @@ test "Server.Request.respondStreaming non-chunked, unknown content-length" { | ... | @@ -336,17 +336,17 @@ test "Server.Request.respondStreaming non-chunked, unknown content-length" { |
| 336 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); | 336 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); |
| 337 | defer gpa.free(response); | 337 | defer gpa.free(response); |
| 338 | 338 | ||
| 339 | var expected_response = std.array_list.Managed(u8).init(gpa); | 339 | var expected_response: std.ArrayList(u8) = .empty; |
| 340 | defer expected_response.deinit(); | 340 | defer expected_response.deinit(gpa); |
| 341 | 341 | ||
| 342 | try expected_response.appendSlice("HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n"); | 342 | try expected_response.appendSlice(gpa, "HTTP/1.1 200 OK\r\nconnection: close\r\n\r\n"); |
| 343 | 343 | ||
| 344 | { | 344 | { |
| 345 | var total: usize = 0; | 345 | var total: usize = 0; |
| 346 | for (0..500) |i| { | 346 | for (0..500) |i| { |
| 347 | var buf: [30]u8 = undefined; | 347 | var buf: [30]u8 = undefined; |
| 348 | const line = try std.mem.print(&buf, "{d}, ah ha ha!\n", .{i}); | 348 | const line = try std.mem.print(&buf, "{d}, ah ha ha!\n", .{i}); |
| 349 | try expected_response.appendSlice(line); | 349 | try expected_response.appendSlice(gpa, line); |
| 350 | total += line.len; | 350 | total += line.len; |
| 351 | } | 351 | } |
| 352 | try expectEqual(7390, total); | 352 | try expectEqual(7390, total); |
| ... | @@ -411,12 +411,12 @@ test "receiving arbitrary http headers from the client" { | ... | @@ -411,12 +411,12 @@ test "receiving arbitrary http headers from the client" { |
| 411 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); | 411 | const response = try stream_reader.interface.allocRemaining(gpa, .unlimited); |
| 412 | defer gpa.free(response); | 412 | defer gpa.free(response); |
| 413 | 413 | ||
| 414 | var expected_response = std.array_list.Managed(u8).init(gpa); | 414 | var expected_response: std.ArrayList(u8) = .empty; |
| 415 | defer expected_response.deinit(); | 415 | defer expected_response.deinit(gpa); |
| 416 | 416 | ||
| 417 | try expected_response.appendSlice("HTTP/1.1 200 OK\r\n"); | 417 | try expected_response.appendSlice(gpa, "HTTP/1.1 200 OK\r\n"); |
| 418 | try expected_response.appendSlice("connection: close\r\n"); | 418 | try expected_response.appendSlice(gpa, "connection: close\r\n"); |
| 419 | try expected_response.appendSlice("content-length: 0\r\n\r\n"); | 419 | try expected_response.appendSlice(gpa, "content-length: 0\r\n\r\n"); |
| 420 | try expectEqualStrings(expected_response.items, response); | 420 | try expectEqualStrings(expected_response.items, response); |
| 421 | } | 421 | } |
| 422 | 422 |
lib/std/priority_dequeue.zig+4-4| ... | @@ -1020,16 +1020,16 @@ fn fuzzTestMinMax(rng: std.Random, queue_size: usize) !void { | ... | @@ -1020,16 +1020,16 @@ fn fuzzTestMinMax(rng: std.Random, queue_size: usize) !void { |
| 1020 | } | 1020 | } |
| 1021 | 1021 | ||
| 1022 | fn generateRandomSlice(allocator: std.mem.Allocator, rng: std.Random, size: usize) ![]u32 { | 1022 | fn generateRandomSlice(allocator: std.mem.Allocator, rng: std.Random, size: usize) ![]u32 { |
| 1023 | var array = std.array_list.Managed(u32).init(allocator); | 1023 | var array: std.ArrayList(u32) = .empty; |
| 1024 | try array.ensureTotalCapacity(size); | 1024 | try array.ensureTotalCapacity(allocator, size); |
| 1025 | 1025 | ||
| 1026 | var i: usize = 0; | 1026 | var i: usize = 0; |
| 1027 | while (i < size) : (i += 1) { | 1027 | while (i < size) : (i += 1) { |
| 1028 | const elem = rng.int(u32); | 1028 | const elem = rng.int(u32); |
| 1029 | try array.append(elem); | 1029 | try array.append(allocator, elem); |
| 1030 | } | 1030 | } |
| 1031 | 1031 | ||
| 1032 | return array.toOwnedSlice(); | 1032 | return array.toOwnedSlice(allocator); |
| 1033 | } | 1033 | } |
| 1034 | 1034 | ||
| 1035 | fn contextLessThanComparison(context: []const u32, a: usize, b: usize) Order { | 1035 | fn contextLessThanComparison(context: []const u32, a: usize, b: usize) Order { |
lib/std/zig.zig+12-12| ... | @@ -900,10 +900,10 @@ pub fn parseTargetQueryOrReportFatalError( | ... | @@ -900,10 +900,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 900 | return std.Target.Query.parse(opts_with_diags) catch |err| switch (err) { | 900 | return std.Target.Query.parse(opts_with_diags) catch |err| switch (err) { |
| 901 | error.UnknownCpuModel => { | 901 | error.UnknownCpuModel => { |
| 902 | help: { | 902 | help: { |
| 903 | var help_text = std.array_list.Managed(u8).init(allocator); | 903 | var help_text: std.ArrayList(u8) = .empty; |
| 904 | defer help_text.deinit(); | 904 | defer help_text.deinit(allocator); |
| 905 | for (diags.arch.?.allCpuModels()) |cpu| { | 905 | for (diags.arch.?.allCpuModels()) |cpu| { |
| 906 | help_text.print(" {s}\n", .{cpu.name}) catch break :help; | 906 | help_text.print(allocator, " {s}\n", .{cpu.name}) catch break :help; |
| 907 | } | 907 | } |
| 908 | log.info("available CPUs for architecture '{s}':\n{s}", .{ | 908 | log.info("available CPUs for architecture '{s}':\n{s}", .{ |
| 909 | @tagName(diags.arch.?), help_text.items, | 909 | @tagName(diags.arch.?), help_text.items, |
| ... | @@ -913,10 +913,10 @@ pub fn parseTargetQueryOrReportFatalError( | ... | @@ -913,10 +913,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 913 | }, | 913 | }, |
| 914 | error.UnknownCpuFeature => { | 914 | error.UnknownCpuFeature => { |
| 915 | help: { | 915 | help: { |
| 916 | var help_text = std.array_list.Managed(u8).init(allocator); | 916 | var help_text: std.ArrayList(u8) = .empty; |
| 917 | defer help_text.deinit(); | 917 | defer help_text.deinit(allocator); |
| 918 | for (diags.arch.?.allFeaturesList()) |feature| { | 918 | for (diags.arch.?.allFeaturesList()) |feature| { |
| 919 | help_text.print(" {s}: {s}\n", .{ feature.name, feature.description }) catch break :help; | 919 | help_text.print(allocator, " {s}: {s}\n", .{ feature.name, feature.description }) catch break :help; |
| 920 | } | 920 | } |
| 921 | log.info("available CPU features for architecture '{s}':\n{s}", .{ | 921 | log.info("available CPU features for architecture '{s}':\n{s}", .{ |
| 922 | @tagName(diags.arch.?), help_text.items, | 922 | @tagName(diags.arch.?), help_text.items, |
| ... | @@ -926,10 +926,10 @@ pub fn parseTargetQueryOrReportFatalError( | ... | @@ -926,10 +926,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 926 | }, | 926 | }, |
| 927 | error.UnknownObjectFormat => { | 927 | error.UnknownObjectFormat => { |
| 928 | help: { | 928 | help: { |
| 929 | var help_text = std.array_list.Managed(u8).init(allocator); | 929 | var help_text: std.ArrayList(u8) = .empty; |
| 930 | defer help_text.deinit(); | 930 | defer help_text.deinit(allocator); |
| 931 | inline for (@typeInfo(std.Target.ObjectFormat).@"enum".field_names) |field_name| { | 931 | inline for (@typeInfo(std.Target.ObjectFormat).@"enum".field_names) |field_name| { |
| 932 | help_text.print(" {s}\n", .{field_name}) catch break :help; | 932 | help_text.print(allocator, " {s}\n", .{field_name}) catch break :help; |
| 933 | } | 933 | } |
| 934 | log.info("available object formats:\n{s}", .{help_text.items}); | 934 | log.info("available object formats:\n{s}", .{help_text.items}); |
| 935 | } | 935 | } |
| ... | @@ -937,10 +937,10 @@ pub fn parseTargetQueryOrReportFatalError( | ... | @@ -937,10 +937,10 @@ pub fn parseTargetQueryOrReportFatalError( |
| 937 | }, | 937 | }, |
| 938 | error.UnknownArchitecture => { | 938 | error.UnknownArchitecture => { |
| 939 | help: { | 939 | help: { |
| 940 | var help_text = std.array_list.Managed(u8).init(allocator); | 940 | var help_text: std.ArrayList(u8) = .empty; |
| 941 | defer help_text.deinit(); | 941 | defer help_text.deinit(allocator); |
| 942 | inline for (@typeInfo(std.Target.Cpu.Arch).@"enum".field_names) |field_name| { | 942 | inline for (@typeInfo(std.Target.Cpu.Arch).@"enum".field_names) |field_name| { |
| 943 | help_text.print(" {s}\n", .{field_name}) catch break :help; | 943 | help_text.print(allocator, " {s}\n", .{field_name}) catch break :help; |
| 944 | } | 944 | } |
| 945 | log.info("available architectures:\n{s} native\n", .{help_text.items}); | 945 | log.info("available architectures:\n{s} native\n", .{help_text.items}); |
| 946 | } | 946 | } |
lib/std/zig/AstGen.zig+3-3| ... | @@ -1802,13 +1802,13 @@ fn structInitExpr( | ... | @@ -1802,13 +1802,13 @@ fn structInitExpr( |
| 1802 | while (it.next()) |entry| { | 1802 | while (it.next()) |entry| { |
| 1803 | const record = entry.value_ptr.*; | 1803 | const record = entry.value_ptr.*; |
| 1804 | if (record.items.len > 1) { | 1804 | if (record.items.len > 1) { |
| 1805 | var error_notes = std.array_list.Managed(u32).init(astgen.arena); | 1805 | var error_notes: std.ArrayList(u32) = .empty; |
| 1806 | 1806 | ||
| 1807 | for (record.items[1..]) |duplicate| { | 1807 | for (record.items[1..]) |duplicate| { |
| 1808 | try error_notes.append(try astgen.errNoteTok(duplicate, "duplicate name here", .{})); | 1808 | try error_notes.append(astgen.arena, try astgen.errNoteTok(duplicate, "duplicate name here", .{})); |
| 1809 | } | 1809 | } |
| 1810 | 1810 | ||
| 1811 | try error_notes.append(try astgen.errNoteNode(node, "struct declared here", .{})); | 1811 | try error_notes.append(astgen.arena, try astgen.errNoteNode(node, "struct declared here", .{})); |
| 1812 | 1812 | ||
| 1813 | try astgen.appendErrorTokNotes( | 1813 | try astgen.appendErrorTokNotes( |
| 1814 | record.items[0], | 1814 | record.items[0], |
lib/std/zig/LibCDirs.zig+2-2| ... | @@ -96,7 +96,7 @@ pub fn detect( | ... | @@ -96,7 +96,7 @@ pub fn detect( |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | fn detectFromInstallation(arena: Allocator, target: *const std.Target, lci: *const LibCInstallation) !LibCDirs { | 98 | fn detectFromInstallation(arena: Allocator, target: *const std.Target, lci: *const LibCInstallation) !LibCDirs { |
| 99 | var list = try std.array_list.Managed([]const u8).initCapacity(arena, 5); | 99 | var list: std.ArrayList([]const u8) = try .initCapacity(arena, 5); |
| 100 | 100 | ||
| 101 | list.appendAssumeCapacity(lci.include_dir.?); | 101 | list.appendAssumeCapacity(lci.include_dir.?); |
| 102 | 102 | ||
| ... | @@ -133,7 +133,7 @@ fn detectFromInstallation(arena: Allocator, target: *const std.Target, lci: *con | ... | @@ -133,7 +133,7 @@ fn detectFromInstallation(arena: Allocator, target: *const std.Target, lci: *con |
| 133 | }; | 133 | }; |
| 134 | for (subdirs) |subdir| { | 134 | for (subdirs) |subdir| { |
| 135 | const path = try std.fs.path.join(arena, &[_][]const u8{ include_dir_path, subdir }); | 135 | const path = try std.fs.path.join(arena, &[_][]const u8{ include_dir_path, subdir }); |
| 136 | try list.append(path); | 136 | try list.append(arena, path); |
| 137 | } | 137 | } |
| 138 | } | 138 | } |
| 139 | 139 |
lib/std/zig/llvm/Builder.zig+16-16| ... | @@ -95,8 +95,8 @@ fn subArchName(target: *const std.Target, comptime family: std.Target.Cpu.Arch.F | ... | @@ -95,8 +95,8 @@ fn subArchName(target: *const std.Target, comptime family: std.Target.Cpu.Arch.F |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const u8 { | 97 | pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const u8 { |
| 98 | var llvm_triple = std.array_list.Managed(u8).init(allocator); | 98 | var llvm_triple: std.ArrayList(u8) = .empty; |
| 99 | defer llvm_triple.deinit(); | 99 | defer llvm_triple.deinit(allocator); |
| 100 | 100 | ||
| 101 | const llvm_arch = switch (target.cpu.arch) { | 101 | const llvm_arch = switch (target.cpu.arch) { |
| 102 | .arm => "arm", | 102 | .arm => "arm", |
| ... | @@ -168,7 +168,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -168,7 +168,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 168 | => unreachable, // Gated by hasLlvmSupport(). | 168 | => unreachable, // Gated by hasLlvmSupport(). |
| 169 | }; | 169 | }; |
| 170 | 170 | ||
| 171 | try llvm_triple.appendSlice(llvm_arch); | 171 | try llvm_triple.appendSlice(allocator, llvm_arch); |
| 172 | 172 | ||
| 173 | const llvm_sub_arch: ?[]const u8 = switch (target.cpu.arch) { | 173 | const llvm_sub_arch: ?[]const u8 = switch (target.cpu.arch) { |
| 174 | .arm, .armeb, .thumb, .thumbeb => subArchName(target, .arm, .{ | 174 | .arm, .armeb, .thumb, .thumbeb => subArchName(target, .arm, .{ |
| ... | @@ -223,10 +223,10 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -223,10 +223,10 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 223 | else => null, | 223 | else => null, |
| 224 | }; | 224 | }; |
| 225 | 225 | ||
| 226 | if (llvm_sub_arch) |sub| try llvm_triple.appendSlice(sub); | 226 | if (llvm_sub_arch) |sub| try llvm_triple.appendSlice(allocator, sub); |
| 227 | try llvm_triple.append('-'); | 227 | try llvm_triple.append(allocator, '-'); |
| 228 | 228 | ||
| 229 | try llvm_triple.appendSlice(switch (target.os.tag) { | 229 | try llvm_triple.appendSlice(allocator, switch (target.os.tag) { |
| 230 | .driverkit, | 230 | .driverkit, |
| 231 | .ios, | 231 | .ios, |
| 232 | .maccatalyst, | 232 | .maccatalyst, |
| ... | @@ -248,7 +248,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -248,7 +248,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 248 | => "mesa", | 248 | => "mesa", |
| 249 | else => "unknown", | 249 | else => "unknown", |
| 250 | }); | 250 | }); |
| 251 | try llvm_triple.append('-'); | 251 | try llvm_triple.append(allocator, '-'); |
| 252 | 252 | ||
| 253 | const llvm_os = switch (target.os.tag) { | 253 | const llvm_os = switch (target.os.tag) { |
| 254 | .dragonfly => "dragonfly", | 254 | .dragonfly => "dragonfly", |
| ... | @@ -298,28 +298,28 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -298,28 +298,28 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 298 | .ashetos, | 298 | .ashetos, |
| 299 | => "unknown", | 299 | => "unknown", |
| 300 | }; | 300 | }; |
| 301 | try llvm_triple.appendSlice(llvm_os); | 301 | try llvm_triple.appendSlice(allocator, llvm_os); |
| 302 | 302 | ||
| 303 | switch (target.os.versionRange()) { | 303 | switch (target.os.versionRange()) { |
| 304 | .none, | 304 | .none, |
| 305 | .windows, | 305 | .windows, |
| 306 | => {}, | 306 | => {}, |
| 307 | .semver => |ver| if (target.os.tag == .wasi and ver.min.major == 0) { | 307 | .semver => |ver| if (target.os.tag == .wasi and ver.min.major == 0) { |
| 308 | try llvm_triple.print("p{d}", .{ver.min.minor}); | 308 | try llvm_triple.print(allocator, "p{d}", .{ver.min.minor}); |
| 309 | } else if (target.os.tag != .amdhsa) { | 309 | } else if (target.os.tag != .amdhsa) { |
| 310 | try llvm_triple.print("{d}.{d}.{d}", .{ | 310 | try llvm_triple.print(allocator, "{d}.{d}.{d}", .{ |
| 311 | ver.min.major, | 311 | ver.min.major, |
| 312 | ver.min.minor, | 312 | ver.min.minor, |
| 313 | ver.min.patch, | 313 | ver.min.patch, |
| 314 | }); | 314 | }); |
| 315 | }, | 315 | }, |
| 316 | inline .linux, .hurd => |ver| try llvm_triple.print("{d}.{d}.{d}", .{ | 316 | inline .linux, .hurd => |ver| try llvm_triple.print(allocator, "{d}.{d}.{d}", .{ |
| 317 | ver.range.min.major, | 317 | ver.range.min.major, |
| 318 | ver.range.min.minor, | 318 | ver.range.min.minor, |
| 319 | ver.range.min.patch, | 319 | ver.range.min.patch, |
| 320 | }), | 320 | }), |
| 321 | } | 321 | } |
| 322 | try llvm_triple.append('-'); | 322 | try llvm_triple.append(allocator, '-'); |
| 323 | 323 | ||
| 324 | const llvm_abi = switch (target.abi) { | 324 | const llvm_abi = switch (target.abi) { |
| 325 | .none => if (target.os.tag == .maccatalyst) "macabi" else "unknown", | 325 | .none => if (target.os.tag == .maccatalyst) "macabi" else "unknown", |
| ... | @@ -357,7 +357,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -357,7 +357,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 357 | .ohos, .ohoseabi => "ohos", | 357 | .ohos, .ohoseabi => "ohos", |
| 358 | .call0 => "unknown", | 358 | .call0 => "unknown", |
| 359 | }; | 359 | }; |
| 360 | try llvm_triple.appendSlice(llvm_abi); | 360 | try llvm_triple.appendSlice(allocator, llvm_abi); |
| 361 | 361 | ||
| 362 | switch (target.os.versionRange()) { | 362 | switch (target.os.versionRange()) { |
| 363 | .none, | 363 | .none, |
| ... | @@ -365,17 +365,17 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const | ... | @@ -365,17 +365,17 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const |
| 365 | .windows, | 365 | .windows, |
| 366 | => {}, | 366 | => {}, |
| 367 | inline .hurd, .linux => |ver| if (target.abi.isGnu()) { | 367 | inline .hurd, .linux => |ver| if (target.abi.isGnu()) { |
| 368 | try llvm_triple.print("{d}.{d}.{d}", .{ | 368 | try llvm_triple.print(allocator, "{d}.{d}.{d}", .{ |
| 369 | ver.glibc.major, | 369 | ver.glibc.major, |
| 370 | ver.glibc.minor, | 370 | ver.glibc.minor, |
| 371 | ver.glibc.patch, | 371 | ver.glibc.patch, |
| 372 | }); | 372 | }); |
| 373 | } else if (@TypeOf(ver) == std.Target.Os.LinuxVersionRange and target.abi.isAndroid()) { | 373 | } else if (@TypeOf(ver) == std.Target.Os.LinuxVersionRange and target.abi.isAndroid()) { |
| 374 | try llvm_triple.print("{d}", .{ver.android}); | 374 | try llvm_triple.print(allocator, "{d}", .{ver.android}); |
| 375 | }, | 375 | }, |
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | return llvm_triple.toOwnedSlice(); | 378 | return llvm_triple.toOwnedSlice(allocator); |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | pub const DataLayout = struct { | 381 | pub const DataLayout = struct { |