Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
anl_loop_construct.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 /* -*-Mode: c++;-*- (Tell emacs to use c++ mode) */
00037 #ifndef anl_loop_construct_INCLUDED
00038 #define anl_loop_construct_INCLUDED
00039 
00040 // ==============================================================
00041 // ==============================================================
00042 //
00043 //
00044 // Description:
00045 //
00046 //
00047 // ==============================================================
00048 // ==============================================================
00049 
00050 
00051 class ANL_FUNC_ENTRY;
00052 class ANL_PRAGMA_ATTRIBUTE;
00053 
00054 class ANL_LOOP_CONSTRUCT
00055 {
00056 private:
00057 
00058    enum ANL_LOOP_KIND
00059    {
00060       ANL_DO_LOOP,
00061       ANL_WHILE_LOOP,
00062       ANL_WHILE_AS_DO_LOOP,
00063       ANL_DOACROSS_LOOP,
00064       ANL_PARALLELDO_LOOP,
00065       ANL_PDO_LOOP
00066    };
00067 
00068    INT64           _id;
00069    ANL_LOOP_KIND   _loop_kind;
00070    WN             *_loop_region;
00071    WN             *_loop;
00072    INT32           _construct_level;
00073    ANL_FUNC_ENTRY *_func_entry;
00074    MEM_POOL       *_pool;
00075 
00076    WN *_First_Loop_Stmt();
00077    WN *_Last_Loop_Stmt();
00078 
00079    static BOOL Is_Valid_Dir(ANL_PRAGMA_ATTRIBUTE *dir, 
00080                             INT32                 construct_level);
00081    static BOOL Is_End_Of_Loop_Comment(WN *end_stmt);
00082    static void Remove_Stmt_In_Block(WN *stmt);
00083 
00084    BOOL _Is_Parallel_Loop() const 
00085    {
00086       return (_loop_kind == ANL_DOACROSS_LOOP   ||
00087               _loop_kind == ANL_PARALLELDO_LOOP ||
00088               _loop_kind == ANL_PDO_LOOP);
00089    }
00090    
00091    void _Loop_Srcpos_Range(ANL_SRCPOS *min, ANL_SRCPOS *max);
00092    void _Write_Loop_Header(ANL_CBUF *cbuf);
00093    void _Write_Loop_Directive(ANL_CBUF *cbuf);
00094 
00095 public:
00096 
00097    // ============== Constructors & Destructors ==============
00098 
00099    ANL_LOOP_CONSTRUCT(WN             *loop,
00100                       INT32           construct_level,
00101                       ANL_FUNC_ENTRY *func_entry,
00102                       MEM_POOL       *pool);
00103 
00104 
00105    // ============== Analysis and Output =============
00106 
00107    WN *Next_Stmt();
00108 
00109    void Write(ANL_CBUF *cbuf);
00110 
00111 
00112 }; // class ANL_LOOP_CONSTRUCT
00113 
00114 #endif /* anl_loop_construct_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines