mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 10:18:13 +00: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:
1 parent
a73e259620
commit
0f7df4ed7e
11 files changed
+210
-127
No files matched your search
@@ -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