(breaking) std.Buffer => std.ArrayListSentineled(u8, 0)

This new name (and the fact that it is a function returning a type) will
make it more clear which use cases are better suited for ArrayList and
which are better suited for ArrayListSentineled.

Also for consistency with ArrayList,
 * `append` => `appendSlice`
 * `appendByte` => `append`

Thanks daurnimator for pointing out the confusion of std.Buffer.
This commit is contained in:
Andrew Kelley
2020-04-01 12:44:45 -04:00
parent 553f0e0546
commit 2e806682f4
18 changed files with 362 additions and 355 deletions

View File

@@ -45,7 +45,7 @@ pub async fn renderToLlvm(comp: *Compilation, fn_val: *Value.Fn, code: *ir.Code)
// Don't use ZIG_VERSION_STRING here. LLVM misparses it when it includes
// the git revision.
const producer = try std.Buffer.allocPrint(&code.arena.allocator, "zig {}.{}.{}", .{
const producer = try std.fmt.allocPrintZ(&code.arena.allocator, "zig {}.{}.{}", .{
@as(u32, c.ZIG_VERSION_MAJOR),
@as(u32, c.ZIG_VERSION_MINOR),
@as(u32, c.ZIG_VERSION_PATCH),
@@ -62,7 +62,7 @@ pub async fn renderToLlvm(comp: *Compilation, fn_val: *Value.Fn, code: *ir.Code)
dibuilder,
DW.LANG_C99,
compile_unit_file,
producer.span(),
producer,
is_optimized,
flags,
runtime_version,