Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
errors.cxx File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <cmplrs/rcodes.h>
#include "defs.h"
#include "errors.h"
#include "err_host.h"
#include "erglob.h"
#include "file_util.h"
#include "tracing.h"
#include "glob.h"
#include "errdesc.h"
#include "vstring.h"
#include "wn.h"
#include "wn_map.h"
#include "ir_reader.h"
#include "err_host.tab"
Include dependency graph for errors.cxx:

Go to the source code of this file.

Classes

struct  SEVERITY_DESCRIPTOR
struct  LIMIT_STRUCT

Defines

#define USE_STANDARD_TYPES
#define IN_ERRORS_C
#define SEV_level(n)   (Severities[n].level)
#define SEV_symbol(n)   (Severities[n].symbol)
#define SEV_name(n)   (Severities[n].name)
#define Phase_Num(n)   (Phases[n].phase)
#define Phase_List(n)   (Phases[n].descriptors)
#define Phase_Name(n)   (Phases[n].name)
#define Dont_Print_Warning(i)   dont_print[i-RAG_EN_FIRST]
#define Heed_Woff(rag_errnum, severity)   (Dont_Print_Warning(rag_errnum) && (severity < ES_ERRBENIGN) )
#define BUFLEN   512
#define BUFLEN   512

Functions

void Rag_Handle_Woff_Args (char *wstring)
static void catch_signal (INT sig, INT error_num)
static void setup_signal_handler (int s)
void Handle_Signals (void)
void Set_Error_File (const char *fname)
static BOOL Init_Error_File (void)
void Set_Error_Trace (FILE *stream)
void Set_Error_Source (const char *filename)
void Set_Error_Srcpos (SRCPOS srcpos)
void Set_Error_Line (INT lineno)
void Set_Error_Phase (const char *phase)
const char * Get_Error_Phase (void)
BOOL Get_Error_Count (INT *ErrCount, INT *WarnCount)
void Init_Error_Handler (INT Max_Errors_Allowed)
static ERROR_DESCFind_Error_Desc (INT ecode)
static void Emit_Message (char *hmsg, char *emsg)
static void ErrMsg_Report_Nonuser (ERROR_DESC *edesc, INT ecode, INT line, const char *file, va_list vp)
static void ErrMsg_Report_User (ERROR_DESC *edesc, INT ecode, INT line, const char *file, va_list vp)
static void ErrMsg_Report (INT ecode, INT line, const char *file, va_list vp)
void ErrMsg (INT ecode,...)
void ErrMsgLine (INT ecode, INT line,...)
void ErrMsgSrcpos (INT ecode, SRCPOS srcpos,...)
void Abort_Compiler_Location (const char *file_name, INT line_number)
void Fail_Assertion (INT ecode,...)
void Fail_FmtAssertion (const char *fmt,...)
void Fatal_Error (const char *fmt,...)
void Set_Current_Phase_Number (INT phase)
INT Get_Current_Phase_Number (void)
void Set_Error_Descriptor (INT phase, ERROR_DESC *descriptor)
void DevWarn (const char *fmt,...)
static LIMIT_STRUCTDevWarn_limit_search (const char *const src_fname, const UINT src_line)
BOOL Count_Limit_DevWarn (const char *const src_fname, const UINT src_line, const UINT limit)
void DevWarn_Toggle (void)
BOOL Had_Internal_Error (void)
const char * StrSignal (int sig)

Variables

INT Min_Error_Severity = ES_ADVISORY
INT Conformance_Level = ES_IGNORE
static const char * Compiler_File = NULL
static INT Compiler_Line = 0
static FILE * Error_File = NULL
static const char * Error_File_Name = NULL
static FILE * Trace_File = NULL
static char source_file_name [256]
static char * Source_File_Name = &source_file_name[0]
static INT Source_Line = ERROR_LINE_UNKNOWN
static const char * Current_Phase = NULL
static INT Error_Counts [ES_MAX+1]
static INT Error_Count = 0
static BOOL Phase_Error = FALSE
static INT Max_Errors = 100
static BOOL Had_Compiler_Error = FALSE
static SEVERITY_DESCRIPTOR Severities []
static char dont_print [RAG_EN_LAST-RAG_EN_FIRST+1]
static INT Current_Phase_Number = 0
static BOOL dev_warn_enabled = TRUE

Define Documentation

#define BUFLEN   512
#define BUFLEN   512
#define Dont_Print_Warning (   i)    dont_print[i-RAG_EN_FIRST]

Definition at line 195 of file errors.cxx.

Referenced by Rag_Handle_Woff_Args().

