- Else check, if the node relates to an entity on the stack frame.
- If so, set the true offset (including the bias) for that
- node.
- */
- else {
- entity *ent = arch_get_frame_entity(aenv, irn);
- if(ent) {
- int offset = get_stack_entity_offset(env->frame, ent, bias);
- arch_set_frame_offset(aenv, irn, offset);
- DBG((env->dbg, LEVEL_2, "%F has offset %d\n", ent, offset));
+ If the node modifies the stack pointer by a constant offset,
+ record that in the bias.
+ */
+ if(arch_irn_is(arch_env, irn, modify_sp)) {
+ int ofs = arch_get_sp_bias(arch_env, irn);
+
+ if(be_is_IncSP(irn)) {
+ if(ofs == BE_STACK_FRAME_SIZE_EXPAND) {
+ ofs = get_type_size_bytes(get_irg_frame_type(env->birg->irg));
+ be_set_IncSP_offset(irn, ofs);
+ } else if(ofs == BE_STACK_FRAME_SIZE_SHRINK) {
+ ofs = - get_type_size_bytes(get_irg_frame_type(env->birg->irg));
+ be_set_IncSP_offset(irn, ofs);
+ }