mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 21:51:12 +01:00
Skip upfront emission of vtables for generic classes (#5349)
These will need to be emitted lazily, as we do for functions - this addresses the crash/removes the impossible (because we don't have a specific) non-lazy path.
This commit is contained in:
@@ -732,6 +732,12 @@ auto FileContext::BuildVtable(const SemIR::Class& class_info)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Vtables can't be generated for generics, only for their specifics - and
|
||||
// must be done lazily based on the use of those specifics.
|
||||
if (class_info.generic_id != SemIR::GenericId::None) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Mangler m(*this);
|
||||
std::string mangled_name = m.MangleVTable(class_info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user