Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
errdesc.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 ERRDESC_INCLUDED
00037 #define ERRDESC_INCLUDED
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 /* ====================================================================
00043  * ====================================================================
00044  *
00045  *
00046  * This header describes the structure used to create the error message
00047  * tables.  Do not reference the structure directly.  Only the
00048  * errors module should do that.
00049  *
00050  * ====================================================================
00051  * ====================================================================
00052  */
00053 
00054 #include "defs.h"
00055 
00056 /* These error numbers are reported to users, and the initial number
00057  * should not interfere with those from the front-end.
00058  */
00059 typedef enum {
00060   RAG_EN_FIRST = 2000,
00061   RAG_EN_NONE,          /* indicates error not assigned a number */
00062   RAG_EN_RTN_UNINIT,
00063   RAG_EN_FORMAL_REF,
00064   RAG_EN_UNINIT_REF,
00065   RAG_EN_FOLD_ARITH_TOO_BIG,
00066   RAG_EN_FOLD_ARITH_TOO_BIG2,
00067   RAG_EN_CONST_COPY_TOO_BIG,
00068   RAG_EN_CONST_COPY_TOO_BIG2,
00069   RAG_EN_GOPT_TOO_BIG,
00070   RAG_EN_GOPT_TOO_BIG2,
00071   RAG_EN_LNO,
00072   /* Add new warning numbers before this comment */
00073   RAG_EN_LAST
00074 } Rag_Err_Num;
00075 
00076 /* ====================================================================
00077  *
00078  * Error message descriptors
00079  *
00080  * ====================================================================
00081  */
00082 
00083 /* Descriptor flag word masks: */
00084 #define EM_User         0x8000  /* User error (vs. compiler) */
00085 #define EM_Compiler     0x0000  /* Compiler error (vs. user) */
00086 #define EM_Continuation 0x4000  /* Print message line only */
00087 #define EM_Unknown      0x2000  /* Converted unknown code */
00088 #define EM_Severity     0x000f  /* Severity level */
00089 
00090 /* The maximum number of error parameters.  This value cannot be
00091  * changed (increased) without changing all of the error descriptors
00092  * and the error reporting routine interfaces.  Note, however, that
00093  * using continuation error messages are probably adequate for cases
00094  * with more parameters.
00095  */
00096 #define MAX_ERR_PARMS   6
00097 
00098 /* Define an error message descriptor: */
00099 typedef struct {
00100     mINT16      ecode;          /* The error code */
00101     mINT16      flags;          /* Miscellaneous flags */
00102     Rag_Err_Num rag_errnum;     /* External error/warning number */
00103     const char  *emsg;          /* The message format */
00104     mUINT8      parms;          /* The parameter count */
00105     mUINT8      kinds[MAX_ERR_PARMS];   /* Parameter types */
00106 } ERROR_DESC;
00107 
00108 /* The access functions: */
00109 #define ED_code(p)              (p->ecode)
00110 # define ED_phase(p)            (ED_code(p)/1000)
00111 #define ED_flags(p)             (p->flags)
00112 # define ED_user(p)             (ED_flags(p)&EM_User)
00113 # define ED_compiler(p)         ((ED_flags(p)&EM_User)==0)
00114 # define ED_continuation(p)     (ED_flags(p)&EM_Continuation)
00115 # define ED_unknown(p)          (ED_flags(p)&EM_Unknown)
00116 # define ED_severity(p)         (ED_flags(p)&EM_Severity)
00117 #define ED_format(p)            (p->emsg)
00118 #define ED_parms(p)             (p->parms)
00119 #define ED_kind(p,n)            (p->kinds[n])
00120 #define ED_rag_errnum(p)        (p->rag_errnum)
00121 
00122 /* Define the error descriptor table: */
00123 typedef struct error_desc_table {
00124     INT         phase;          /* The phase number of this array */
00125     ERROR_DESC *descriptors;    /* The list of error descriptors */
00126     const char *name;           /* The phase name */
00127 } ERROR_DESC_TABLE;
00128 
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132 #endif /* ERRDESC_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines