mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Support for initialization of classes with abstract base classes. (#6802)
When initializing `.base` in class initialization, use `partial Base` as the destination type rather than `Base`. Treat `partial Base` as not being abstract even when `Base` is. Allow conversion from a `partial T` initializer to a `T` initializer. Store the vptr while performing the conversion. Do not store the vptr when performing a `partial T` initialization, only when performing a non-partial `T` initialization.
This commit is contained in:
@@ -350,6 +350,18 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id,
|
||||
inst_id, context.builder().CreateNot(context.GetValue(inst.operand_id)));
|
||||
}
|
||||
|
||||
auto HandleInst(FunctionContext& context, SemIR::InstId inst_id,
|
||||
SemIR::UpdateInit inst) -> void {
|
||||
// Ensure that our subordinate initializations have been performed. They may
|
||||
// have been skipped if they were constant.
|
||||
context.InitializeStorage(inst.base_init_id);
|
||||
context.InitializeStorage(inst.update_init_id);
|
||||
|
||||
// TODO: Add a helper to poison a value slot.
|
||||
context.SetLocal(inst_id,
|
||||
llvm::PoisonValue::get(context.GetTypeOfInst(inst_id)));
|
||||
}
|
||||
|
||||
auto HandleInst(FunctionContext& context, SemIR::InstId inst_id,
|
||||
SemIR::VarStorage /* inst */) -> void {
|
||||
context.SetLocal(inst_id,
|
||||
|
||||
Reference in New Issue
Block a user