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 /* -*-Mode: c++;-*- (Tell emacs to use c++ mode) */ 00037 #ifndef anl_func_entry_INCLUDED 00038 #define anl_func_entry_INCLUDED 00039 00040 // ============================================================== 00041 // ============================================================== 00042 // 00043 // 00044 // Description: 00045 // 00046 // An object to represent the analysis of a function/subroutine 00047 // to produce .anl file entries. Such entries may be original 00048 // source construct descriptors (and eventually, perhaps, 00049 // transformed source construct descriptors). 00050 // 00051 // ============================================================== 00052 // ============================================================== 00053 00054 00055 #include <array_set.h> 00056 00057 class ANL_PRAGMA_ATTRIBUTE; 00058 typedef ARRAY_SET<ANL_PRAGMA_ATTRIBUTE*> DIR_ENTRIES; 00059 00060 class ANL_FUNC_ENTRY 00061 { 00062 private: 00063 00064 INT32 _construct_level; 00065 WN *_pu; 00066 MEM_POOL *_pool; 00067 W2CF_TRANSLATOR *_w2cf; 00068 WN_MAP _id_map; 00069 COUNTER *_next_id; 00070 DIR_ENTRIES _dir_entries; 00071 00072 void _Push_Construct_Level(ANL_CBUF *cbuf); 00073 void _Pop_Construct_Level(); 00074 00075 public: 00076 00077 // ============== Constructors & Destructors ============== 00078 00079 ANL_FUNC_ENTRY(WN *pu, 00080 MEM_POOL *pool, 00081 W2CF_TRANSLATOR *w2cf, 00082 WN_MAP id_map, 00083 COUNTER *next_id): 00084 _construct_level(0), 00085 _pu(pu), 00086 _pool(pool), 00087 _w2cf(w2cf), 00088 _id_map(id_map), 00089 _next_id(next_id), 00090 _dir_entries(pool) 00091 {} 00092 00093 ~ANL_FUNC_ENTRY(); 00094 00095 00096 // =================== Inquiries =================== 00097 00098 W2CF_TRANSLATOR *Pu_Translator() {return _w2cf;} 00099 WN *Pu_Tree() {return _pu;} 00100 COUNTER *Next_Construct_Id() {return _next_id;} 00101 DIR_ENTRIES *Dir_Entries() {return &_dir_entries;} 00102 00103 void Get_Pragma_Srcpos_Range(WN *apragma, 00104 ANL_SRCPOS *min, 00105 ANL_SRCPOS *max); 00106 00107 00108 // ============== Analysis and Output ============= 00109 00110 void Set_Construct_Id(WN *construct, INT64 id); 00111 00112 void Emit_Nested_Original_Constructs(ANL_CBUF *cbuf, 00113 WN *from_stmt, 00114 WN *to_stmt); 00115 00116 void Emit_Dir_Entries(ANL_CBUF *cbuf, 00117 INT64 for_construct_id, 00118 INT32 for_construct_level, 00119 BOOL (*do_emit)(ANL_PRAGMA_ATTRIBUTE *dir, 00120 INT32 construct_level)); 00121 00122 void Emit_Original_Construct(ANL_FILE_MNGR *outp_file); 00123 00124 00125 }; // class ANL_FUNC_ENTRY 00126 00127 #endif /* anl_func_entry_INCLUDED */