@@ -15,7 +15,7 @@ const TokenIndex = Tree.TokenIndex;
1515const NodeIndex = Tree .NodeIndex ;
1616const Type = @import ("Type.zig" );
1717const Diagnostics = @import ("Diagnostics.zig" );
18- const NodeList = std .ArrayList (NodeIndex );
18+ const NodeList = std .array_list . Managed (NodeIndex );
1919const InitList = @import ("InitList.zig" );
2020const Attribute = @import ("Attribute.zig" );
2121const char_info = @import ("char_info.zig" );
@@ -33,7 +33,7 @@ const target_util = @import("target.zig");
3333
3434const Switch = struct {
3535 default : ? TokenIndex = null ,
36- ranges : std .ArrayList (Range ),
36+ ranges : std .array_list . Managed (Range ),
3737 ty : Type ,
3838 comp : * Compilation ,
3939
@@ -101,16 +101,16 @@ value_map: Tree.ValueMap,
101101
102102// buffers used during compilation
103103syms : SymbolStack = .{},
104- strings : std .ArrayListAligned (u8 , .@"4" ),
105- labels : std .ArrayList (Label ),
104+ strings : std .array_list . AlignedManaged (u8 , .@"4" ),
105+ labels : std .array_list . Managed (Label ),
106106list_buf : NodeList ,
107107decl_buf : NodeList ,
108- param_buf : std .ArrayList (Type .Func .Param ),
109- enum_buf : std .ArrayList (Type .Enum .Field ),
110- record_buf : std .ArrayList (Type .Record .Field ),
108+ param_buf : std .array_list . Managed (Type .Func .Param ),
109+ enum_buf : std .array_list . Managed (Type .Enum .Field ),
110+ record_buf : std .array_list . Managed (Type .Record .Field ),
111111attr_buf : std .MultiArrayList (TentativeAttribute ) = .{},
112112attr_application_buf : std .ArrayListUnmanaged (Attribute ) = .empty ,
113- field_attr_buf : std .ArrayList ([]const Attribute ),
113+ field_attr_buf : std .array_list . Managed ([]const Attribute ),
114114/// type name -> variable name location for tentative definitions (top-level defs with thus-far-incomplete types)
115115/// e.g. `struct Foo bar;` where `struct Foo` is not defined yet.
116116/// The key is the StringId of `Foo` and the value is the TokenIndex of `bar`
@@ -693,16 +693,16 @@ pub fn parse(pp: *Preprocessor) Compilation.Error!Tree {
693693 .gpa = pp .comp .gpa ,
694694 .arena = arena .allocator (),
695695 .tok_ids = pp .tokens .items (.id ),
696- .strings = std .ArrayListAligned (u8 , .@"4" ).init (pp .comp .gpa ),
696+ .strings = std .array_list . AlignedManaged (u8 , .@"4" ).init (pp .comp .gpa ),
697697 .value_map = Tree .ValueMap .init (pp .comp .gpa ),
698698 .data = NodeList .init (pp .comp .gpa ),
699- .labels = std .ArrayList (Label ).init (pp .comp .gpa ),
699+ .labels = std .array_list . Managed (Label ).init (pp .comp .gpa ),
700700 .list_buf = NodeList .init (pp .comp .gpa ),
701701 .decl_buf = NodeList .init (pp .comp .gpa ),
702- .param_buf = std .ArrayList (Type .Func .Param ).init (pp .comp .gpa ),
703- .enum_buf = std .ArrayList (Type .Enum .Field ).init (pp .comp .gpa ),
704- .record_buf = std .ArrayList (Type .Record .Field ).init (pp .comp .gpa ),
705- .field_attr_buf = std .ArrayList ([]const Attribute ).init (pp .comp .gpa ),
702+ .param_buf = std .array_list . Managed (Type .Func .Param ).init (pp .comp .gpa ),
703+ .enum_buf = std .array_list . Managed (Type .Enum .Field ).init (pp .comp .gpa ),
704+ .record_buf = std .array_list . Managed (Type .Record .Field ).init (pp .comp .gpa ),
705+ .field_attr_buf = std .array_list . Managed ([]const Attribute ).init (pp .comp .gpa ),
706706 .string_ids = .{
707707 .declspec_id = try StrInt .intern (pp .comp , "__declspec" ),
708708 .main_id = try StrInt .intern (pp .comp , "main" ),
@@ -1222,7 +1222,7 @@ fn staticAssertMessage(p: *Parser, cond_node: NodeIndex, message: Result) !?[]co
12221222 const cond_tag = p .nodes .items (.tag )[@intFromEnum (cond_node )];
12231223 if (cond_tag != .builtin_types_compatible_p and message .node == .none ) return null ;
12241224
1225- var buf = std .ArrayList (u8 ).init (p .gpa );
1225+ var buf = std .array_list . Managed (u8 ).init (p .gpa );
12261226 defer buf .deinit ();
12271227
12281228 if (cond_tag == .builtin_types_compatible_p ) {
@@ -3994,7 +3994,7 @@ fn msvcAsmStmt(p: *Parser) Error!?NodeIndex {
39943994}
39953995
39963996/// asmOperand : ('[' IDENTIFIER ']')? asmStr '(' expr ')'
3997- fn asmOperand (p : * Parser , names : * std .ArrayList (? TokenIndex ), constraints : * NodeList , exprs : * NodeList ) Error ! void {
3997+ fn asmOperand (p : * Parser , names : * std .array_list . Managed (? TokenIndex ), constraints : * NodeList , exprs : * NodeList ) Error ! void {
39983998 if (p .eatToken (.l_bracket )) | l_bracket | {
39993999 const ident = (try p .eatIdentifier ()) orelse {
40004000 try p .err (.expected_identifier );
@@ -4044,7 +4044,7 @@ fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex
40444044 const allocator = stack_fallback .get ();
40454045
40464046 // TODO: Consider using a TokenIndex of 0 instead of null if we need to store the names in the tree
4047- var names = std .ArrayList (? TokenIndex ).initCapacity (allocator , expected_items ) catch unreachable ; // stack allocation already succeeded
4047+ var names = std .array_list . Managed (? TokenIndex ).initCapacity (allocator , expected_items ) catch unreachable ; // stack allocation already succeeded
40484048 defer names .deinit ();
40494049 var constraints = NodeList .initCapacity (allocator , expected_items ) catch unreachable ; // stack allocation already succeeded
40504050 defer constraints .deinit ();
@@ -4317,7 +4317,7 @@ fn stmt(p: *Parser) Error!NodeIndex {
43174317
43184318 const old_switch = p .@"switch" ;
43194319 var @"switch" = Switch {
4320- .ranges = std .ArrayList (Switch .Range ).init (p .gpa ),
4320+ .ranges = std .array_list . Managed (Switch .Range ).init (p .gpa ),
43214321 .ty = cond .ty ,
43224322 .comp = p .comp ,
43234323 };
@@ -8268,7 +8268,7 @@ fn charLiteral(p: *Parser) Error!Result {
82688268
82698269 const max_chars_expected = 4 ;
82708270 var stack_fallback = std .heap .stackFallback (max_chars_expected * @sizeOf (u32 ), p .comp .gpa );
8271- var chars = std .ArrayList (u32 ).initCapacity (stack_fallback .get (), max_chars_expected ) catch unreachable ; // stack allocation already succeeded
8271+ var chars = std .array_list . Managed (u32 ).initCapacity (stack_fallback .get (), max_chars_expected ) catch unreachable ; // stack allocation already succeeded
82728272 defer chars .deinit ();
82738273
82748274 while (char_literal_parser .next ()) | item | switch (item ) {
0 commit comments