Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
privatize_common.h
Go to the documentation of this file.
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 //-*-c++-*-
00037 /* ====================================================================
00038  *
00039  * Revision history:
00040  *  11-12-97 : First created by Dave Kohr
00041  *
00042  * Description:
00043  * fixes bug involving COMMON/inlining/MP privatization
00044  *
00045  * Exported functions:
00046  * Rename_Privatized_COMMON()
00047  * ST_Source_COMMON_Block()
00048  * ==================================================================== */
00049 
00050 #ifndef privatize_common_INCLUDED
00051 #define privatize_common_INCLUDED
00052 
00053 #ifndef defs_INCLUDED
00054 #include "defs.h"
00055 #endif
00056 
00057 #ifndef wn_INCLUDED
00058 #include "wn.h"
00059 #endif
00060 
00061 #ifndef stab_INCLUDED
00062 #include "stab.h"
00063 #endif
00064 
00065 #ifndef cxx_template_INCLUDED
00066 #include "cxx_template.h"
00067 
00068 #endif
00069 
00070 #ifndef cxx_hash_INCLUDED
00071 #include "cxx_hash.h"
00072 #endif
00073 
00074 
00075 typedef HASH_TABLE<ST *, ST *> RENAMING_MAP;
00076 
00077 typedef HASH_TABLE<ST *, BOOL> ST_SET;
00078 
00079 class RENAMING_SCOPE {
00080   enum { NUM_HASH_ELEMENTS = 1021 };
00081 public:
00082   MEM_POOL *pool; // for all memory allocation by this object
00083   WN *priv_list;  // pragma block containing privatization pragmas; is
00084                   // NULL for a scope outside any parallel regions with
00085                   // PRIVATE clauses
00086   RENAMING_MAP map; // map of original to renamed COMMON ST's
00087   ST_SET ignore;  // ST's that don't need to be renamed
00088   HASH_TABLE<WN *, BOOL> old_prags; // original PRIVATE pragmas in priv_list
00089                                     // for STs that must be renamed
00090   RENAMING_SCOPE(WN *_priv_list, MEM_POOL *_pool)
00091     : priv_list(_priv_list), pool(_pool), map(NUM_HASH_ELEMENTS, _pool),
00092       ignore(NUM_HASH_ELEMENTS, _pool), old_prags(NUM_HASH_ELEMENTS, _pool)
00093     { }
00094   ~RENAMING_SCOPE();
00095 };
00096 
00097 typedef STACK<RENAMING_SCOPE *> RENAMING_STACK;
00098 
00099 extern void
00100 Rename_Privatized_COMMON(WN *wn, RENAMING_STACK *stack);
00101 
00102 extern ST *
00103 ST_Source_COMMON_Block(ST *st, ST **split);
00104 
00105 #endif  // #ifndef privatize_common_INCLUDED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines