mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +01:00
Switch CalleeFunction to a variant (#6104)
Trying to make it easier to see what's intended to be present/correct on `CalleeFunction` in its various modes.
This commit is contained in:
@@ -570,25 +570,25 @@ class Stringifier {
|
||||
|
||||
auto StringifyInst(InstId /*inst_id*/, SpecificFunction inst) -> void {
|
||||
auto callee = GetCalleeFunction(*sem_ir_, inst.callee_id);
|
||||
if (callee.function_id.has_value()) {
|
||||
step_stack_->PushEntityName(sem_ir_->functions().Get(callee.function_id),
|
||||
if (auto* fn = std::get_if<CalleeFunction::Function>(&callee.info)) {
|
||||
step_stack_->PushEntityName(sem_ir_->functions().Get(fn->function_id),
|
||||
inst.specific_id);
|
||||
} else {
|
||||
step_stack_->PushString("<invalid specific function>");
|
||||
return;
|
||||
}
|
||||
step_stack_->PushString("<invalid specific function>");
|
||||
}
|
||||
|
||||
auto StringifyInst(InstId /*inst_id*/, SpecificImplFunction inst) -> void {
|
||||
auto callee = GetCalleeFunction(*sem_ir_, inst.callee_id);
|
||||
if (callee.function_id.has_value()) {
|
||||
if (auto* fn = std::get_if<CalleeFunction::Function>(&callee.info)) {
|
||||
// TODO: The specific_id here is for the interface member, but the
|
||||
// entity we're passing is the impl member. This might result in
|
||||
// strange output once we render specific arguments properly.
|
||||
step_stack_->PushEntityName(sem_ir_->functions().Get(callee.function_id),
|
||||
step_stack_->PushEntityName(sem_ir_->functions().Get(fn->function_id),
|
||||
inst.specific_id);
|
||||
} else {
|
||||
step_stack_->PushString("<invalid specific function>");
|
||||
return;
|
||||
}
|
||||
step_stack_->PushString("<invalid specific function>");
|
||||
}
|
||||
|
||||
auto StringifyInst(InstId /*inst_id*/, StructType inst) -> void {
|
||||
|
||||
Reference in New Issue
Block a user