Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
st2f.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 #ifndef st2f_INCLUDED
00037 #define st2f_INCLUDED
00038 /* ====================================================================
00039  * ====================================================================
00040  *
00041  *
00042  * Revision history:
00043  *    13-Apr-95 - Original Version
00044  *
00045  * Description:
00046  *
00047  *    ST2F_initialize:
00048  *       Should be called before any other routines in this module.
00049  *
00050  *    ST2F_finalize:
00051  *       Should be called after completed use of this module (i.e.
00052  *       just before whirl2f terminates).
00053  *
00054  *    ST2F_use_translate:
00055  *       Translate a variable reference.
00056  *
00057  *    ST2F_decl_translate:
00058  *       Translate a variable declaration
00059  *
00060  *    ST2F_deref_translate:
00061  *       Translate a pointer variable to its dereferenced version.
00062  *
00063  *    ST2F_func_header:
00064  *       Adds tokens for the function header (parameter declarations,
00065  *       function name, and return type) in a function definition. Note 
00066  *       that the resultant token buffer will not have appended a 
00067  *       newline after the function header.
00068  *
00069  *    ST2F_Use_Preg:
00070  *       Given an ST_type(), a preg offset, and a context, this function 
00071  *       appends the name of the preg to the given TOKEN_BUFFER.  The 
00072  *       preg will be declared as a side-effect of this call if it has 
00073  *       not yet been declared in the current context.  It is left to 
00074  *       the caller to cast the resultant value to ST_type(st) when:
00075  *       PUinfo_Preg_Type(ST_type(st)) != ST_type(st).
00076  *
00077  *    ST2F_Declare_Tempvar:
00078  *       Declares a tempvar with the given index in the local scope.
00079  *
00080  *    ST2F_FIRST_PARAM_IDX:
00081  *       An index to the first parameter to be explicitly declared in
00082  *       Fortran, given the type of the function and the type of the 
00083  *       first (implicit or explicit) argument.
00084  *
00085  * ====================================================================
00086  * ====================================================================
00087  */
00088 
00089 extern void ST2F_initialize();
00090 extern void ST2F_finalize();
00091 
00092 extern void ST2F_use_translate(TOKEN_BUFFER tokens, ST *st);
00093 
00094 extern void ST2F_decl_translate(TOKEN_BUFFER tokens, const ST *st);
00095 
00096 extern void ST2F_deref_translate(TOKEN_BUFFER tokens, ST *st);
00097 
00098 extern void  ReorderParms(ST **parms,INT32 num_params);
00099 
00100 extern void ST2F_func_header(TOKEN_BUFFER tokens,
00101                              ST          *st,           /* Function ST entry */
00102                              ST         **params,       /* Array of parameters */
00103                              INT32        num_parms,    /* # of parms in params */
00104                              BOOL         is_altentry); /* Alternate entry */
00105 
00106 
00107 extern void ST2F_Use_Preg(TOKEN_BUFFER tokens,
00108                           TY_IDX       preg_ty,
00109                           PREG_IDX     preg_idx);
00110 
00111 extern void ST2F_Declare_Tempvar(TY_IDX ty, UINT idx);
00112 
00113 extern void ST2F_output_keyword(TOKEN_BUFFER tokens,
00114                                 ST            *st);
00115 
00116 extern bool haveCommonBlockName(ST *st);
00117 
00118 //-------------------------------------
00119 
00120 #define ST2F_FIRST_PARAM_IDX(funtype) \
00121    (W2X_Unparse_Target->Func_Return_To_Param(funtype)? \
00122     (W2X_Unparse_Target->Func_Return_Character(funtype)? 2 : 1) : 0)
00123 
00124 #endif /* st2f_INCLUDED */
00125 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines