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 #ifndef w2cf_symtab_INCLUDED 00037 #define w2cf_symtab_INCLUDED 00038 /* ==================================================================== 00039 * ==================================================================== 00040 * 00041 * 00042 * Revision history: 00043 * 07-Oct-95 - Original Version 00044 * 00045 * Description: 00046 * 00047 * The symbol table has been implemented as a state-machine maintaining 00048 * a stack of symbol-tables. There are routines to push and pop symbol 00049 * tables, get the name of a given symbol, enter symbols into the 00050 * current symbol table, push and pop symbol tables, etc. 00051 * 00052 * The memory allocated to hold symbol-names and the symbol-table data 00053 * structure is never freed up until the use of this package is 00054 * terminated or a forced free operation is invoked. 00055 * 00056 * W2CF_Push_Symtab: Pushes a new symbol table onto the stack and 00057 * makes it the current symbol-table new symbol entries. 00058 * 00059 * W2CF_Pop_Symtab: Pops the last symbol table entered onto the stack 00060 * off the stack, putting all related symbol-table objects onto 00061 * free-lists. 00062 * 00063 * W2CF_Symtab_Nameof_St: 00064 * W2CF_Symtab_Nameof_St_Pointee: 00065 * W2CF_Symtab_Nameof_Ty: 00066 * W2CF_Symtab_Nameof_Fld: 00067 * W2CF_Symtab_Nameof_Fld_Pointee: 00068 * W2CF_Symtab_Nameof_Tempvar: 00069 * W2CF_Symtab_Nameof_Preg: 00070 * Tries to find the symbol in the symbol table, and if it has been 00071 * found, returns its assigned name. Numerical suffices are added 00072 * to names to disambiguate them from one another. An attempt will 00073 * be made to retain numeric suffices to names, but since such 00074 * suffices are used by this module to disambiguate names they may 00075 * sometime be changed. 00076 * 00077 * W2CF_Symtab_Unique_Name: 00078 * Adds a name to the symbol table, which matches no other name. 00079 * An attempt will be made to keep the name as it is given, but 00080 * name-clashes may change it. There is no way to retrieve this 00081 * name again, as its sole purpose is to permanently occupy a 00082 * slot in the current symbol-table. 00083 * 00084 * W2CF_Symtab_Unique_Label: 00085 * This assumes that label-numbers around 99999 are not used. 00086 * Starting with that number, this function returns a number 00087 * decremented by one every time it is called. 00088 * 00089 * W2CF_Symtab_Free: Frees up from memory all objects kept on free- 00090 * lists, i.e. all symbol-table related information that was used 00091 * at some point, but which is not currently in use. 00092 * 00093 * W2CF_Symtab_Terminate: Pops all symbol-tables off the stack and 00094 * frees up all memory allocated. Resets the state to allow 00095 * subsequent use of this module. 00096 * 00097 * ==================================================================== 00098 * ==================================================================== 00099 */ 00100 00101 00102 void W2CF_Symtab_Push(void); 00103 void W2CF_Symtab_Pop(void); 00104 00105 const char * W2CF_Symtab_Nameof_St(const ST *st); 00106 const char * W2CF_Symtab_Nameof_St_Pointee(const ST *st); 00107 const char * W2CF_Symtab_Nameof_Ty(TY_IDX ty); 00108 const char * W2CF_Symtab_Nameof_Fld(FLD_HANDLE fld); 00109 const char * W2CF_Symtab_Nameof_Fld_Pointee(FLD_HANDLE fld); 00110 const char * W2CF_Symtab_Nameof_Tempvar(INT32 tempvar_id); 00111 const char * W2CF_Symtab_Nameof_Preg(const TY_IDX preg_ty, PREG_NUM preg_num); 00112 const char * W2CF_Symtab_Unique_Name(const char *name); 00113 UINT32 W2CF_Symtab_Unique_Label(void); 00114 00115 void W2CF_Symtab_Free(void); 00116 void W2CF_Symtab_Terminate(void); 00117 00118 00119 #endif /* w2cf_symtab */