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

Split global init out from InstBlockStack. #4101

Closed jonmeow closed 3 months ago

jonmeow commented 3 months ago

Creates a GlobalInit class for storing relevant values, pulling functions off InstBlockStack and Context. Adds a Context pointer just so that it doesn't need to be passed in on each call (Finalize in particular uses several members).

Note we have several different InstBlockStack instances, so several copies of the relevant members were simply unused.

jonmeow commented 3 months ago

This is pushed depending on #4100, and only the currently-last commit applies. I might merge it earlier if separately approved since the particular set of changes doesn't depend on the earlier work, it's only in my commit series due to the next step of modifying InstBlockStack for ArrayStack.