mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:51:16 +01:00
Deduplicate getting the function in HandleInst() for Call (#5515)
Part of #5514.
This commit is contained in:
@@ -480,10 +480,10 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id,
|
||||
context.sem_ir(), inst.callee_id, context.specific_id());
|
||||
CARBON_CHECK(callee_function.function_id.has_value());
|
||||
|
||||
if (auto builtin_kind = context.sem_ir()
|
||||
.functions()
|
||||
.Get(callee_function.function_id)
|
||||
.builtin_function_kind;
|
||||
const SemIR::Function& function =
|
||||
context.sem_ir().functions().Get(callee_function.function_id);
|
||||
|
||||
if (auto builtin_kind = function.builtin_function_kind;
|
||||
builtin_kind != SemIR::BuiltinFunctionKind::None) {
|
||||
HandleBuiltinCall(context, inst_id, builtin_kind, arg_ids);
|
||||
return;
|
||||
@@ -508,8 +508,6 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id,
|
||||
}
|
||||
|
||||
llvm::CallInst* call;
|
||||
const auto& function =
|
||||
context.sem_ir().functions().Get(callee_function.function_id);
|
||||
if (function.virtual_index != -1) {
|
||||
CARBON_CHECK(!args.empty(),
|
||||
"Virtual functions must have at least one parameter");
|
||||
|
||||
Reference in New Issue
Block a user