#include <stdint.h>#include "defs.h"#include "symtab.h"#include "ipc_symtab_merge.h"#include "ipc_ty_hash.h"#include "ipc_type_merge.h"#include "config_ipa.h"#include <ext/hash_set>#include <ext/hash_map>

Go to the source code of this file.
| #define __STDC_LIMIT_MACROS |
Definition at line 40 of file ipc_type_merge.cxx.
| enum VALIDATION_STATE |
Definition at line 214 of file ipc_type_merge.cxx.
| static BOOL ARB_equal | ( | const ARB_HANDLE | merged_arb, | |
| const ARB & | new_arb | |||
| ) | [inline, static] |
Definition at line 81 of file ipc_type_merge.cxx.
References ARB_HANDLE::Entry(), p1, p2, and UINT64.
| static void Clear_All_Temp_Idx | ( | TY_INDEX | index, | |
| TY_IDX_MAP & | ty_map | |||
| ) | [static] |
Definition at line 500 of file ipc_type_merge.cxx.
References Clear_Temp_Idx_Specific(), Clear_TY_Temp_Idx(), Is_TY_Temp_Idx(), KIND_ARRAY, KIND_FUNCTION, KIND_POINTER, KIND_SCALAR, KIND_STRUCT, KIND_VOID, TY_IDX_MAP::map_, TY_kind, and IPC_GLOBAL_TABS::ty_tab.
Referenced by Clear_Temp_Idx_Specific(), and Find_Recursive_Type().
| void @3072::Clear_Temp_Idx_Specific | ( | const TY & | new_ty, | |
| TY_IDX_MAP & | ty_map, | |||
| const ACCESS & | ty_node | |||
| ) | [inline, static] |
Definition at line 484 of file ipc_type_merge.cxx.
References Clear_All_Temp_Idx(), i, Is_TY_Temp_Idx(), TY_IDX_MAP::map_, TY_IDX_index(), and UINT.
Referenced by Clear_All_Temp_Idx().
| static void Commit_Recursive_Type | ( | TY_INDEX | index, | |
| TY_IDX_MAP & | ty_map, | |||
| TY_IDX | merged_ty_idx | |||
| ) | [static] |
Definition at line 609 of file ipc_type_merge.cxx.
References Commit_Ty_Specific(), IN_SET, IPA_Enable_Old_Type_Merge, Is_True, KIND_ARRAY, KIND_FUNCTION, KIND_POINTER, KIND_SCALAR, KIND_STRUCT, KIND_VOID, TY_IDX_MAP::map_, MTYPE_M, New_TY(), TY_IDX_MAP::set_map(), to_update_incomplete_ty, TY_IDX_index(), TY_Init(), TY_is_incomplete_struct(), TY_kind, IPC_GLOBAL_TABS::ty_tab, Ty_Table, updating_incomplete_ty, and Valid_TY_IDX().
Referenced by Commit_Ty_Specific(), and Insert_Ty_Specific().
| void @3072::Commit_Ty_Specific | ( | const TY & | new_ty, | |
| TY_IDX_MAP & | ty_map, | |||
| TY_IDX | merged_ty_idx, | |||
| const ACCESS & | ty_node | |||
| ) | [inline, static] |
Definition at line 588 of file ipc_type_merge.cxx.
References Commit_Recursive_Type(), i, Is_True, TY_IDX_MAP::map_, TY_IDX_index(), TY_kind, Ty_Table, UINT, and Valid_TY_IDX().
Referenced by Commit_Recursive_Type().
| static TY_IDX Find_Recursive_Type | ( | TY_INDEX | index, | |
| TY_IDX_MAP & | ty_map, | |||
| const SYMSTR_IDX_MAP & | str_map, | |||
| const TY & | ty | |||
| ) | [static] |
Definition at line 541 of file ipc_type_merge.cxx.
References Clear_All_Temp_Idx(), Find_Matching_Ty(), IPA_Enable_Old_Type_Merge, Is_True, iter, KIND_STRUCT, make_TY_IDX(), struct_by_name_idx, TY_is_incomplete_struct(), TY_kind, TY_name_idx(), VALIDATE_COMMIT, VALIDATE_OK, and Validate_Recursive_Type().
Referenced by Insert_Ty_Specific().
| static TY_IDX Insert_Ty | ( | TY_INDEX | index, | |
| TY_IDX_MAP & | ty_map, | |||
| const SYMSTR_IDX_MAP & | str_map | |||
| ) | [static] |
Definition at line 767 of file ipc_type_merge.cxx.
References Fail_FmtAssertion(), IN_SET, Insert_Ty_Specific(), Insert_Unique_Ty(), IPA_Enable_Old_Type_Merge, Is_True, KIND_ARRAY, KIND_FUNCTION, KIND_POINTER, KIND_SCALAR, KIND_STRUCT, KIND_VOID, make_TY_IDX(), TY_IDX_MAP::map_, MTYPE_M, TY::name_idx, New_TY(), TY_IDX_MAP::set_map(), Set_TY_align, Set_TY_Merging(), struct_by_name_idx, to_update_incomplete_ty, TY_align, TY_IDX_index(), TY_Init(), TY_is_incomplete_struct(), TY_kind, TY_name_idx(), TY_pointed, IPC_GLOBAL_TABS::ty_tab, Ty_Table, and updating_incomplete_ty.
Referenced by Insert_Ty_Specific(), and Merge_All_Types().
| TY_IDX @3072::Insert_Ty_Specific | ( | TY_INDEX | index, | |
| TY_IDX_MAP & | ty_map, | |||
| const SYMSTR_IDX_MAP & | str_map, | |||
| const ACCESS & | ty_node | |||
| ) | [inline, static] |
Definition at line 671 of file ipc_type_merge.cxx.
References BOOL, Clean_TY_IDX(), Commit_Recursive_Type(), FALSE, Finalize_New_Recursive_Type(), Find_Recursive_Type(), i, Initialize_New_Recursive_Type(), Insert_Allocated_Ty(), Insert_Ty(), Insert_Unique_Ty(), IPA_Enable_Old_Type_Merge, Is_True, Is_TY_Temp_Idx(), TY_IDX_MAP::map_, New_TY(), Replace_TY_IDX_index(), Set_TY_Inserted(), TY_IDX_index(), TY_Inserted(), TY_is_incomplete_struct(), TY_Merging(), IPC_GLOBAL_TABS::ty_tab, Ty_Table, UINT, updating_incomplete_ty, Valid_TY_IDX(), and void.
Referenced by Insert_Ty().
Definition at line 865 of file ipc_type_merge.cxx.
References BOOL, complete_nonrecursive_type, FALSE, FLD_last_field(), FLD_type, IN_SET, KIND_ARRAY, KIND_FUNCTION, KIND_POINTER, KIND_STRUCT, Make_fld_iter(), make_TY_IDX(), Make_tylist_iter(), processing_recursive_type, result, TRUE, TY_etype, TY_fld, TY_IDX_index(), TY_is_incomplete_struct(), TY_kind, TY_pointed, Ty_tab, and TY_tylist().
Referenced by Merge_All_Types().
| void Merge_All_Types | ( | const IPC_GLOBAL_TABS & | original_tabs, | |
| IPC_GLOBAL_IDX_MAP & | idx_map | |||
| ) |
Definition at line 921 of file ipc_type_merge.cxx.
References idx, Insert_Allocated_Ty(), Insert_Recursive_Type(), Insert_Ty(), IPA_Enable_Old_Type_Merge, Is_Incomplete_Or_Recursive(), Is_True, iter, TY_IDX_MAP::map_, TY_IDX_MAP::set_map(), Setup_Type_Merging_Hash_Tables(), str_map, IPC_GLOBAL_IDX_MAP::sym_str, to_update_incomplete_ty, IPC_GLOBAL_IDX_MAP::ty, TY_IDX_index(), TY_is_incomplete_struct(), ty_map, IPC_GLOBAL_TABS::ty_tab, IPC_GLOBAL_TABS::ty_tab_size, Ty_Table, UINT, updating_incomplete_ty, Valid_TY_IDX(), and void.
Referenced by IPC_merge_global_tab().
| VALIDATION_STATE @3072::New_Partial_Match | ( | const TY & | merged_ty, | |
| const TY & | new_ty, | |||
| TY_IDX_MAP & | ty_map, | |||
| const SYMSTR_IDX_MAP & | str_map, | |||
| const ACCESS & | ty_node | |||
| ) | [inline, static] |
Definition at line 320 of file ipc_type_merge.cxx.
References BOOL, Clean_TY_IDX(), FALSE, i, Is_True, Is_TY_Temp_Idx(), KIND_ARRAY, KIND_STRUCT, TY_IDX_MAP::map_, TRUE, TY_anonymous, TY_flags, TY_IDX_Attributes(), TY_IDX_index(), TY_Inserted(), TY_is_incomplete(), TY_is_incomplete_struct(), TY_kind, TY_mtype, TY_name_idx(), TY_size, UINT, Valid_TY_IDX(), VALIDATE_COMMIT, VALIDATE_FAIL, VALIDATE_OK, and Validate_Recursive_Type().
Referenced by Validate_Recursive_Type().
| VALIDATION_STATE @3072::Partial_Match | ( | const TY & | merged_ty, | |
| const TY & | new_ty, | |||
| TY_IDX_MAP & | ty_map, | |||
| const SYMSTR_IDX_MAP & | str_map, | |||
| const ACCESS & | ty_node | |||
| ) | [inline, static] |
Definition at line 255 of file ipc_type_merge.cxx.
References BOOL, Clean_TY_IDX(), FALSE, i, Is_True, Is_TY_Temp_Idx(), TY_IDX_MAP::map_, TRUE, TY_flags, TY_IDX_Attributes(), TY_IDX_index(), TY_Inserted(), TY_kind, TY_mtype, TY_name_idx(), TY_size, UINT, Valid_TY_IDX(), VALIDATE_COMMIT, VALIDATE_FAIL, VALIDATE_OK, and Validate_Recursive_Type().
Referenced by Validate_Recursive_Type().
Definition at line 234 of file ipc_type_merge.cxx.
References FALSE, KIND_POINTER, KIND_STRUCT, TY_align, TY_IDX_index(), TY_is_incomplete_struct(), TY_kind, TY_pointed, and IPC_GLOBAL_TABS::ty_tab.
Referenced by Create_TY_For_Tree(), Get_TY(), New_Partial_Match(), and WGEN_Start_Function().
| static VALIDATION_STATE Validate_Recursive_Type | ( | TY_INDEX | index, | |
| TY_IDX_MAP & | ty_map, | |||
| const SYMSTR_IDX_MAP & | str_map, | |||
| TY_IDX | merged_ty_idx | |||
| ) | [static] |
Definition at line 405 of file ipc_type_merge.cxx.
References Insert_Unique_Ty(), IPA_Enable_Old_Type_Merge, Is_True, KIND_ARRAY, KIND_FUNCTION, KIND_POINTER, KIND_SCALAR, KIND_STRUCT, KIND_VOID, TY_IDX_MAP::map_, New_Partial_Match(), Partial_Match(), TY_IDX_MAP::set_map(), Set_TY_Temp_Idx(), TY_kind, IPC_GLOBAL_TABS::ty_tab, Ty_Table, Valid_TY_IDX(), VALIDATE_COMMIT, and VALIDATE_FAIL.
Referenced by Find_Recursive_Type(), New_Partial_Match(), and Partial_Match().
| hash_set<TY_INDEX> complete_nonrecursive_type |
To speed up finding recursive type, it must reduce the recursive table. We know that below types should be inserted into the recursive table. 1. Explicit recursive types, or 2. Types has kids with incomplete types. So we only recognize the complete non-recursive types and add them into a set. The elements not in the set may be recursive and add them into the recursive table.
Definition at line 863 of file ipc_type_merge.cxx.
Referenced by Is_Incomplete_Or_Recursive().
const IPC_GLOBAL_TABS* file_tables [static] |
Definition at line 96 of file ipc_type_merge.cxx.
| hash_set<TY_INDEX> processing_recursive_type |
| hash_map<STR_IDX, TY_INDEX, __new_hash::hash<STR_IDX>, std::equal_to<STR_IDX> > struct_by_name_idx |
Definition at line 56 of file ipc_type_merge.cxx.
Referenced by Find_Recursive_Type(), Insert_Allocated_Ty(), and Insert_Ty().
| hash_set<TY_INDEX> to_update_incomplete_ty |
Definition at line 59 of file ipc_type_merge.cxx.
Referenced by Commit_Recursive_Type(), Insert_Ty(), and Merge_All_Types().
| hash_set<TY_INDEX> updating_incomplete_ty |
Definition at line 62 of file ipc_type_merge.cxx.
Referenced by Commit_Recursive_Type(), Insert_Ty(), Insert_Ty_Specific(), and Merge_All_Types().
1.5.6