mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 15:21:04 +01:00
Take specific into account in CalculateCppFieldOffsets (#7588)
Add a `SpecificID` arg to `Class::GetStructTypeFields`, and use that in `CalculateCppFieldOffsets`. Also include the specific in the `clang_decls` lookup. This has no immediate effect since no specific class fields are being exported yet, but will be useful for exporting generic classes.
This commit is contained in:
@@ -273,8 +273,8 @@ static auto CreateInvalidFieldDecl(Context& context,
|
||||
auto ExportAllFieldsToCpp(Context& context, SemIR::Class& class_info) -> void {
|
||||
const auto& class_scope = context.name_scopes().Get(class_info.scope_id);
|
||||
|
||||
for (const auto& struct_field :
|
||||
class_info.GetStructTypeFields(context.sem_ir())) {
|
||||
for (const auto& struct_field : class_info.GetStructTypeFields(
|
||||
context.sem_ir(), SemIR::SpecificId::None)) {
|
||||
auto class_field = LookupClassFieldByStructField(context.sem_ir(),
|
||||
class_scope, struct_field);
|
||||
if (!class_field) {
|
||||
|
||||
Reference in New Issue
Block a user