Open iacore opened 10 months ago
I am not against to have MIR_get_global_item and MIR_get_module_item in API.
I don't like this MIR_get_global_item
. The function actually finds the first item with the name. The item may be visible only in one module (has no export clause).
The search is not efficient. I remember there is somewhere in loading/linking code more efficient way to find an external item. It would be a good starting point to implement MIR_get_global_item.
Also these two functions should be documented in MIR.md
I have updated the issue description.
What's the correct way to look for a function definition in textual MIR loaded with MIR_scan_string
?
I took the search code from https://github.com/vnmakarov/mir/blob/643bb0cdd12cd29029abb29ccf0edc5e94ba4103/c2mir/c2mir-driver.c#L786-L793
MIR_get_global_item
was inmir.h
but missing definition inmir.c
. This patch tries to add its definition.