#define Heed_Woff (   rag_errnum,
  severity 
)    (Dont_Print_Warning(rag_errnum) && (severity < ES_ERRBENIGN) )

Definition at line 197 of file errors.cxx.

Referenced by ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

#define IN_ERRORS_C

Definition at line 89 of file errors.cxx.

#define Phase_List (   n)    (Phases[n].descriptors)

Definition at line 190 of file errors.cxx.

Referenced by Find_Error_Desc().

#define Phase_Name (   n)    (Phases[n].name)

Definition at line 191 of file errors.cxx.

#define Phase_Num (   n)    (Phases[n].phase)

Definition at line 189 of file errors.cxx.

Referenced by Find_Error_Desc().

#define SEV_level (   n)    (Severities[n].level)

Definition at line 169 of file errors.cxx.

#define SEV_name (   n)    (Severities[n].name)
#define SEV_symbol (   n)    (Severities[n].symbol)

Definition at line 170 of file errors.cxx.

Referenced by ErrMsg_Report_Nonuser(), Fail_FmtAssertion(), and Fatal_Error().

Definition at line 65 of file errors.cxx.


Function Documentation

void Abort_Compiler_Location ( const char *  file_name,
INT  line_number 
)

Definition at line 1075 of file errors.cxx.

References Compiler_File, and Compiler_Line.

static void catch_signal ( INT  sig,
INT  error_num 
) [static]

Definition at line 214 of file errors.cxx.

References Current_Phase, EC_Signal, ErrMsgLine(), ERROR_LINE_UNKNOWN, exit(), Fatal_Error(), getpid, RC_INTERNAL_ERROR, Signal_Cleanup(), and StrSignal().

Referenced by setup_signal_handler().

Here is the call graph for this function:

BOOL Count_Limit_DevWarn ( const char *const  src_fname,
const UINT  src_line,
const UINT  limit 
)

Definition at line 1432 of file errors.cxx.

References LIMIT_STRUCT::count, dev_warn_enabled, DevWarn(), DevWarn_limit_search(), Init_Error_File(), NULL, s, Trace_File, and TRUE.

Here is the call graph for this function:

static LIMIT_STRUCT* DevWarn_limit_search ( const char *const  src_fname,
const UINT  src_line 
) [static]

Definition at line 1367 of file errors.cxx.

References LIMIT_STRUCT::count, LIMIT_STRUCT::fname, LIMIT_STRUCT::line, and NULL.

Referenced by Count_Limit_DevWarn().

void DevWarn_Toggle ( void  )

Definition at line 1461 of file errors.cxx.

References dev_warn_enabled.

Referenced by Configure().

static void Emit_Message ( char *  hmsg,
char *  emsg 
) [static]

Definition at line 617 of file errors.cxx.

References Compiler_File, Compiler_Line, Error_File, FALSE, Init_Error_File(), NULL, Trace_File, and TRUE.

Referenced by ErrMsg_Report_Nonuser(), ErrMsg_Report_User(), Fail_FmtAssertion(), and Fatal_Error().

Here is the call graph for this function:

void ErrMsg ( INT  ecode,
  ... 
)

Definition at line 1014 of file errors.cxx.

References ErrMsg_Report(), Source_File_Name, and Source_Line.

