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 /* ======================================================================= 00037 * ======================================================================= 00038 * 00039 * Module: gtn_tn_set.c 00040 * $Revision: 1.1.1.1 $ 00041 * $Date: 2005/10/21 19:00:00 $ 00042 * $Author: marcel $ 00043 * $Source: /proj/osprey/CVS/open64/osprey1.0/be/cg/gtn_tn_set.cxx,v $ 00044 * 00045 * Revision comments: 00046 * 00047 * 14-Oct-1994 - Initial version 00048 * 00049 * Description: 00050 * ============ 00051 * 00052 * Implements the translation from GTN sets to TN sets. 00053 * 00054 * ======================================================================= 00055 * ======================================================================= 00056 */ 00057 00058 #ifdef USE_PCH 00059 #include "cg_pch.h" 00060 #endif // USE_PCH 00061 #pragma hdrstop 00062 00063 #include "defs.h" 00064 #include "errors.h" /* for definition of Is_True() */ 00065 #include "mempool.h" 00066 #include "bitset.h" 00067 #include "cgir.h" 00068 #include "tn_set.h" 00069 #include "tn_list.h" 00070 #include "gtn_universe.h" 00071 #include "gtn_set.h" 00072 #include "bb_list.h" 00073 #include "register.h" 00074 #include "bbregs.h" 00075 #include "gtn_tn_set.h" 00076 00077 00078 MEM_POOL local_pool; 00079 BOOL local_pool_initialized = FALSE; 00080 00081 00082 /* ======================================================================= 00083 * 00084 * Check_Local_Pool_Initialized 00085 * 00086 * Check that the local pool is initialized and do so if required. 00087 * 00088 * ======================================================================= 00089 */ 00090 inline void 00091 Check_Local_Pool_Initialized(void) 00092 { 00093 if ( ! local_pool_initialized ) { 00094 MEM_POOL_Initialize(&local_pool,"GTN_TN_SET_local_pool",FALSE); 00095 local_pool_initialized = TRUE; 00096 } 00097 } 00098 00099 00100 /* ======================================================================= 00101 * 00102 * GTN_TN_SET_Print 00103 * 00104 * See interface description. 00105 * 00106 * ======================================================================= 00107 */ 00108 void 00109 GTN_TN_SET_Print(GTN_SET *gtn_set, FILE *file) 00110 { 00111 Check_Local_Pool_Initialized(); 00112 MEM_POOL_Push(&local_pool); 00113 00114 TN_SET *tn_set = TN_SET_Create_Empty (Last_TN + 1,&local_pool); 00115 for ( TN *tn = GTN_SET_Choose(gtn_set); 00116 tn != GTN_SET_CHOOSE_FAILURE && tn != NULL; 00117 tn = GTN_SET_Choose_Next(gtn_set,tn)) 00118 { 00119 FmtAssert(TN_is_global_reg(tn),("TN%d is not global",TN_number(tn))); 00120 tn_set = TN_SET_Union1D(tn_set, tn, &local_pool); 00121 } 00122 00123 TN_SET_Print(tn_set,file); 00124 00125 MEM_POOL_Pop(&local_pool); 00126 }
1.5.6