00001 /* 00002 * Copyright 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 00041 #define __STDC_LIMIT_MACROS 00042 #include <stdint.h> 00043 #ifdef USE_PCH 00044 #include "be_com_pch.h" 00045 #endif /* USE_PCH */ 00046 #pragma hdrstop 00047 #include <sys/types.h> 00048 #if defined(BUILD_OS_DARWIN) 00049 #include "darwin_elf.h" 00050 #else /* defined(BUILD_OS_DARWIN) */ 00051 #include <elf.h> 00052 #endif /* defined(BUILD_OS_DARWIN) */ 00053 #include <ctype.h> 00054 #include "wn.h" 00055 #include "wn_map.h" 00056 #include "wn_util.h" 00057 #include <stdio.h> 00058 #include "opt_du.h" 00059 #include "opt_alias_mgr.h" 00060 #include "dep_graph.h" 00061 #include "prompf.h" 00062 #include "ir_reader.h" 00063 #include "wb_util.h" 00064 #include "wb_buffer.h" 00065 #include "wb_carray.h" 00066 #include "wb_browser.h" 00067 #include "wb.h" 00068 #include "wb_ipl.h" 00069 00070 WB_BROWSER wb_ipl; 00071 00072 // Save Area 00073 00074 static WB_PHASE WB_Save_Phase; 00075 WB_BROWSER wb_save; 00076 00077 extern void WB_IPL_Save() 00078 { 00079 WB_Save_Phase = WB_Phase(); 00080 wb_save.Set_Global_Fd(wb_ipl.Global_Fd()); 00081 wb_save.Set_Du(wb_ipl.Du()); 00082 wb_save.Set_Alias_Manager(wb_ipl.Alias_Mgr()); 00083 } 00084 00085 extern void WB_IPL_Initialize(WN* wn_global, 00086 DU_MANAGER* du, 00087 ALIAS_MANAGER* am) 00088 { 00089 WB_Set_Phase(WBP_IPL); 00090 WB_Initialize(&wb_ipl, wn_global, &Get_Current_PU(), du, am, -1); 00091 } 00092 00093 extern void WB_IPL_Set_Access_Array_Map(WN_MAP access_array_map) 00094 { 00095 wb_ipl.Set_Access_Array_Map(access_array_map); 00096 } 00097 00098 extern void WB_IPL_Set_Reduction_Map(WN_MAP reduction_map) 00099 { 00100 wb_ipl.Set_Reduction_Map(reduction_map); 00101 } 00102 00103 extern void WB_IPL_Set_Scalar_Summary(SUMMARIZE<IPL>* scalar_summary) 00104 { 00105 wb_ipl.Set_Scalar_Summary(scalar_summary); 00106 } 00107 00108 extern void WB_IPL_Set_Array_Summary(ARRAY_SUMMARY* array_summary) 00109 { 00110 wb_ipl.Set_Array_Summary(array_summary); 00111 } 00112 00113 extern void WB_IPL_Terminate() 00114 { 00115 WB_Set_Phase(WBP_NONE); 00116 WB_Terminate(&wb_ipl); 00117 } 00118 00119 extern void WB_IPL_Restore() 00120 { 00121 wb_ipl.Set_Global_Fd(wb_save.Global_Fd()); 00122 wb_ipl.Set_Du(wb_save.Du()); 00123 wb_ipl.Set_Alias_Manager(wb_save.Alias_Mgr()); 00124 WB_Set_Phase(WB_Save_Phase); 00125 } 00126 00127 extern void s_ipl_debug(const char init_buffer[]) 00128 { 00129 wb_ipl.Sdebug(init_buffer); 00130 } 00131
1.5.6