carbon-language / carbon-lang

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
https://github.com/carbon-language/carbon-lang/blob/trunk/README.md
Other
32.31k stars 1.48k forks source link

Refactor modifier fetching of enclosing scopes to avoid duplicate calls. #4010

Closed jonmeow closed 1 month ago

jonmeow commented 1 month ago

Right now, each sequential modifier verification tends to re-fetch the enclosing scope, doing equivalent verification. Change code to more explicitly do the fetch once, sharing the result, also making the enclosing scope available to the caller for other work.

Note, the type store similarly carries an inst store pointer; that's what I'm basing having the name scope store's inst store pointer on.