Clean up Context API (#4969)

- Add a better class comment.
- Remove the obsolete `type_ids_for_type_constants_` and `TypeNode`.
- For `bind_name_map`, fix declaration order and move comment to be
consistent with other members.
- Reorder accessors to better match order of data members.
  - This is how I noticed `type_ids_for_type_constants_`
- Put a bigger notice so that `sem_ir` helper functions don't end up in
the middle of other members again.
This commit is contained in:
Jon Ross-Perkins
2025-02-15 01:18:54 +00:00
committed by GitHub
parent 38d25cf622
commit e3764ff6f3
2 changed files with 59 additions and 73 deletions
-9
View File
@@ -62,15 +62,6 @@ Context::Context(DiagnosticEmitter* emitter,
import_ir_constant_values_.reserve(imported_ir_count);
check_ir_map_.resize(total_ir_count, SemIR::ImportIRId::None);
// Map the builtin `<error>` and `type` type constants to their corresponding
// special `TypeId` values.
type_ids_for_type_constants_.Insert(
SemIR::ConstantId::ForConcreteConstant(SemIR::ErrorInst::SingletonInstId),
SemIR::ErrorInst::SingletonTypeId);
type_ids_for_type_constants_.Insert(
SemIR::ConstantId::ForConcreteConstant(SemIR::TypeType::SingletonInstId),
SemIR::TypeType::SingletonTypeId);
// TODO: Remove this and add a `VerifyOnFinish` once we properly push and pop
// in the right places.
generic_region_stack().Push();