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 //-*-c++-*- 00041 //----------------------------------------------------------------------------- 00042 // IF_INFO 00043 // Contains information about block structured IFs 00044 // 00045 // BOOL Contains_Do_Loops 00046 // 00047 // There is a DO loop inside this IF 00048 // 00049 // BOOL Contains_Regions 00050 // 00051 // There is a region inside this IF 00052 // 00053 // IF_INFO(MEM_POOL *pool, BOOL contains_do_loops, BOOL contains_regions) 00054 // 00055 // ACCESS_ARRAY *Condition 00056 // 00057 // An ACCESS_ARRAY representation for the condition of the if 00058 // 00059 // BOOL Codition_On_Then 00060 // 00061 // Is the access vector a condition for the 'then' or for 00062 // the else 00063 // 00064 // MEM_POOL *Pool() 00065 // 00066 // Which pool was used for this info 00067 // 00068 // void Print(FILE *fp, INT indentation = 0) 00069 // 00070 // Print out the info. Can specify requested whitespace before 00071 // each line. 00072 // 00073 //----------------------------------------------------------------------------- 00074 00075 #ifndef if_info_INCLUDED 00076 #define if_info_INCLUDED 00077 00078 #ifndef access_vector_INCLUDED 00079 #include "access_vector.h" 00080 #endif 00081 00082 class ARA_LOOP_INFO; 00083 00084 class IF_INFO 00085 { 00086 MEM_POOL *_pool; 00087 public: 00088 IF_INFO(MEM_POOL *pool, BOOL contains_do_loops, BOOL contains_regions) { 00089 _pool = pool; 00090 Contains_Do_Loops = contains_do_loops; 00091 Contains_Regions = contains_regions; 00092 Condition = NULL; 00093 Freq_True = -1.0; 00094 Freq_False = -1.0; 00095 _ara_then = NULL; 00096 _ara_else = NULL; 00097 _ara_common = NULL; 00098 } 00099 00100 IF_INFO(IF_INFO *ii, MEM_POOL *pool) 00101 { 00102 _pool = pool; 00103 Condition = CXX_NEW(ACCESS_ARRAY(ii->Condition,pool),pool); 00104 Contains_Do_Loops = ii->Contains_Do_Loops; 00105 Contains_Regions = ii->Contains_Regions; 00106 Condition_On_Then = ii->Condition_On_Then; 00107 Freq_True = ii->Freq_True; 00108 Freq_False = ii->Freq_False; 00109 _ara_then = ii->ARA_then(); 00110 _ara_else = ii->ARA_else(); 00111 _ara_common = ii->ARA_common(); 00112 } 00113 00114 MEM_POOL *Pool() { return _pool; }; 00115 ACCESS_ARRAY *Condition; 00116 mBOOL Contains_Do_Loops; 00117 mBOOL Contains_Regions; 00118 mBOOL Condition_On_Then; 00119 float Freq_True; 00120 float Freq_False; 00121 void Print(FILE *fp) __attribute__((weak)); 00122 ARA_LOOP_INFO *_ara_then; 00123 ARA_LOOP_INFO *_ara_else; 00124 ARA_LOOP_INFO *_ara_common; 00125 00126 // member access functions 00127 void Set_ARA_then(ARA_LOOP_INFO *a) { _ara_then = a; } 00128 void Set_ARA_else(ARA_LOOP_INFO *a) { _ara_else = a; } 00129 void Set_ARA_common(ARA_LOOP_INFO *a){ _ara_common = a;} 00130 ARA_LOOP_INFO * ARA_then(void) const { return _ara_then; } 00131 ARA_LOOP_INFO * ARA_else(void) const { return _ara_else; } 00132 ARA_LOOP_INFO * ARA_common(void) const { return _ara_common; } 00133 00134 }; 00135 00136 #endif
1.5.6