@@ -99,11 +99,11 @@ static auto TryMapBuiltinType(Context& context, SemIR::InstId inst_id,
99
99
}
100
100
}
101
101
102
- // Maps a Carbon record type to a Cpp type. Returns an empty `QualType` if
103
- // the Carbon type is not a `ClassType` or if the Cpp record type has not yet
104
- // been
105
- // TODO: Import the type if needed .
106
- static auto TryMapRecordType (Context& context, SemIR::TypeId type_id)
102
+ // Maps a Carbon class type to a C++ type. Returns a null `QualType` if the
103
+ // Carbon type is not a `ClassType` or was not imported from C++.
104
+ // TODO: If the class type wasn't imported from C++, create a corresponding C++
105
+ // class type.
106
+ static auto TryMapClassType (Context& context, SemIR::TypeId type_id)
107
107
-> clang::QualType {
108
108
auto class_type =
109
109
context.sem_ir ().types ().TryGetAs <SemIR::ClassType>(type_id);
@@ -120,16 +120,16 @@ static auto TryMapRecordType(Context& context, SemIR::TypeId type_id)
120
120
}
121
121
clang::Decl* clang_decl =
122
122
context.sem_ir ().clang_decls ().Get (clang_decl_id).decl ;
123
- auto * record_type_decl = clang::cast<clang::TagDecl>(clang_decl);
124
- return context.ast_context ().getCanonicalTagType (record_type_decl );
123
+ auto * tag_type_decl = clang::cast<clang::TagDecl>(clang_decl);
124
+ return context.ast_context ().getCanonicalTagType (tag_type_decl );
125
125
}
126
126
127
- // Maps a non-wrapper (no const or pointer) Carbon type to a Cpp type.
127
+ // Maps a non-wrapper (no const or pointer) Carbon type to a C++ type.
128
128
static auto MapNonWrapperType (Context& context, SemIR::InstId inst_id,
129
129
SemIR::TypeId type_id) -> clang::QualType {
130
130
clang::QualType mapped_type = TryMapBuiltinType (context, inst_id, type_id);
131
131
if (mapped_type.isNull ()) {
132
- mapped_type = TryMapRecordType (context, type_id);
132
+ mapped_type = TryMapClassType (context, type_id);
133
133
}
134
134
return mapped_type;
135
135
}
0 commit comments