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 00043 #ifndef NAME_RCS_ID 00044 #define NAME_RCS_ID 00045 #ifdef _KEEP_RCS_ID 00046 static char *name_rcs_id = "$Source$ $Revision$"; 00047 #endif /* _KEEP_RCS_ID */ 00048 #endif 00049 00050 #ifndef NAME_DECLARE 00051 #define NAME_DECLARE 00052 00053 #include "defs.h" 00054 #include "wn.h" 00055 #include "cxx_memory.h" 00056 #include "cxx_template.h" 00057 #include "access_vector.h" 00058 #include "opt_alias_interface.h" 00059 00060 // class NAME2BIT is used internally in inner_fission phase. 00061 // It contains the mapping from a symbol to a bit-positionin the bit 00062 // vector used to record the names of the variables in a statement or SCC. 00063 // It also defines the comparison operators (<,==,>) so that it can be 00064 // used as nodes in the binary tree (be/com/btree.h). 00065 00066 class NAME2BIT { 00067 SYMBOL _symbol; 00068 ACCESS_ARRAY* _access_array; 00069 UINT _bit_position; 00070 public: 00071 NAME2BIT() { _access_array = NULL; } 00072 NAME2BIT(const SYMBOL symbol) { _symbol=symbol; _access_array = NULL; } 00073 NAME2BIT(const WN* wn) { _symbol.Init(wn); _access_array = NULL; } 00074 ~NAME2BIT() {} 00075 BOOL operator <(const NAME2BIT &name2bit) const; 00076 BOOL operator ==(const NAME2BIT &name2bit) const; 00077 BOOL operator >(const NAME2BIT &name2bit) const { 00078 return (!(*this < name2bit) && !(*this == name2bit)); 00079 } 00080 void Set_Bit_Position(const UINT pos) { _bit_position=pos; } 00081 void Set_Symbol(const SYMBOL symbol) { _symbol=symbol; } 00082 void Set_Symbol(const WN* wn) { _symbol.Init(wn); } 00083 void Set_Access_Array(ACCESS_ARRAY *ar) { _access_array = ar; } 00084 UINT64 Get_Bit_Position() const { return _bit_position; } 00085 SYMBOL Get_Symbol() const { return _symbol; } 00086 ACCESS_ARRAY* Get_Access_Array() const { return _access_array; } 00087 }; 00088 00089 00090 #endif 00091
1.5.6