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

Factor out common work of building a new constant for an imported instruction. #4043

Closed zygoloid closed 3 weeks ago

zygoloid commented 3 weeks ago

In some cases this is just a refactoring; in others, we no longer import both an instruction in no block plus a constant instruction, resulting in creating fewer instructions. The non-constant version of the instruction always ended up unreferenced in the affected cases.

Following up on a comment in #4042.