mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-14 14:23:43 +00:00
Use direct parameter value in lb_find_ident when possible
This commit is contained in:
@@ -2590,6 +2590,15 @@ lbValue lb_find_or_add_entity_string_byte_slice_with_type(lbModule *m, String co
|
||||
|
||||
|
||||
lbValue lb_find_ident(lbProcedure *p, lbModule *m, Entity *e, Ast *expr) {
|
||||
if (e->flags & EntityFlag_Param) {
|
||||
// NOTE(bill): Bypass the stack copied variable for
|
||||
// direct parameters as there is no need for the direct load
|
||||
auto *found = map_get(&p->direct_parameters, e);
|
||||
if (found) {
|
||||
return *found;
|
||||
}
|
||||
}
|
||||
|
||||
auto *found = map_get(&m->values, e);
|
||||
if (found) {
|
||||
auto v = *found;
|
||||
|
||||
Reference in New Issue
Block a user