MWCC/includes/compiler/StackFrame.h

61 lines
2.1 KiB
C
Raw Permalink Normal View History

2022-11-07 03:06:21 +00:00
#ifndef COMPILER_STACKFRAME_H
#define COMPILER_STACKFRAME_H
#include "compiler/common.h"
#ifdef __MWERKS__
#pragma options align=mac68k
#endif
2023-01-10 11:05:21 +00:00
typedef enum ObjClass {
2022-11-07 03:06:21 +00:00
ObjClass0,
ObjClass1,
ObjClass2,
ObjClassMax
2023-01-10 11:05:21 +00:00
} ObjClass;
2022-11-07 03:06:21 +00:00
extern Boolean requires_frame;
extern Boolean makes_call;
extern Boolean uses_globals;
extern Boolean dynamic_stack;
extern Boolean large_stack;
extern Object *dummyvaparam;
extern void *dummyprofiler;
extern void init_stack_globals(Object *funcobj);
extern void init_frame_sizes(Boolean has_varargs);
2022-11-07 03:06:21 +00:00
extern void assign_local_memory(Object *obj);
extern void assign_locals_to_memory(ObjectList *first);
extern void compute_frame_sizes(void);
extern void generate_prologue(PCodeBlock *block, Boolean has_varargs);
2022-11-07 03:06:21 +00:00
extern void generate_epilogue(PCodeBlock *block, Boolean add_blr);
2022-12-29 12:32:55 +00:00
extern void allocate_dynamic_stack_space(Boolean isConstantSize, int reg1, int reg2, SInt32 size);
2022-11-07 03:06:21 +00:00
extern char *generate_traceback(SInt32 funcsize, char *funcname, SInt32 *tbsize, Object *func);
extern void check_dynamic_aligned_frame(void);
extern void move_varargs_to_memory(void);
extern void assign_arguments_to_memory(Object *func, UInt8 mysteryFlag, Boolean hasVarargs);
extern SInt32 set_out_param_displ(SInt32 a, Type *type, Boolean flag, SInt32 *outvar, SInt32 b);
extern SInt32 out_param_displ_to_offset(SInt32 displ);
extern Boolean needs_frame(void);
extern void update_out_param_size(SInt32 size);
extern void estimate_out_param_size(SInt32 size);
extern void update_out_param_align(SInt32 align);
extern void update_in_param_align(SInt32 align);
extern void update_frame_align(SInt32 align);
extern SInt32 local_offset_32(Object *obj);
2022-12-29 12:32:55 +00:00
extern SInt32 local_offset_lo(Object *obj, SInt32 offset);
extern SInt32 local_offset_ha(Object *obj, SInt32 offset);
extern SInt32 local_offset_16(Object *obj);
2022-11-07 03:06:21 +00:00
extern Boolean local_is_16bit_offset(Object *obj);
extern int local_base_register(Object *obj);
extern Boolean is_large_frame(void);
extern void no_frame_for_asm(void);
extern Boolean can_add_displ_to_local(Object *obj, SInt32 displ);
extern SInt32 get_alloca_alignment(void);
#ifdef __MWERKS__
#pragma options align=reset
#endif
#endif