Referenced by Adjust_Opt_Level(), ID_MAP< NODE_TYPE, KEY_TYPE >::Alloc_table_space(), Allocate_Block(), Allocate_Large_Block(), check_linked_list_free(), Check_TCON(), Cleanup_Files(), Close_File(), complex_divide(), complex_sqrt(), Configure(), Configure_Alias_Options(), cwh_intrin_ieee_intrin_call_helper(), cwh_intrin_ieee_intrin_helper(), DEBUG_Configure_Alignment(), DEBUG_Push_Config(), DRA_Open_And_Map_File(), DRA_Process_Requests(), DRA_Set_Write_Location(), Em_Add_Bytes_To_Scn(), Em_Add_New_Rel(), Em_Add_New_Weak_Symbol(), Em_Add_Zeros_To_Scn(), Em_Begin_File(), Em_Define_Symbol(), Em_Get_Symbol_Name(), Em_New_Section(), Em_Set_Symbol_Binding(), Em_Undefine_Symbol(), Em_Write_Reginfo(), ID_MAP< NODE_TYPE, KEY_TYPE >::Enlarge(), Equivalent_Types(), Extract_Complex_Imag(), Extract_Complex_Real(), Extract_Quad_Hi(), Extract_Quad_Lo(), Finalize_Stack_Frame(), CLIST_NODE::Find_Next(), Gen_File_Table(), Generate_Addr_Reset(), Get_Numeric_Flag(), Get_Section_ST_With_Given_Name(), Get_Trace_Phase_Number(), Hash_TCON(), Host_To_Targ(), Host_To_Targ_Complex(), Host_To_Targ_Complex_4(), Host_To_Targ_Float(), Host_To_Targ_Float_4(), Host_To_Targ_UV(), identify_schedtype(), Increase_Data_Buffer_Size(), Increase_File_Table_Size(), Increase_Incl_Table_Size(), Initialize_Option_Group(), IPA_copy_PU(), ir_b_grow_map(), ir_size(), LNO_Configure(), LNO_Push_Config(), main(), Make_Complex(), makedepend_error(), MEM_POOL_Alloc_P(), MEM_POOL_Realloc_P(), Open_Append_File(), Open_Create_File(), Open_Output_Info(), Open_Read_File(), open_specified_input(), Prepare_Listing_File(), Prepare_Source(), Prepare_Target(), print_elf_error(), Process_Command_Line(), Process_Command_Line_Group(), Process_Trace_Option(), Read_Global_Info(), Read_Local_Info(), Realloc_Clear(), Set_Trace(), Set_Trace_File(), Set_Trace_Pu(), Set_Trace_Pu_Number(), Set_Trace_Region_Number(), data_info_s::sort_data(), Stab_Compare_Types(), Targ_Convert_Length(), Targ_Emit_Const(), Targ_fp_class(), Targ_Hexfptoc(), Targ_Is_Integral(), Targ_Is_Zero(), Targ_Print(), Targ_To_Host(), Targ_To_Host_ComplexImag(), Targ_To_Host_ComplexReal(), Targ_To_Host_Float(), Targ_To_Host_Quad(), TCON2C_translate(), W2C_Outfile_Init(), WN_close_file(), WN_close_output(), WN_write_generic_map(), WN_write_prefetch(), WN_write_PU_Infos(), WN_write_symtab(), WN_write_tree(), and write_output().

Here is the call graph for this function:

static void ErrMsg_Report ( INT  ecode,
INT  line,
const char *  file,
va_list  vp 
) [static]

Definition at line 994 of file errors.cxx.

References ED_user, ErrMsg_Report_Nonuser(), ErrMsg_Report_User(), and Find_Error_Desc().

Referenced by ErrMsg(), ErrMsgLine(), ErrMsgSrcpos(), and Fail_Assertion().

Here is the call graph for this function:

void ErrMsgLine ( INT  ecode,
INT  line,
  ... 
)

Definition at line 1026 of file errors.cxx.

References ErrMsg_Report(), and Source_File_Name.

Referenced by catch_signal(), ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

Here is the call graph for this function:

void ErrMsgSrcpos ( INT  ecode,
SRCPOS  srcpos,
  ... 
)

Definition at line 1040 of file errors.cxx.

References ErrMsg_Report(), IR_Srcpos_Filename(), NULL, and Srcpos_To_Line.

Referenced by DRA_Clone_Instantiate(), DRA_Mangle_Call_Site(), DRA_New_Clone_Sig(), DRA_Read_Pragmas_In_Block(), Fill_Align_Symbol(), and New_DRA().

Here is the call graph for this function:

void Fail_Assertion ( INT  ecode,
  ... 
)

Definition at line 1093 of file errors.cxx.

References ErrMsg_Report(), Source_File_Name, and Source_Line.

Here is the call graph for this function:

void Fatal_Error ( const char *  fmt,
  ... 
)
static ERROR_DESC* Find_Error_Desc ( INT  ecode) [static]

Definition at line 584 of file errors.cxx.

References EC_Undef_Code, ED_code, Phase_List, and Phase_Num.

Referenced by ErrMsg_Report().

Definition at line 1258 of file errors.cxx.

References Current_Phase_Number.

BOOL Get_Error_Count ( INT ErrCount,
INT WarnCount 
)

Definition at line 530 of file errors.cxx.

References Error_Count, Error_Counts, ES_WARNING, and Phase_Error.

Referenced by main().

Definition at line 1467 of file errors.cxx.

References Had_Compiler_Error.

Referenced by main().

void Handle_Signals ( void  )

Definition at line 274 of file errors.cxx.

References FPCSR_FLUSH_ZERO, get_fpc_csr(), set_fpc_csr(), setup_signal_handler(), SGI_SET_FP_PRECISE, SGI_SET_FP_PRESERVE, and syssgi().

Referenced by main(), and sgi_cmd_line().

Here is the call graph for this function:

static BOOL Init_Error_File ( void  ) [static]

Definition at line 339 of file errors.cxx.

References Error_File, Error_File_Name, FALSE, NULL, Same_File(), and TRUE.

Referenced by Count_Limit_DevWarn(), DevWarn(), and Emit_Message().

Here is the call graph for this function:

void Rag_Handle_Woff_Args ( char *  wstring)

Definition at line 1215 of file errors.cxx.

References Dont_Print_Warning, MAX, MIN, RAG_EN_FIRST, RAG_EN_LAST, and TRUE.

Referenced by DEBUG_Configure(), and Process_Command_Line().

void Set_Current_Phase_Number ( INT  phase)

Definition at line 1252 of file errors.cxx.

References Current_Phase_Number.

Referenced by Set_Error_Phase().

void Set_Error_Descriptor ( INT  phase,
ERROR_DESC descriptor 
)

Definition at line 1285 of file errors.cxx.

References error_desc_table::descriptors, FALSE, and FmtAssert.

Referenced by load_components(), and main().

void Set_Error_File ( const char *  fname)

Definition at line 312 of file errors.cxx.

References Error_File, Error_File_Name, Is_File(), NULL, and unlink.

Referenced by Cleanup_Files(), Diag_Set_File(), main(), Prepare_Source(), and sgi_cmd_line().

Here is the call graph for this function:

void Set_Error_Source ( const char *  filename)

Definition at line 386 of file errors.cxx.

References NULL, source_file_name, Source_File_Name, and strcpy.

Referenced by Cleanup_Files(), cwh_stmt_init_srcpos(), main(), and Set_Error_Srcpos().

void Set_Error_Srcpos ( SRCPOS  srcpos)

Definition at line 408 of file errors.cxx.

References IR_Srcpos_Filename(), NULL, Set_Error_Line(), Set_Error_Source(), and Srcpos_To_Line.

Here is the call graph for this function:

void Set_Error_Trace ( FILE *  stream)

Definition at line 368 of file errors.cxx.

References NULL, Same_File(), and Trace_File.

Referenced by Set_Trace_File(), and Trace_To_Stderr().

Here is the call graph for this function:

static void setup_signal_handler ( int  s) [inline, static]

Definition at line 259 of file errors.cxx.

References catch_signal().

Referenced by Handle_Signals().

Here is the call graph for this function:

const char* StrSignal ( int  sig)

Definition at line 1487 of file errors.cxx.

References NULL, and sys_siglist.

Referenced by catch_signal().


Variable Documentation

const char* Compiler_File = NULL [static]

Definition at line 118 of file errors.cxx.

Referenced by Abort_Compiler_Location(), and Emit_Message().

INT Compiler_Line = 0 [static]

Definition at line 119 of file errors.cxx.

Referenced by Abort_Compiler_Location(), and Emit_Message().

Definition at line 115 of file errors.cxx.

Referenced by ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

INT Current_Phase_Number = 0 [static]

Definition at line 1249 of file errors.cxx.

Referenced by Get_Current_Phase_Number(), and Set_Current_Phase_Number().

Definition at line 1310 of file errors.cxx.

Referenced by Count_Limit_DevWarn(), DevWarn(), and DevWarn_Toggle().

Definition at line 194 of file errors.cxx.

INT Error_Count = 0 [static]
FILE* Error_File = NULL [static]
const char* Error_File_Name = NULL [static]

Definition at line 123 of file errors.cxx.

Referenced by Init_Error_File(), Init_Error_Handler(), and Set_Error_File().

Definition at line 142 of file errors.cxx.

Referenced by ErrMsg_Report_Nonuser(), ErrMsg_Report_User(), and Had_Internal_Error().

INT Max_Errors = 100 [static]

Definition at line 140 of file errors.cxx.

Referenced by ErrMsg_Report_Nonuser(), ErrMsg_Report_User(), and Init_Error_Handler().

Initial value:
 {
    {ES_IGNORE,         "??? ", "Ignore"},
    {ES_ADVISORY,       "--- ", "Advisory"},
    {ES_WARNING,        "!!! ", "Warning"},
    {ES_CONFORMANCE,    "!!! ", "Conformance warning"},
    {ES_ERRBENIGN,      "### ", "Error"},
    {ES_ERRPHASE,       "### ", "Error"},
    {ES_ERRABORT,       "### ", "Error"}
}

Definition at line 158 of file errors.cxx.

char source_file_name[256] [static]

Definition at line 129 of file errors.cxx.

Referenced by Set_Error_Source().

Definition at line 131 of file errors.cxx.

Referenced by ErrMsg(), Fail_Assertion(), Init_Error_Handler(), and Set_Error_Line().

FILE* Trace_File = NULL [static]

Definition at line 126 of file errors.cxx.

Referenced by Count_Limit_DevWarn(), DevWarn(), Emit_Message(), and Set_Error_Trace().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines