Repository: carbon-language/carbon-lang
File: toolchain/check/context.h (C/C++)

Code before:
  }
  auto facet_types() -> SemIR::FacetTypeInfoStore& {
    return sem_ir().facet_types();
  }
  auto identified_facet_types() -> SemIR::File::IdentifiedFacetTypeStore& {
    return sem_ir().identified_facet_types();
  }
  auto impls() -> SemIR::ImplStore& { return sem_ir().impls(); }
  auto specific_interfaces() -> SemIR::SpecificInterfaceStore& {
    return sem_ir().specific_interfaces();
  }
  auto generics() -> SemIR::GenericStore& { return sem_ir().generics(); }
  auto specifics() -> SemIR::SpecificStore& { return sem_ir().specifics(); }
  auto import_irs() -> SemIR::ImportIRStore& { return sem_ir().import_irs(); }
  auto import_ir_insts() -> SemIR::ImportIRInstStore& {
    return sem_ir().import_ir_insts();
  }
  auto ast_context() -> clang::ASTContext& {
    return sem_ir().clang_ast_unit()->getASTContext();
  }
  auto clang_decls() -> SemIR::ClangDeclStore& {
    return sem_ir().clang_decls();
  }
  auto clang_decls() const -> const SemIR::ClangDeclStore& {
    return sem_ir().clang_decls();
  }
  auto names() -> SemIR::NameStoreWrapper { return sem_ir().names(); }
  auto name_scopes() -> SemIR::NameScopeStore& {
    return sem_ir().name_scopes();
  }
  auto struct_type_fields() -> SemIR::StructTypeFieldsStore& {
    return sem_ir().struct_type_fields();
  }
  auto custom_layouts() -> SemIR::CustomLayoutStore& {
    return sem_ir().custom_layouts();
  }
  auto types() -> SemIR::TypeStore& { return sem_ir().types(); }
  // Instructions should be added with `AddInst` or `AddInstInNoBlock` from
  // `inst.h`. This is `const` to prevent accidental misuse.
  auto insts() -> const SemIR::InstStore& { return sem_ir().insts(); }
  auto constant_values() -> SemIR::ConstantValueStore& {
    return sem_ir().constant_values();
  }
  auto inst_blocks() -> SemIR::InstBlockStore& {
    return sem_ir().inst_blocks();
  }
  auto constants() -> SemIR::ConstantStore& { return sem_ir().constants(); }

  // --------------------------------------------------------------------------
  // End of SemIR::File members.
  // --------------------------------------------------------------------------

Review comment (suggestion):
I don't think we need this overload here (see eg the rest of the methods on Context). We always work with a mutable `Context&`, unlike for SemIR::File.

Code after:
  }
  auto facet_types() -> SemIR::FacetTypeInfoStore& {
    return sem_ir().facet_types();
  }
  auto identified_facet_types() -> SemIR::File::IdentifiedFacetTypeStore& {
    return sem_ir().identified_facet_types();
  }
  auto impls() -> SemIR::ImplStore& { return sem_ir().impls(); }
  auto specific_interfaces() -> SemIR::SpecificInterfaceStore& {
    return sem_ir().specific_interfaces();
  }
  auto generics() -> SemIR::GenericStore& { return sem_ir().generics(); }
  auto specifics() -> SemIR::SpecificStore& { return sem_ir().specifics(); }
  auto import_irs() -> SemIR::ImportIRStore& { return sem_ir().import_irs(); }
  auto import_ir_insts() -> SemIR::ImportIRInstStore& {
    return sem_ir().import_ir_insts();
  }
  auto ast_context() -> clang::ASTContext& {
    return sem_ir().clang_ast_unit()->getASTContext();
  }
  auto clang_decls() -> SemIR::ClangDeclStore& {
    return sem_ir().clang_decls();
  }
  auto names() -> SemIR::NameStoreWrapper { return sem_ir().names(); }
  auto name_scopes() -> SemIR::NameScopeStore& {
    return sem_ir().name_scopes();
  }
  auto struct_type_fields() -> SemIR::StructTypeFieldsStore& {
    return sem_ir().struct_type_fields();
  }
  auto custom_layouts() -> SemIR::CustomLayoutStore& {
    return sem_ir().custom_layouts();
  }
  auto types() -> SemIR::TypeStore& { return sem_ir().types(); }
  // Instructions should be added with `AddInst` or `AddInstInNoBlock` from
  // `inst.h`. This is `const` to prevent accidental misuse.
  auto insts() -> const SemIR::InstStore& { return sem_ir().insts(); }
  auto constant_values() -> SemIR::ConstantValueStore& {
    return sem_ir().constant_values();
  }
  auto inst_blocks() -> SemIR::InstBlockStore& {
    return sem_ir().inst_blocks();
  }
  auto constants() -> SemIR::ConstantStore& { return sem_ir().constants(); }

  // --------------------------------------------------------------------------
  // End of SemIR::File members.
  // --------------------------------------------------------------------------

 private:
  // Handles diagnostics.