mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Track the type as written in BaseDecl and AdaptDecl. (#4564)
Represent the type as an `InstId` rather than as a `TypeId` to preserve how it was written and better support tracking its value in a generic. Add accessors to `Class` to get the base and adapted type to reduce code duplication, and add `TypeStore::GetObjectRepr` to make it easier to map from a type to its possibly-adapted object representation type. In passing, also move `GetIntTypeInfo` and `GetUnqualifiedType` into `TypeStore`. This fixes specifics of generic adapters to properly look at the specific adapted type, and also fixes importing of adapters. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
e0db74a2a1
commit
d6ec885eb3
@@ -23,8 +23,8 @@ auto PerformPointerDereference(
|
||||
//
|
||||
// to convert to a pointer value.
|
||||
base_id = ConvertToValueExpr(context, base_id);
|
||||
auto type_id =
|
||||
context.GetUnqualifiedType(context.insts().Get(base_id).type_id());
|
||||
auto type_id = context.types().GetUnqualifiedType(
|
||||
context.insts().Get(base_id).type_id());
|
||||
auto result_type_id = SemIR::TypeId::Error;
|
||||
if (auto pointer_type =
|
||||
context.types().TryGetAs<SemIR::PointerType>(type_id)) {
|
||||
|
||||
Reference in New Issue
Block a user