carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
http://docs.carbon-lang.dev/
Other
32.25k stars 1.48k forks source link

Refactor InstBlockStack to use ArrayStack. #4104

Closed jonmeow closed 3 months ago

jonmeow commented 3 months ago

The use of ArrayStack here is intended to simplify the logic, and also make better use of the inst heap allocations. Prior changes #4101 and #4103 removed the less related logic from InstBlockStack, although #4103 is the actual part that blocked using ArrayStack.

BTW, note the PrintForStackDump implementation was incorrect because it didn't apply size_. This simplification fixes the issue.

jonmeow commented 3 months ago

Depends on #4103

jonmeow commented 3 months ago

Also added some tests for ArrayStack functions while I was in there.