core: Use AST var name for IR name
This commit is contained in:
parent
aaf7ea74b8
commit
be5775bbd5
|
@ -193,7 +193,12 @@ pub fn gen_assign<'ctx, 'a, G: CodeGenerator>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let ptr = generator.gen_store_target(ctx, target)?;
|
let ptr = if let ExprKind::Name { id, .. } = &target.node {
|
||||||
|
generator.gen_store_target_named(ctx, target, format!("{}.addr", id.to_string()).as_str())?
|
||||||
|
} else {
|
||||||
|
generator.gen_store_target(ctx, target)?
|
||||||
|
};
|
||||||
|
|
||||||
if let ExprKind::Name { id, .. } = &target.node {
|
if let ExprKind::Name { id, .. } = &target.node {
|
||||||
let (_, static_value, counter) = ctx.var_assignment.get_mut(id).unwrap();
|
let (_, static_value, counter) = ctx.var_assignment.get_mut(id).unwrap();
|
||||||
*counter += 1;
|
*counter += 1;
|
||||||
|
|
Loading…
Reference in New Issue