mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 19:11:09 +01:00
Refactor InstBlockStore's API, AddDefaultValue -> AddPlaceholder (#5166)
`AddDefaultValue` doesn't quite capture the intended semantics; it should typically be replaced with an actual value when dealing with control flows. Trying to indicate the "assign later" with `AddPlaceholder`, mirroring `AddPlaceholderInst`. Shifting the `protected` functionality on `BlockValueStore` so that it's not providing functions just for `InstBlockStore` to use. Also hoping that seeing the comments next to the function name makes them easier to understand, whereas `using` buries that a little. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
6dbcc78e6c
commit
c0ee446cec
@@ -20,7 +20,7 @@ auto EndSubpatternAsExpr(Context& context, SemIR::InstId result_id)
|
||||
// will be determined later.
|
||||
AddInst(context,
|
||||
SemIR::LocIdAndInst::NoLoc<SemIR::Branch>(
|
||||
{.target_id = context.inst_blocks().AddDefaultValue()}));
|
||||
{.target_id = context.inst_blocks().AddPlaceholder()}));
|
||||
} else {
|
||||
// This single-block region will be inserted as a SpliceBlock, so we don't
|
||||
// need control flow out of it.
|
||||
|
||||
Reference in New Issue
Block a user