Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 00036 //-*-c++-*- 00037 //===================================================================== 00038 // 00039 // 00040 // Revision history: 00041 // 7-SEP-95 dahl - Original Version 00042 // 00043 // Description: 00044 // Region Boundary Info (RBI) 00045 // 00046 //====================================================================== 00047 //====================================================================== 00048 00049 #ifndef rbi_INCLUDED 00050 #define rbi_INCLUDED "rbi.h" 00051 #ifdef _KEEP_RCS_ID 00052 #endif /* _KEEP_RCS_ID */ 00053 00054 #include "region_util.h" 00055 00056 const INT32 WN_PROP_USED_IN = 0x01, 00057 WN_PROP_DEF_IN = 0x02, 00058 WN_PROP_LIVE_OUT = 0x04; 00059 00060 class RBI { 00061 00062 private: 00063 INT32 _trace_level; // -ttTP_REGION(41), -ttRGN 00064 MEM_POOL *_pool; 00065 WN_MAP _prop_map; 00066 WN_MAP _tag_map; // WN map, mark nodes with region id 00067 00068 public: 00069 RBI(MEM_POOL *); // pool must be supplied to constructor 00070 ~RBI(void); 00071 00072 // 0 - no trace 00073 // 1 - major function trace only (TT_REGION_RBI_DEBUG and other debug bits) 00074 // 2 - detailed trace (only RBI bit set TT_REGION_RBI_DEBUG) 00075 BOOL Trace( void ) const { return _trace_level > 0; } 00076 BOOL Trace2( void ) const { return _trace_level == 2; } 00077 00078 MEM_POOL *Mem_Pool( void ) { return _pool; } 00079 00080 void RBI_Calc_Kids(RID *root, const DU_MANAGER *du_mgr, 00081 const ALIAS_MANAGER *am); 00082 00083 void RBI_Calc_Rgn(RID *const rid_node, const DU_MANAGER *const du_mgr, 00084 const ALIAS_MANAGER *const am); 00085 00086 INT32 Rgn_WN_Tag( WN *const wn ) const 00087 { 00088 return WN_MAP32_Get( _tag_map, wn ); 00089 } 00090 00091 void Set_WN_Cur_Rgn( WN* wn, INT32 rgn_id ) 00092 { 00093 WN_MAP32_Set( _tag_map, wn, rgn_id ); 00094 } 00095 00096 BOOL Outside_Cur_Rgn( WN* wn, INT32 rgn_id ) const 00097 { 00098 // RETURNs are always considered to lie outside since they 00099 // amount to exits from the region and anything that could be 00100 // used by the exited-to code is found on the RETURN's 00101 // def-list. 00102 if (WN_opcode(wn) == OPC_RETURN) 00103 return TRUE; 00104 else 00105 return (Rgn_WN_Tag(wn) != rgn_id); 00106 } 00107 00108 INT32 Get_WN_Prop( WN *const wn ) const 00109 { 00110 return WN_MAP32_Get( _prop_map, wn ); 00111 } 00112 00113 void Set_WN_Prop( WN *const, const INT32 ); 00114 00115 void Set_PT_SET_All_Aliasable(POINTS_TO_SET *); 00116 00117 void Add_To_PT_SET(POINTS_TO_SET *, POINTS_TO *); 00118 00119 }; // end of class RBI 00120 00121 extern "C" void Region_Bound_Info(WN *tree, 00122 DU_MANAGER *du_mgr, 00123 ALIAS_MANAGER *am); 00124 00125 #endif /* ifdef rbi_INCLUDED */