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

Switch AddInst struct init style. #4012

Closed jonmeow closed 1 month ago

jonmeow commented 1 month ago

Trying to conform with #4009. Changes SemIR::LocIdAndInst construction to root out struct init cases with AddInst and related functions. I'm using templating of AddInst functions in order to avoid AddInst(loc_id, InstName{...}) and instead have AddInst<InstName>(loc_id, {...}) with I think similar readability results. There are a couple cases where inst construction is templated and so designated initializers couldn't be used, so this may be better for those in particular due to the extra type enforcement.

This probably doesn't clean up every last case, but I was trying to get the bulk at once without bleeding over into less related changes.