Refactor the node stack into its own class. (#2505)

Currently, there's a mix of accessing node_stack_ both directly and indirectly, and there are already several Push/Pop methods to help wrap the behavior. However, there's also direct access because of shifting over time, as well as variations in _how_ the stack is used.

This migrates to a separate class in order to make a more specific contract for the API. It cleans up existing uses and adds APIs where needed.
This commit is contained in:
Jon Ross-Perkins
2023-01-05 15:16:05 -08:00
committed by GitHub
parent 78ac6cb7d1
commit 2a163ca6cd
8 changed files with 419 additions and 228 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
// RUN: %{carbon} -v dump semantics-ir %s | %{FileCheck-allow-unmatched}
//
// Only checks a couple statements in order to minimize manual update churn.
// CHECK:STDERR: Push 0: FunctionIntroducer
// CHECK:STDERR: Push 0: FunctionIntroducer -> node<invalid>
// CHECK:STDERR: AddNode block0: BindName(str0, node{{[0-9]+}})
fn Foo() {