00001 /* 00002 * Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2 of the GNU General Public License as 00011 published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU General Public License along 00025 with this program; if not, write the Free Software Foundation, Inc., 59 00026 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00027 00028 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00029 Mountain View, CA 94043, or: 00030 00031 http://www.sgi.com 00032 00033 For further information regarding this notice, see: 00034 00035 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00036 00037 */ 00038 00039 00040 /* -*-Mode: c++;-*- (Tell emacs to use c++ mode) */ 00041 // ==================================================================== 00042 // ==================================================================== 00043 // 00044 // Module: ipo_across_file_utils.cxx 00045 // 00046 // Revision history: 00047 // 31 July -96 - Original Version 00048 // 00049 // Description: utilities used by the across file inlining 00050 // 00051 // =================================================================== 00052 //==================================================================== 00053 #if defined(BUILD_OS_DARWIN) 00054 #include <darwin_elf.h> 00055 #else /* defined(BUILD_OS_DARWIN) */ 00056 #include <elf.h> 00057 #endif /* defined(BUILD_OS_DARWIN) */ 00058 #define USE_STANDARD_TYPES /* override unwanted defines in defs.h */ 00059 #include "defs.h" 00060 #include "config_ipa.h" // for INLINE/IPA options 00061 #include "mempool.h" 00062 #include "stab.h" 00063 #include "wn.h" 00064 #include "dwarf_DST_mem.h" // for ipc_file.h 00065 #include "ipc_file.h" 00066 #include "cxx_base.h" 00067 #include "cxx_memory.h" // for CXX_NEW, etc. 00068 #include "clone.h" 00069 #include "ipo_clone.h" 00070 #include "ipo_st_utils.h" 00071 #include "clone.h" 00072 #include "ipo_clone.h" 00073 #include "ipo_across_file_utils.h" 00074 00075 //------------------------------------------------------------ 00076 // initialize the mappings 00077 //------------------------------------------------------------ 00078 void Init_ty_maps(IP_FILE_HDR *shd_callee, IP_FILE_HDR *shd_caller, 00079 SYMTAB *caller_gs) 00080 { 00081 00082 MEM_POOL* caller_aux_mem_pool = &IP_FILE_HDR_aux_mem_pool(shd_caller); 00083 MEM_POOL* callee_aux_mem_pool = &IP_FILE_HDR_aux_mem_pool(shd_callee); 00084 00085 if (shd_callee != shd_caller) { 00086 if (IP_FILE_HDR_global_ty_map(shd_caller) == 0) { 00087 IP_FILE_HDR_global_ty_map(shd_caller) = (void *) 00088 CXX_NEW (IPO_TY_HASH (caller_aux_mem_pool), 00089 caller_aux_mem_pool); 00090 } 00091 if (IPA_Enable_Merge_ty) { 00092 IPO_TY_HASH *map = 00093 (IPO_TY_HASH *) IP_FILE_HDR_global_ty_map(shd_caller); 00094 map->Init_Hash (SYMTAB_types(caller_gs)); 00095 00096 if (IP_FILE_HDR_global_ty_map(shd_callee) == 0) { 00097 IP_FILE_HDR_global_ty_map(shd_callee) = (void *) 00098 CXX_NEW (IPO_TY_HASH (callee_aux_mem_pool), 00099 callee_aux_mem_pool); 00100 } 00101 } 00102 } 00103 }
1.5.6