mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Reduce explicit SemIR::LocIdAndInst construction (#5153)
Building on #5151 reducing `UncheckedLoc` use, further remove uses of the `SemIR::LocIdAndInst` constructor where we typically have overloads that don't need it. Add parallel convenience wrappers for placeholder insts. Also refactors `MergeReplacing`. I don't think it makes sense to add an overload for `ReplaceLocIdAndInstBeforeConstantUse`, but we can still reduce the `LocIdAndInst` construction there.
This commit is contained in:
@@ -55,8 +55,7 @@ static auto BuildInterfaceDecl(Context& context,
|
||||
auto interface_decl =
|
||||
SemIR::InterfaceDecl{SemIR::TypeType::SingletonTypeId,
|
||||
SemIR::InterfaceId::None, decl_block_id};
|
||||
auto interface_decl_id =
|
||||
AddPlaceholderInst(context, SemIR::LocIdAndInst(node_id, interface_decl));
|
||||
auto interface_decl_id = AddPlaceholderInst(context, node_id, interface_decl);
|
||||
|
||||
SemIR::Interface interface_info = {name_context.MakeEntityWithParamsBase(
|
||||
name, interface_decl_id, /*is_extern=*/false,
|
||||
|
||||
Reference in New Issue
Block a user