Continue: emit function definitions for specifics. (#5068)

Resolve instruction id depending on the context from which a function is
called.

Calling a function in a function context that does not have a definition
emitted before reaching lowering will cause a crash. This needs a change
in check/eval layer.
This commit is contained in:
Alina Sbirlea
2025-03-06 17:40:35 +00:00
committed by GitHub
parent 156ab889f8
commit d3869a529b
8 changed files with 546 additions and 68 deletions
+2
View File
@@ -21,6 +21,8 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id,
if (specific_id.has_value()) {
callee_id = sem_ir.constant_values().GetInstIdIfValid(
GetConstantValueInSpecific(sem_ir, specific_id, callee_id));
CARBON_CHECK(callee_id.has_value(),
"Invalid callee id in a specific context");
}
if (auto specific_function =