Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <cmplrs/rcodes.h>
#include <sys/resource.h>
#include <list>
#include "defs.h"
#include "erglob.h"
#include "erbe.h"
#include "config.h"
#include "tracing.h"
#include "strtab.h"
#include "stab.h"
#include "const.h"
#include "glob.h"
#include "mtypes.h"
#include "targ_const.h"
#include "targ_sim.h"
#include "ttype.h"
#include "irbdata.h"
#include "util.h"
#include "stblock.h"
#include "data_layout.h"
#include "wintrinsic.h"
#include "sections.h"
#include "betarget.h"
#include "intrn_info.h"
Go to the source code of this file.
#define DEFAULT_LARGE_OBJECT_BYTES 64 |
Definition at line 146 of file data_layout.cxx.
Referenced by Init_Frame_For_PU().
#define DEFAULT_STACK_ALIGNMENT _QUAD_ALIGN |
Definition at line 167 of file data_layout.cxx.
#define DEFAULT_TEMP_SPACE_BYTES 4096 |
Definition at line 148 of file data_layout.cxx.
Referenced by Initialize_Stack_Frame().
#define Has_No_Base_Block | ( | st | ) | (ST_base(st) == st) |
Definition at line 202 of file data_layout.cxx.
Referenced by Allocate_Entry_Formal(), and finalize_inito::operator()().
#define Is_Allocatable | ( | st | ) | (!Has_Base_Block(st) && !Is_root_base(st)) |
Definition at line 203 of file data_layout.cxx.
#define Is_Allocatable_Root_Block | ( | st | ) | (ST_class(st) == CLASS_BLOCK && !Is_root_base(st) && Has_No_Base_Block(st)) |
Definition at line 204 of file data_layout.cxx.
Referenced by Process_Stack_Variable(), and Shorten_Section().
#define IS_POW2 | ( | num | ) | ( (~((num)-1) & (num) ) == (num) ) |
Definition at line 235 of file data_layout.cxx.
Referenced by Allocate_Object_To_Section(), Assign_Object_To_Section(), and Configure_Target().
#define Is_root_base | ( | st | ) | (ST_class(st) == CLASS_BLOCK && STB_root_base(st)) |
Definition at line 201 of file data_layout.cxx.
Referenced by Is_Allocated().
#define MAX_FRAME_OFFSET |
(Current_PU_Stack_Model == SMODEL_SMALL ? \ Max_Small_Frame_Offset : MAX_LARGE_FRAME_OFFSET)
Definition at line 152 of file data_layout.cxx.
Referenced by Init_Frame_For_PU(), and Process_Stack_Variable().
#define MAX_LARGE_FRAME_OFFSET 0x7FFFFFFFFFFFFFFFLL |
Definition at line 151 of file data_layout.cxx.
Referenced by Choose_Stack_Model(), and Merge_Fixed_Stack_Frame().
#define MAX_SFSEG_BYTES 0x7FFFFFFFFFFFFFFFLL |
Definition at line 149 of file data_layout.cxx.
Referenced by Init_Segment_Descriptors().
#define MERGE_SEGMENT | ( | base, | |
seg, | |||
mxfrm | |||
) | ST_Block_Merge (base, SF_Block(seg), 0, 0, mxfrm) |
Definition at line 1645 of file data_layout.cxx.
Referenced by Finalize_Stack_Frame(), and Merge_Fixed_Stack_Frame().
Definition at line 234 of file data_layout.cxx.
Definition at line 233 of file data_layout.cxx.
Referenced by Add_Object_To_Frame_Segment(), Allocate_Space(), Assign_Offset(), Calc_Actual_Area(), Calculate_Stack_Frame_Sizes(), Finalize_Stack_Frame(), Init_Formal_Segments(), Init_Frame_For_PU(), and Initialize_Stack_Frame().
(SF_Block(s) ? \ STB_size(SF_Block(s)) : \ ((SF_Maxsize(s) == MAX_SFSEG_BYTES) ? 0 : SF_Maxsize(s) ) )
Definition at line 1570 of file data_layout.cxx.
Referenced by Finalize_Stack_Frame(), and Init_Frame_For_PU().
#define SF_Block | ( | n | ) | (SFSEG_block(SF_Seg_Desc(n))) |
Definition at line 182 of file data_layout.cxx.
Referenced by Add_Object_To_Frame_Segment(), Allocate_Object(), Assign_Object_To_Frame_Segment(), Bind_Stack_Frame(), Finalize_Stack_Frame(), Init_Segment_Descriptors(), Initialize_Frame_Segment(), Merge_Fixed_Stack_Frame(), Reset_UPFORMAL_Segment(), and Trace_Stack_Segments().
#define SF_Maxsize | ( | n | ) | (SFSEG_maxsize(SF_Seg_Desc(n))) |
Definition at line 183 of file data_layout.cxx.
Referenced by Add_Object_To_Frame_Segment(), Init_Formal_Segments(), Init_Frame_For_PU(), Init_Segment_Descriptors(), Merge_Fixed_Stack_Frame(), and Trace_Stack_Segments().
#define SF_Name | ( | n | ) | (SFSEG_name(SF_Seg_Desc(n))) |
Definition at line 184 of file data_layout.cxx.
Referenced by Add_Object_To_Frame_Segment(), Assign_Object_To_Frame_Segment(), Init_Segment_Descriptors(), Initialize_Frame_Segment(), and Trace_Stack_Segments().
#define SF_Seg_Desc | ( | n | ) | (&SF_Seg_Descriptors[n]) |
Definition at line 180 of file data_layout.cxx.
#define SFSEG_block | ( | s | ) | ((s)->block) |
Definition at line 134 of file data_layout.cxx.
#define SFSEG_FIRST SFSEG_ACTUAL |
Definition at line 123 of file data_layout.cxx.
Referenced by Trace_Stack_Segments().
#define SFSEG_LAST SFSEG_UPFORMAL |
Definition at line 124 of file data_layout.cxx.
Referenced by Init_Segment_Descriptors(), and Trace_Stack_Segments().
#define SFSEG_maxsize | ( | s | ) | ((s)->maxsize) |
Definition at line 135 of file data_layout.cxx.
#define SFSEG_name | ( | s | ) | ((s)->name) |
Definition at line 136 of file data_layout.cxx.
Definition at line 133 of file data_layout.cxx.
#define ST_force_gprel | ( | s | ) | ST_gprel(s) |
Definition at line 89 of file data_layout.cxx.
Referenced by Shorten_Section().
#define ST_NAME | ( | st | ) |
(ST_class(st) == CLASS_CONST ? \ Targ_Print(NULL,STC_val(st)) : ST_name(st) )
Definition at line 97 of file data_layout.cxx.
Referenced by Shorten_Section().
#define vararg_symbols ((ST * *)0) |
Definition at line 1303 of file data_layout.cxx.
Referenced by Allocate_All_Formals(), Clear_Vararg_Symbols(), and Get_Vararg_Symbol().
enum _align |
Definition at line 156 of file data_layout.cxx.
enum SF_SEGMENT |
Definition at line 110 of file data_layout.cxx.
static void Add_Object_To_Frame_Segment | ( | ST * | sym, |
SF_SEGMENT | seg, | ||
BOOL | allocate | ||
) | [static] |
Definition at line 688 of file data_layout.cxx.
References Formal_Save_Area_Size, fprintf(), INCREMENT, Initialize_Frame_Segment(), KIND_STRUCT, MTYPE_is_float, MTYPE_RegisterSize, ROUNDUP, Set_ST_base(), Set_STB_size(), SF_Block, SF_Maxsize, SF_Name, SFSEG_ACTUAL, SFSEG_FORMAL, SFSEG_UPFORMAL, size, Spill_Int_Mtype, ST_Block_Merge(), ST_name(), ST_sclass(), ST_size(), ST_type(), STB_size(), Target_Byte_Sex, TFile, Trace_Frame, TY_kind(), and TY_mtype().
Referenced by Allocate_Entry_Formal(), and Initialize_Stack_Frame().
static void Allocate_All_Formals | ( | WN * | pu | ) | [static] |
Definition at line 1331 of file data_layout.cxx.
References Allocate_Entry_Formal(), Copy_TY(), First_Int_Preg_Param_Offset, Formal_ST_type(), Formal_Sym(), Gen_Temp_Symbol(), Get_Current_PU(), Get_Input_Parameter_Location(), Get_Vararg_Input_Parameter_Location(), Init_ST_formal_info_for_PU(), Int_Preg, Is_Formal_Preg(), NULL, OPC_ALTENTRY, PLOC_is_nonempty, PLOC_offset, PLOC_on_stack, PLOC_reg, PU_has_altentry(), Reset_UPFORMAL_Segment(), SCLASS_FORMAL, Set_ST_addr_saved(), Set_ST_base(), Set_ST_is_value_parm(), Set_ST_ofst(), Set_ST_sclass(), Set_TY_no_ansi_alias(), Setup_Input_Parameter_Locations(), ST_pu_type(), ST_type(), TRUE, TY_is_varargs(), vararg_symbols, WN_first(), WN_formal, WN_func_body, WN_kid_count(), WN_next(), WN_num_formals, WN_opcode(), and WN_st().
Referenced by Initialize_Stack_Frame().
static void Allocate_Entry_Formal | ( | ST * | formal, |
BOOL | on_stack, | ||
BOOL | in_formal_reg | ||
) | [static] |
Definition at line 1234 of file data_layout.cxx.
References _SEC_BSS, Add_Object_To_Frame_Segment(), Adjusted_Alignment(), Allocate_Object_To_Section(), Clear_ST_is_value_parm(), Get_Current_PU(), Has_No_Base_Block, PU_has_altentry(), SCLASS_PSTATIC, Set_ST_sclass(), SFSEG_FORMAL, SFSEG_FTEMP, SFSEG_UPFORMAL, Shorten_Section(), ST_declared_static(), and TRUE.
Referenced by Allocate_All_Formals().
void Allocate_File_Statics | ( | void | ) |
Definition at line 2470 of file data_layout.cxx.
References Allocate_Object(), CLASS_CONST, CLASS_VAR, DevWarn(), Emit_Global_Data, For_all(), FOREACH_SYMBOL, Get_Trace(), GLOBAL_SYMTAB, Has_Base_Block(), SCLASS_COMMON, SCLASS_REG, Set_ST_base(), St_Attr_Table, ST_ATTR_Table_Size(), ST_class(), ST_export(), ST_index(), ST_is_fill_align(), ST_is_reshaped(), ST_name(), ST_name_idx(), ST_sclass(), ST_type(), TP_DATALAYOUT, Trace_Frame, and TY_size().
Referenced by Phase_Init().
static void Allocate_Label | ( | ST * | lab | ) | [static] |
Definition at line 2306 of file data_layout.cxx.
References _SEC_TEXT, Assign_Object_To_Section(), FmtAssert, SCLASS_TEXT, and ST_sclass().
static void Allocate_Local_Spill_Sym | ( | void | ) | [static] |
Definition at line 1741 of file data_layout.cxx.
References Allocate_Temp_To_Memory(), Current_PU_Stack_Model, Gen_Temp_Symbol(), Local_Spill_Sym, NULL, SMODEL_SMALL, and Spill_Int_Type.
Referenced by Calculate_Stack_Frame_Sizes().
void Allocate_Object | ( | ST * | st | ) |
Definition at line 2330 of file data_layout.cxx.
References _SEC_BSS, _SEC_CPLINIT, _SEC_DATA, _SEC_DISTR_ARRAY, _SEC_EH_REGION, _SEC_EH_REGION_SUPP, _SEC_LBSS, _SEC_LDATA, _SEC_RDATA, _SEC_TEXT, _SEC_THREAD_PRIVATE_FUNCS, Adjusted_Alignment(), Allocate_Object_To_Section(), Assign_Object_To_Section(), Assign_ST_To_Named_Section(), Base_Symbol(), Clear_ST_is_not_used(), DevWarn(), FALSE, File_info, FILE_INFO_ipa(), Find_Section_Name_For_ST(), Has_Base_Block(), Is_Allocated(), Is_True, Make_Align_Type(), name, NULL, Process_Stack_Variable(), SCLASS_AUTO, SCLASS_COMMON, SCLASS_CPLINIT, SCLASS_DGLOBAL, SCLASS_DISTR_ARRAY, SCLASS_EH_REGION, SCLASS_EH_REGION_SUPP, SCLASS_EXTERN, SCLASS_FORMAL, SCLASS_FORMAL_REF, SCLASS_FSTATIC, SCLASS_PSTATIC, SCLASS_REG, SCLASS_TEXT, SCLASS_THREAD_PRIVATE_FUNCS, SCLASS_UGLOBAL, SCLASS_UNKNOWN, Set_ST_gprel(), Set_ST_type(), SF_Block, SFSEG_FORMAL, Shorten_Section(), ST_has_named_section(), ST_init_value_zero(), ST_is_constant(), ST_is_initialized(), ST_is_not_used(), ST_is_thread_private(), ST_is_weak_symbol(), ST_sclass(), and ST_type().
Referenced by Allocate_File_Statics(), Fill_Align_Symbol(), Finalize_Stack_Frame(), finalize_inito::operator()(), and St_Block_Union().
static void Allocate_Object_To_Section | ( | ST * | st, |
SECTION_IDX | sec, | ||
UINT | align | ||
) | [static] |
Definition at line 2263 of file data_layout.cxx.
References block, Get_Section_ST(), IS_POW2, Is_True, SCLASS_UNKNOWN, SEC_max_sec_size, and ST_Block_Merge().
Referenced by Allocate_Entry_Formal(), and Allocate_Object().
Definition at line 572 of file data_layout.cxx.
References Adjusted_Alignment(), CLASS_CONST, Current_PU_Stack_Model, DevWarn(), Early_Terminate(), FP_Sym, fprintf(), Frame_Has_Calls, Is_Local_Symbol(), Is_True, MAX, Max_Small_Frame_Offset, NULL, RC_OVERFLOW_ERROR, ROUNDUP, Set_ST_ofst(), Set_STB_align(), Set_STB_size(), size, SMODEL_SMALL, SP_Sym, ST_class(), ST_name(), ST_ofst(), ST_size(), Stack_Offset_Adjustment, STB_align(), STB_decrement, STB_size(), STC_val(), Targ_Print(), TFile, and Trace_Frame.
Referenced by ST_Block_Merge().
void Allocate_Temp_To_Memory | ( | ST * | st | ) |
Definition at line 2111 of file data_layout.cxx.
References Is_True, Process_Stack_Variable(), SCLASS_AUTO, Set_ST_is_temp_var(), and ST_sclass().
Referenced by Allocate_Local_Spill_Sym().
static void Assign_Object_To_Frame_Segment | ( | ST * | sym, |
SF_SEGMENT | seg, | ||
INT64 | offset | ||
) | [static] |
Definition at line 666 of file data_layout.cxx.
References fprintf(), INCREMENT, Initialize_Frame_Segment(), Set_ST_base(), Set_ST_ofst(), SF_Block, SF_Name, ST_name(), ST_sclass(), TFile, and Trace_Frame.
Referenced by Get_Altentry_UpFormal_Symbol().
static void Assign_Object_To_Section | ( | ST * | st, |
SECTION_IDX | sec, | ||
UINT | align | ||
) | [static] |
Definition at line 2290 of file data_layout.cxx.
References block, fprintf(), Get_Section_ST(), IS_POW2, Is_True, Set_ST_base(), ST_name(), ST_sclass(), TFile, and Trace_Frame.
Referenced by Allocate_Label(), and Allocate_Object().
static void Assign_Offset | ( | ST * | blk, |
ST * | base, | ||
INT32 | lpad, | ||
INT32 | rpad | ||
) | [static] |
Definition at line 550 of file data_layout.cxx.
References Adjusted_Alignment(), ROUNDUP, Set_ST_ofst(), ST_ofst(), ST_size(), STB_decrement, and STB_size().
Referenced by Finalize_Stack_Frame().
static void Assign_ST_To_Named_Section | ( | ST * | st, |
STR_IDX | name | ||
) | [static] |
Definition at line 914 of file data_layout.cxx.
References _SEC_BSS, _SEC_DATA, _SEC_RDATA, _SEC_TEXT, CLASS_FUNC, CLASS_VAR, DevWarn(), FALSE, FmtAssert, Get_Section_ST_With_Given_Name(), INITV_Init_Pad(), New_INITO(), New_INITV(), SCLASS_DGLOBAL, SCLASS_EXTERN, SCLASS_FSTATIC, SCLASS_PSTATIC, SCLASS_UGLOBAL, SCLASS_UNKNOWN, SEC_max_sec_size, Set_INITO_val(), Set_ST_base(), Set_ST_is_initialized(), Set_ST_sclass(), ST_Block_Merge(), ST_class(), ST_is_constant(), ST_is_not_used(), ST_name(), ST_sclass(), ST_size(), and STB_section_idx().
Referenced by Allocate_Object(), and Assign_Section_Names::operator()().
static void Bind_Stack_Frame | ( | ST * | SP_baseST, |
ST * | FP_baseST | ||
) | [static] |
Definition at line 1624 of file data_layout.cxx.
References Current_PU_Stack_Model, FmtAssert, Get_Direction(), Set_Direction(), SF_Block, SFSEG_ACTUAL, SFSEG_FORMAL, SFSEG_FTEMP, SFSEG_UPFORMAL, SMODEL_DYNAMIC, SMODEL_LARGE, SMODEL_SMALL, and TRUE.
Referenced by Calculate_Stack_Frame_Sizes().
static INT32 Calc_Actual_Area | ( | TY_IDX | pu_type, |
WN * | pu_tree | ||
) | [static] |
Definition at line 1026 of file data_layout.cxx.
References FALSE, FmtAssert, Formal_Save_Area_Size, fprintf(), Get_Output_Parameter_Location(), MTYPE_align_best, MTYPE_CQ, MTYPE_id, MTYPE_RegisterSize, NULL, OPR_CALL, OPR_ICALL, OPR_INTRINSIC_CALL, OPR_INTRINSIC_OP, OPR_PICCALL, PLOC_total_size, ROUNDUP, Set_PU_arg_area_size(), Setup_Output_Parameter_Locations(), size, Spill_Int_Mtype, TFile, Trace_Frame, TRUE, TY_has_prototype(), TY_is_varargs(), TY_Of_Parameter(), TY_size(), WN_actual, WN_intrinsic(), WN_num_actuals(), WN_operator(), and WN_rtype().
Referenced by Check_Actual_Stack_Size(), and Max_Arg_Area_Bytes().
static void Calc_Formal_Area | ( | WN * | pu_tree, |
INT32 * | formal_size, | ||
INT32 * | upformal_size | ||
) | [static] |
Definition at line 1457 of file data_layout.cxx.
References FmtAssert, Formal_Save_Area_Size, Get_Current_PU(), Get_Input_Parameter_Location(), Get_PU_arg_area_size(), MAX, MIN, NULL, OPC_ALTENTRY, OPC_FUNC_ENTRY, PLOC_total_size, PU_has_altentry(), Set_PU_arg_area_size(), Setup_Input_Parameter_Locations(), ST_pu_type(), TY_is_varargs(), TY_Of_Parameter(), WN_first(), WN_formal, WN_func_body, WN_kid_count(), WN_next(), WN_num_formals, WN_opcode(), and WN_st().
Referenced by Initialize_Stack_Frame().
static INT64 Calc_Local_Area | ( | void | ) | [inline, static] |
Definition at line 1510 of file data_layout.cxx.
References Adjusted_Alignment(), RELATED_SEGMENTED_ARRAY< T, block_size >::begin(), CURRENT_SYMTAB, RELATED_SEGMENTED_ARRAY< T, block_size >::end(), fprintf(), Make_Align_Type(), SCLASS_AUTO, SCLASS_COMMON, SCLASS_DGLOBAL, Scope_tab, Set_ST_type(), ST_base_idx(), ST_name(), ST_sclass(), ST_size(), ST_st_idx(), SCOPE::st_tab, ST_type(), TFile, and Trace_Frame.
Referenced by Initialize_Stack_Frame().
void Calculate_Stack_Frame_Sizes | ( | WN * | PU_tree | ) |
Definition at line 1867 of file data_layout.cxx.
References Allocate_Local_Spill_Sym(), Bind_Stack_Frame(), Current_PU_Actual_Size, FP_Sym, fprintf(), Get_Current_PU_ST(), Init_Frame_For_PU(), MAX, Max_Arg_Area_Bytes(), Merge_Fixed_Stack_Frame(), MTYPE_byte_size, ROUNDUP, SP_Sym, Spill_Int_Mtype, ST_asm_function_st(), TFile, and Trace_Frame.
Referenced by Do_WOPT_and_CG_with_Regions().
void Check_Actual_Stack_Size | ( | WN * | call_tree | ) |
Definition at line 1104 of file data_layout.cxx.
References Calc_Actual_Area(), Current_PU_Actual_Size, FALSE, FmtAssert, OPR_CALL, OPR_ICALL, OPR_PICCALL, ST_pu_type(), WN_operator(), WN_st(), and WN_ty().
static STACK_MODEL Choose_Stack_Model | ( | INT64 | frame_size | ) | [static] |
Definition at line 1715 of file data_layout.cxx.
References FALSE, FmtAssert, Force_Large_Stack_Model, Get_Current_PU(), MAX_LARGE_FRAME_OFFSET, Max_Small_Frame_Offset, PU_has_alloca(), PU_has_nested(), SMODEL_DYNAMIC, SMODEL_LARGE, SMODEL_SMALL, and SMODEL_UNDEF.
Referenced by Initialize_Stack_Frame().
static void Clear_Vararg_Symbols | ( | void | ) | [static] |
Definition at line 1308 of file data_layout.cxx.
References MAX_NUMBER_OF_REGISTER_PARAMETERS, NULL, and vararg_symbols.
Referenced by Finalize_Stack_Frame().
static ST* Create_Base_Reg | ( | char * | name, |
STACK_DIR | dir | ||
) | [static] |
Definition at line 531 of file data_layout.cxx.
References Create_Local_Block(), Save_Str(), Set_STB_is_basereg, and Set_STB_root_base.
Referenced by Initialize_Stack_Frame().
static ST* Create_Global_Array_ST | ( | TYPE_ID | emtype, |
INT | num, | ||
char * | name | ||
) | [static] |
Definition at line 2582 of file data_layout.cxx.
References CLASS_VAR, EXPORT_LOCAL, Make_Array_Type(), New_ST(), Save_Str(), SCLASS_UGLOBAL, Set_ST_pt_to_unique_mem(), and ST_Init().
Referenced by pad_global_arrays::operator()().
static ST* Create_Local_Block | ( | STACK_DIR | dir, |
STR_IDX | name | ||
) | [static] |
Definition at line 522 of file data_layout.cxx.
References Enter_ST, FALSE, New_ST_Block(), SCLASS_UNKNOWN, Set_Direction(), and stack_align.
Referenced by Create_Base_Reg(), Init_Segment_Descriptors(), and Initialize_Frame_Segment().
void Early_Terminate | ( | INT | status | ) |
Definition at line 191 of file cleanup.cxx.
References Be_preg_tab, Be_scope_tab, BE_SCOPE::be_st_tab, RELATED_SEGMENTED_ARRAY< T, block_size >::Clear(), CURRENT_SYMTAB, GLOBAL_SYMTAB, NULL, SCOPE::preg_tab, Scope_tab, SCOPE::st_tab, Terminate(), and growing_table::Un_register().
Referenced by Allocate_Space(), and Finalize_Stack_Frame().
INT64 Finalize_Stack_Frame | ( | void | ) |
Definition at line 2008 of file data_layout.cxx.
References Allocate_Object(), Assign_Offset(), CLASS_VAR, Clear_Vararg_Symbols(), Current_PU_Stack_Model, CURRENT_SYMTAB, DevWarn(), Early_Terminate(), EC_LAY_stack_limit, ErrMsg(), FmtAssert, For_all(), FOREACH_SYMBOL, FP_Sym, fprintf(), Frame_Has_Calls, Get_Current_PU(), Inito_Table, MAX, Max_Small_Frame_Offset, MERGE_SEGMENT, PU_has_nested(), RC_OVERFLOW_ERROR, ROUNDUP, SEG_SIZE, Set_Error_Phase(), Set_ST_base(), SF_Block, SFSEG_FORMAL, SFSEG_UPFORMAL, SMODEL_DYNAMIC, SMODEL_LARGE, SMODEL_SMALL, SP_Sym, ST_class(), ST_has_nested_ref(), ST_is_not_used(), stack_align, Stack_Offset_Adjustment, STB_size(), TFile, Trace_Frame, Trace_Stack_Segments(), and TRUE.
STR_IDX Find_Section_Name_For_ST | ( | const ST * | st | ) |
Definition at line 997 of file data_layout.cxx.
References d, FmtAssert, For_all_until(), idx, ST_ATTR_section_name(), St_Attr_Table, ST_IDX_level(), ST_name(), and ST_st_idx().
Referenced by Allocate_Object().
ST* Find_Special_Return_Address_Symbol | ( | void | ) |
Definition at line 838 of file data_layout.cxx.
References CURRENT_SYMTAB, For_all_until(), NULL, ST_ptr(), and St_Table.
Referenced by Initialize_Stack_Frame().
static TY_IDX Formal_ST_type | ( | ST * | sym | ) | [static] |
Definition at line 1287 of file data_layout.cxx.
References Make_Pointer_Type(), SCLASS_FORMAL_REF, ST_sclass(), and ST_type().
Referenced by Allocate_All_Formals().
static ST* Formal_Sym | ( | ST * | sym, |
BOOL | onstack | ||
) | [static] |
Definition at line 434 of file data_layout.cxx.
References Clear_ST_promote_parm(), Copy_ST(), Create_Preg(), Debug_Level, FALSE, fprintf(), Get_Current_PU(), Get_ST_formal_preg_num(), Get_ST_formal_ref_base(), Is_Allocated(), Make_Pointer_Type(), PU_has_mp(), Save_Str2(), SCLASS_FORMAL, SCLASS_FORMAL_REF, Set_ST_formal_preg_num(), Set_ST_formal_ref_base(), Set_ST_name, Set_ST_sclass(), Set_ST_type(), ST_declared_static(), ST_has_nested_ref(), ST_name(), ST_sclass(), ST_type(), TFile, Trace_Frame, and TY_mtype().
Referenced by Allocate_All_Formals().
ST* Get_Altentry_UpFormal_Symbol | ( | ST * | formal, |
PLOC | ploc | ||
) |
Definition at line 1435 of file data_layout.cxx.
References Assign_Object_To_Frame_Segment(), Clear_ST_gprel(), Copy_ST(), Formal_Save_Area_Size, MTYPE_byte_size, PLOC_offset, Pointer_Mtype, PUSH_FRAME_POINTER_ON_STACK, PUSH_RETURN_ADDRESS_ON_STACK, Save_Str2(), SCLASS_FORMAL, Set_ST_name, Set_ST_sclass(), SFSEG_UPFORMAL, and ST_name().
static STACK_DIR Get_Direction | ( | ST * | blk | ) | [static] |
Definition at line 508 of file data_layout.cxx.
References DECREMENT, INCREMENT, and STB_decrement.
Referenced by Bind_Stack_Frame().
UINT32 Get_PU_arg_area_size | ( | TY_IDX | pu | ) |
Definition at line 803 of file data_layout.cxx.
References arg_area_size_array, Init_PU_arg_area_size_array(), Is_True, KIND_FUNCTION, max_arg_area_size_index, TY_id(), and TY_kind().
Referenced by Calc_Formal_Area().
static ST* Get_Section_ST | ( | SECTION_IDX | sec, |
UINT | align, | ||
ST_SCLASS | sclass | ||
) | [static] |
Definition at line 861 of file data_layout.cxx.
References Enter_ST, New_ST_Block(), NULL, Save_Str(), SEC_block, SEC_is_exec(), SEC_is_gprel(), SEC_is_merge(), SEC_is_nobits(), SEC_name, Set_ST_gprel(), Set_STB_exec, Set_STB_is_basereg, Set_STB_merge, Set_STB_nobits, Set_STB_root_base, Set_STB_section, Set_STB_section_idx(), and TRUE.
Referenced by Allocate_Object_To_Section(), Assign_Object_To_Section(), and Get_Section_ST_With_Given_Name().
static ST* Get_Section_ST_With_Given_Name | ( | SECTION_IDX | sec, |
ST_SCLASS | sclass, | ||
STR_IDX | name | ||
) | [static] |
Definition at line 889 of file data_layout.cxx.
References CLASS_BLOCK, Copy_ST_Block(), EC_LAY_section_name, ErrMsg(), FOREACH_SYMBOL, Get_Section_ST(), GLOBAL_SYMTAB, NULL, SEC_name, Set_ST_name_idx(), ST_class(), ST_name(), ST_name_idx(), STB_section, and STB_section_idx().
Referenced by Assign_ST_To_Named_Section().
PREG_NUM Get_ST_formal_preg_num | ( | const ST * | base | ) |
Definition at line 409 of file data_layout.cxx.
References formal_info_array, max_formal_info_index, NULL, and formal_info::preg.
Referenced by Formal_Sym(), and ST_has_formal_preg_num().
ST* Get_ST_formal_ref_base | ( | const ST * | sym | ) |
Definition at line 375 of file data_layout.cxx.
References formal_info::base, formal_info_array, max_formal_info_index, NULL, SCLASS_FORMAL_REF, and ST_sclass().
Referenced by Formal_Sym().
ST* Get_Vararg_Symbol | ( | PLOC | ploc | ) |
Definition at line 1318 of file data_layout.cxx.
References First_Int_Preg_Param_Offset, Is_True, MAX_NUMBER_OF_REGISTER_PARAMETERS, PLOC_reg, and vararg_symbols.
static void Init_Formal_Segments | ( | INT32 | formal_size, |
INT32 | upformal_size | ||
) | [static] |
Definition at line 1577 of file data_layout.cxx.
References ROUNDUP, SF_Maxsize, SFSEG_FORMAL, SFSEG_UPFORMAL, and stack_align.
Referenced by Initialize_Stack_Frame().
static void Init_Frame_For_PU | ( | INT32 | actual_size | ) | [static] |
Definition at line 1593 of file data_layout.cxx.
References DEFAULT_LARGE_OBJECT_BYTES, Large_Object_Bytes, MAX_FRAME_OFFSET, ROUNDUP, SEG_SIZE, SF_Maxsize, SFSEG_ACTUAL, SFSEG_FORMAL, SFSEG_FTEMP, and stack_align.
Referenced by Calculate_Stack_Frame_Sizes().
static void Init_PU_arg_area_size_array | ( | void | ) | [static] |
Definition at line 781 of file data_layout.cxx.
References arg_area_size_array, MAX, max_arg_area_size_index, MEM_src_pool, NULL, Src_Alloc, TY_Table_Size(), and TYPE_MEM_POOL_REALLOC_N.
Referenced by Get_PU_arg_area_size(), Initialize_Stack_Frame(), and Set_PU_arg_area_size().
static void Init_Segment_Descriptors | ( | void | ) | [static] |
Definition at line 1552 of file data_layout.cxx.
References Create_Local_Block(), INCREMENT, MAX_SFSEG_BYTES, s, Save_Str2(), Set_ST_is_not_used(), SF_Block, SF_Maxsize, SF_Name, SFSEG_FORMAL, SFSEG_LAST, and SFSEG_UNKNOWN.
Referenced by Initialize_Stack_Frame().
static void Init_ST_formal_info_for_PU | ( | INT | num_formals | ) | [static] |
Definition at line 331 of file data_layout.cxx.
References formal_info::base, CURRENT_SYMTAB, formal_info_array, Is_True, formal_info::level, MAX, max_formal_info_index, NULL, formal_info::preg, Realloc_ST_formal_info(), Src_Alloc, formal_info::sym, and SYMTAB_IDX_ZERO.
Referenced by Allocate_All_Formals().
static void Initialize_Frame_Segment | ( | SF_SEGMENT | seg, |
ST_SCLASS | sclass, | ||
STACK_DIR | dir | ||
) | [static] |
Definition at line 655 of file data_layout.cxx.
References Create_Local_Block(), NULL, Save_Str2(), Set_ST_sclass(), SF_Block, and SF_Name.
Referenced by Add_Object_To_Frame_Segment(), Assign_Object_To_Frame_Segment(), and Reset_UPFORMAL_Segment().
void Initialize_Stack_Frame | ( | WN * | PU_tree | ) |
Definition at line 1754 of file data_layout.cxx.
References Add_Object_To_Frame_Segment(), Allocate_All_Formals(), Calc_Formal_Area(), Calc_Local_Area(), Choose_Stack_Model(), CLASS_VAR, Create_Base_Reg(), Current_PU_Actual_Size, Current_PU_Stack_Model, DECREMENT, DEFAULT_TEMP_SPACE_BYTES, EXPORT_LOCAL, FALSE, Find_Special_Return_Address_Symbol(), FmtAssert, FP_Sym, fprintf(), Frame_Has_Calls, Get_Current_PU(), Get_Trace(), INCREMENT, Init_Formal_Segments(), Init_PU_arg_area_size_array(), Init_Segment_Descriptors(), Max_Arg_Area_Bytes(), MTYPE_byte_size, MTYPE_To_TY, New_ST(), OPC_FUNC_ENTRY, Pointer_Mtype, PU_has_return_address(), PUSH_FRAME_POINTER_ON_STACK, PUSH_RETURN_ADDRESS_ON_STACK, ROUNDUP, Save_Str(), SCLASS_AUTO, Set_Error_Phase(), Set_ST_base(), Set_ST_ofst(), SFSEG_UPFORMAL, SP_Sym, Spill_Int_Mtype, ST_asm_function_st(), ST_class(), ST_export(), ST_Init(), ST_name(), ST_sclass(), stack_direction, TFile, TP_DATALAYOUT, Trace_Frame, TRUE, WN_opcode(), and WN_st().
Referenced by Do_WOPT_and_CG_with_Regions().
BOOL Is_Allocated | ( | ST * | st | ) |
Definition at line 218 of file data_layout.cxx.
References Base_Symbol_And_Offset(), CLASS_BLOCK, Is_root_base, SCLASS_FORMAL, ST_class(), ST_sclass(), and TRUE.
Referenced by Allocate_Object(), and Formal_Sym().
static BOOL Is_String_Literal | ( | ST * | st | ) | [static] |
Definition at line 2127 of file data_layout.cxx.
References CLASS_CONST, CLASS_VAR, FALSE, KIND_ARRAY, MTYPE_STR, MTYPE_U1, ST_class(), ST_is_const_var(), ST_is_initialized(), ST_type(), STC_val(), TCON_ty, TRUE, TY_AR_etype(), TY_kind(), and TY_mtype().
Referenced by Shorten_Section().
static INT32 Max_Arg_Area_Bytes | ( | WN * | node | ) | [static] |
Definition at line 1136 of file data_layout.cxx.
References Calc_Actual_Area(), Frame_Has_Calls, MAX, MTYPE_RegisterSize, next, NULL, OPC_BLOCK, OPC_PRAGMA, OPC_XPRAGMA, OPCODE_is_leaf(), OPCODE_operator(), OPR_CALL, OPR_ICALL, OPR_INTRINSIC_CALL, OPR_INTRINSIC_OP, OPR_IO, OPR_PICCALL, Spill_Int_Mtype, ST_pu_type(), TRUE, wn, WN_first(), WN_kid(), WN_kid_count(), WN_next(), WN_opcode(), WN_pragma(), WN_PRAGMA_COPYIN, wn_size, WN_st(), and WN_ty().
Referenced by Calculate_Stack_Frame_Sizes(), and Initialize_Stack_Frame().
static void Merge_Fixed_Stack_Frame | ( | ST * | SP_baseST, |
ST * | FP_baseST | ||
) | [static] |
Definition at line 1658 of file data_layout.cxx.
References Current_PU_Stack_Model, FmtAssert, Get_Current_PU_ST(), MAX_LARGE_FRAME_OFFSET, Max_Small_Frame_Offset, MERGE_SEGMENT, NULL, Set_ST_base(), Set_ST_ofst(), Set_STB_size(), SF_Block, SF_Maxsize, SFSEG_ACTUAL, SFSEG_FORMAL, SFSEG_FTEMP, SFSEG_UPFORMAL, SMODEL_DYNAMIC, SMODEL_LARGE, SMODEL_SMALL, ST_pu_type(), Stack_Offset_Adjustment, STB_size(), TRUE, and TY_is_varargs().
Referenced by Calculate_Stack_Frame_Sizes().
void Pad_Global_Arrays | ( | ) |
Definition at line 2643 of file data_layout.cxx.
References For_all(), GLOBAL_SYMTAB, and St_Table.
Referenced by Phase_Init().
static void Process_Stack_Variable | ( | ST * | st | ) | [static] |
Definition at line 1909 of file data_layout.cxx.
References CLASS_BLOCK, Current_PU_Stack_Model, FP_Sym, Is_Allocatable_Root_Block, Is_True, Large_Object_Bytes, MAX_FRAME_OFFSET, SCLASS_AUTO, size, SMODEL_LARGE, SMODEL_SMALL, SP_Sym, ST_Block_Merge(), ST_class(), ST_sclass(), ST_type(), STB_size(), and TY_size().
Referenced by Allocate_Object(), and Allocate_Temp_To_Memory().
static void Realloc_ST_formal_info | ( | INT | min_needed | ) | [static] |
Definition at line 315 of file data_layout.cxx.
References formal_info_array, max_formal_info_index, MEM_src_pool, and TYPE_MEM_POOL_REALLOC_N.
Referenced by Init_ST_formal_info_for_PU(), and Set_ST_formal_ref_base().
void Reset_UPFORMAL_Segment | ( | void | ) |
Definition at line 1214 of file data_layout.cxx.
References block, INCREMENT, Initialize_Frame_Segment(), SCLASS_AUTO, Set_ST_ofst(), Set_STB_size(), SF_Block, and SFSEG_UPFORMAL.
Referenced by Allocate_All_Formals().
static void Set_Direction | ( | STACK_DIR | dir, |
ST * | blk | ||
) | [static] |
Definition at line 515 of file data_layout.cxx.
References DECREMENT, Reset_STB_decrement, and Set_STB_decrement.
Referenced by Bind_Stack_Frame(), and Create_Local_Block().
void Set_PU_arg_area_size | ( | TY_IDX | pu, |
UINT32 | size | ||
) |
Definition at line 816 of file data_layout.cxx.
References arg_area_size_array, Init_PU_arg_area_size_array(), Is_True, KIND_FUNCTION, max_arg_area_size_index, size, TY_id(), and TY_kind().
Referenced by Calc_Actual_Area(), and Calc_Formal_Area().
void Set_ST_formal_preg_num | ( | const ST * | base, |
PREG_NUM | p | ||
) |
Definition at line 422 of file data_layout.cxx.
References FALSE, formal_info_array, Is_True, max_formal_info_index, and formal_info::preg.
Referenced by Formal_Sym().
void Set_ST_formal_ref_base | ( | const ST * | sym, |
ST * | base | ||
) |
Definition at line 390 of file data_layout.cxx.
References formal_info::base, formal_info_array, formal_info::level, max_formal_info_index, NULL, Realloc_ST_formal_info(), ST_level(), and formal_info::sym.
Referenced by Formal_Sym().
static SECTION_IDX Shorten_Section | ( | ST * | st, |
SECTION_IDX | sec | ||
) | [static] |
Definition at line 2155 of file data_layout.cxx.
References _SEC_LIT16, _SEC_LIT4, _SEC_LIT8, _SEC_RDATA, Adjusted_Alignment(), CLASS_BLOCK, CLASS_CONST, CLASS_VAR, Corresponding_Short_Section(), fprintf(), Gen_PIC_Call_Shared, Gen_PIC_Shared, Gspace_Available, Is_Allocatable_Root_Block, Is_String_Literal(), MAX, Max_Sdata_Elt_Size, MTYPE_F4, MTYPE_F8, MTYPE_FQ, MTYPE_I4, MTYPE_I8, MTYPE_U4, MTYPE_U8, Set_ST_gprel(), size, ST_class(), ST_force_gprel, ST_gprel(), ST_is_preemptible(), ST_NAME, ST_not_gprel(), ST_size(), ST_type(), STC_val(), Strings_Not_Gprelative, TCON_ty, TFile, Trace_Frame, and TY_size().
Referenced by Allocate_Entry_Formal(), and Allocate_Object().
Definition at line 637 of file data_layout.cxx.
References Allocate_Space(), CLASS_BLOCK, Is_True, Set_ST_base(), Set_ST_is_initialized(), ST_base(), ST_class(), ST_is_initialized(), and STB_section.
Referenced by Add_Object_To_Frame_Segment(), Allocate_Object_To_Section(), Assign_ST_To_Named_Section(), and Process_Stack_Variable().
BOOL ST_on_stack | ( | ST * | sym | ) |
Definition at line 247 of file data_layout.cxx.
References Base_Symbol(), FALSE, FP_Sym, SCLASS_AUTO, SCLASS_FORMAL, SP_Sym, ST_sclass(), and TRUE.
BOOL ST_pu_defined | ( | ST * | sym | ) |
Definition at line 276 of file data_layout.cxx.
References CLASS_CONST, CLASS_VAR, FALSE, SCLASS_AUTO, SCLASS_DGLOBAL, SCLASS_FORMAL, SCLASS_FSTATIC, SCLASS_PSTATIC, ST_class(), ST_sclass(), and TRUE.
INT32 Stack_Alignment | ( | void | ) |
Definition at line 496 of file data_layout.cxx.
References stack_align.
Referenced by Adjusted_Alignment().
STACK_DIR Stack_Direction | ( | void | ) |
Definition at line 502 of file data_layout.cxx.
References stack_direction.
INT Stack_Offset_Adjustment_For_PU | ( | void | ) |
Definition at line 2650 of file data_layout.cxx.
References Frame_Has_Calls, and Stack_Offset_Adjustment.
static void Trace_Stack_Segments | ( | char * | msg, |
ST * | SP_baseST, | ||
ST * | FP_baseST | ||
) | [static] |
Definition at line 1934 of file data_layout.cxx.
References block, fprintf(), NULL, s, SF_Block, SF_Maxsize, SF_Name, SFSEG_FIRST, SFSEG_LAST, size, ST_base(), ST_name(), ST_ofst(), STB_align(), STB_size(), and TFile.
Referenced by Finalize_Stack_Frame().
BOOL Uses_Small_Offset | ( | ST * | st, |
WN_OFFSET | wn_ofst | ||
) |
Definition at line 2543 of file data_layout.cxx.
References CLASS_BLOCK, CLASS_CONST, CLASS_VAR, Current_PU_Stack_Model, FALSE, Large_Object_Bytes, SCLASS_AUTO, SCLASS_FORMAL, SMODEL_DYNAMIC, SMODEL_LARGE, SMODEL_SMALL, ST_class(), ST_gprel(), ST_sclass(), ST_size(), and TRUE.
UINT32* arg_area_size_array [static] |
Definition at line 776 of file data_layout.cxx.
Referenced by Get_PU_arg_area_size(), Init_PU_arg_area_size_array(), and Set_PU_arg_area_size().
Definition at line 94 of file data_layout.cxx.
Referenced by Calculate_Stack_Frame_Sizes(), Check_Actual_Stack_Size(), and Initialize_Stack_Frame().
Definition at line 95 of file data_layout.cxx.
Referenced by Allocate_Local_Spill_Sym(), Allocate_Space(), Bind_Stack_Frame(), Finalize_Stack_Frame(), Initialize_Stack_Frame(), Merge_Fixed_Stack_Frame(), Process_Stack_Variable(), and Uses_Small_Offset().
formal_info* formal_info_array [static] |
Definition at line 311 of file data_layout.cxx.
Referenced by Get_ST_formal_preg_num(), Get_ST_formal_ref_base(), Init_ST_formal_info_for_PU(), Realloc_ST_formal_info(), Set_ST_formal_preg_num(), and Set_ST_formal_ref_base().
Definition at line 92 of file data_layout.cxx.
Referenced by Allocate_Space(), Calculate_Stack_Frame_Sizes(), Finalize_Stack_Frame(), Initialize_Stack_Frame(), Process_Stack_Variable(), and ST_on_stack().
BOOL Frame_Has_Calls [static] |
Definition at line 100 of file data_layout.cxx.
Referenced by Allocate_Space(), Finalize_Stack_Frame(), Initialize_Stack_Frame(), Max_Arg_Area_Bytes(), and Stack_Offset_Adjustment_For_PU().
INT32 Large_Object_Bytes [static] |
Definition at line 190 of file data_layout.cxx.
Referenced by Init_Frame_For_PU(), Process_Stack_Variable(), and Uses_Small_Offset().
Definition at line 93 of file data_layout.cxx.
Referenced by Allocate_Local_Spill_Sym().
INT max_arg_area_size_index = 0 [static] |
Definition at line 777 of file data_layout.cxx.
Referenced by Get_PU_arg_area_size(), Init_PU_arg_area_size_array(), and Set_PU_arg_area_size().
INT max_formal_info_index = 0 [static] |
Definition at line 312 of file data_layout.cxx.
Referenced by Get_ST_formal_preg_num(), Get_ST_formal_ref_base(), Init_ST_formal_info_for_PU(), Realloc_ST_formal_info(), Set_ST_formal_preg_num(), and Set_ST_formal_ref_base().
SF_SEG_DESC SF_Seg_Descriptors[SFSEG_LAST+1] [static] |
{ { SFSEG_UNKNOWN, NULL, MAX_SFSEG_BYTES, "Unknown" }, { SFSEG_ACTUAL, NULL, MAX_SFSEG_BYTES, "Actual_Arg" }, { SFSEG_FTEMP, NULL, MAX_SFSEG_BYTES, "Fixed_Temp" }, { SFSEG_FORMAL, NULL, MAX_SFSEG_BYTES, "Formal_Arg" }, { SFSEG_UPFORMAL, NULL, MAX_SFSEG_BYTES, "UpFormal_Arg" } }
Definition at line 173 of file data_layout.cxx.
Definition at line 91 of file data_layout.cxx.
Referenced by Allocate_Space(), Calculate_Stack_Frame_Sizes(), Finalize_Stack_Frame(), Initialize_Stack_Frame(), Process_Stack_Variable(), and ST_on_stack().
INT16 stack_align = DEFAULT_STACK_ALIGNMENT [static] |
Definition at line 169 of file data_layout.cxx.
Referenced by Adjusted_Alignment(), Create_Local_Block(), Finalize_Stack_Frame(), Init_Formal_Segments(), Init_Frame_For_PU(), and Stack_Alignment().
STACK_DIR stack_direction [static] |
Definition at line 164 of file data_layout.cxx.
Referenced by Initialize_Stack_Frame(), and Stack_Direction().
BOOL Trace_Frame = FALSE [static] |
Definition at line 192 of file data_layout.cxx.
Referenced by Add_Object_To_Frame_Segment(), Allocate_File_Statics(), Allocate_Space(), Assign_Object_To_Frame_Segment(), Assign_Object_To_Section(), Calc_Actual_Area(), Calc_Local_Area(), Calculate_Stack_Frame_Sizes(), Finalize_Stack_Frame(), Formal_Sym(), Initialize_Stack_Frame(), and Shorten_Section().