osprey/be/cg/MIPS/cgdwarf_targ.cxx File Reference

#include <stdio.h>
#include <stdlib.h>
#include "libelf/libelf.h"
#include <sys/unwindP.h>
#include <list>
#include "elf_stuff.h"
#include <elfaccess.h>
#include "dwarf.h"
#include "defs.h"
#include "erglob.h"
#include "glob.h"
#include "flags.h"
#include "tracing.h"
#include "em_elf.h"
#include "em_dwarf.h"
#include "config.h"
#include "config_asm.h"
#include "cgir.h"
#include "register.h"
#include "cgtarget.h"
#include "calls.h"
#include "stblock.h"
#include "data_layout.h"
#include "cg_spill.h"
#include "cgdwarf.h"
#include "cgdwarf_targ.h"
#include "dwarf_incl.h"
#include "pro_opaque.h"
#include "pro_frame.h"
#include "be_util.h"

Include dependency graph for cgdwarf_targ.cxx:

Go to the source code of this file.

Defines

#define FD_S0   0
#define FD_S1   1
#define FD_S2   2
#define FD_S3   3
#define FD_S4   4
#define FD_S5   5
#define FD_S6   6
#define FD_S7   7
#define FD_GP   9
#define FD_JA   11
#define FD_F20   12
#define FD_F21   13
#define FD_F22   14
#define FD_F23   15
#define FD_F24   16
#define FD_F25   17
#define FD_F26   18
#define FD_F27   19
#define FD_F28   20
#define FD_F29   21
#define FD_F30   22
#define FD_F31   23
#define FD_R0   0
#define FD_RA   FD_R0
#define FD_R1   1
#define FD_R2   2
#define FD_SL   FD_R2
#define FD_R3   3
#define FD_R4   4
#define FD_R5   5
#define FD_R6   6
#define FD_R7   7
#define FD_R8   8
#define FD_R9   9
#define FD_R10   10
#define FD_R11   11
#define FD_R12   12
#define FD_R13   13
#define FD_R14   14
#define FD_R15   15
#define FD_R16   16
#define FD_R17   17
#define FD_R18   18
#define FD_R19   19
#define FD_R20   20
#define FD_R21   21
#define FD_R22   22
#define FD_R23   23
#define FD_R24   24
#define FD_R25   25
#define FD_R26   26
#define FD_R27   27
#define FD_CFA   28
#define FD_R29   29
#define FD_R30   30
#define FD_S8   FD_R30
#define FD_R31   31
#define FD_FIRST   FD_R0
#define FD_LAST   32
#define AS_4BYTE   ".4byte"
#define AS_1BYTE   ".byte"
#define AS_ASCII   ".ascii"
#define AS_ULEBW   ".uleb128"
#define AS_SLEBW   ".sleb128"
#define LOCAL_STATE(bb)   (local_state[BB_id(bb)])
#define ENTRY_STATE(bb)   (entry_state[BB_id(bb)])
#define EXIT_STATE(bb)   (exit_state[BB_id(bb)])

Typedefs

typedef UINT32 FD_REG

Enumerations

enum  CGD_STATES {
  DS_In_Register, DS_In_Memory, DS_CFA_Is_SP, DS_CFA_Is_Adj_SP,
  DS_CFA_Is_FP, DS_CFA_Last, DS_In_Register, DS_In_Memory,
  DS_CFA_Is_SP, DS_CFA_Is_Adj_SP, DS_CFA_Is_FP, DS_CFA_Last
}

Functions/Subroutines

static void CIE_dump2asm (Dwarf_P_Cie cie)
static void FDE_dump2asm (INT low_pc, INT high_pc)
static void CIE_end_dump2asm (void)
static void FDE_end_dump2asm (void)
static INT CFA_dump2asm (Dwarf_Small dw_op, Dwarf_Unsigned op1, Dwarf_Unsigned op2)
static Dwarf_P_Fde Add_Fde_Inst (Dwarf_P_Fde fde, Dwarf_Small dw_op, Dwarf_Unsigned op1, Dwarf_Unsigned op2)
static Dwarf_P_Fde update_state (Dwarf_P_Fde fde, FD_REG fd_reg, CGD_STATES *current_state, CGD_STATES new_state)
static FD_REG Machine_Reg_To_FD (TN *tn, UINT32 mc_id, ISA_REGISTER_CLASS c)
void dump_tn (TN *)
static FD_REG Save_TN_to_fd (TN *tn)
static FD_REG TN_to_fd (TN *tn)
static void Compute_Reg_State (BB *firstbb)
static BOOL Has_Matching_Load_In_BB (BB *bb, TN *dest, TN *spill)
static BOOL Has_Matching_Store_In_BB (BB *bb, TN *dest, TN *spill)
Dwarf_P_Fde Build_Fde_For_Proc (Dwarf_P_Debug dw_dbg, BB *firstbb, LABEL_IDX begin_label, LABEL_IDX end_label, INT end_offset, INT low_pc, INT high_pc)
static BOOL Is_Unwind_Simple (void)
void Init_Unwind_Info (BOOL trace)
void Finalize_Unwind_Info (void)
void Emit_Unwind_Directives_For_OP (OP *op, FILE *f)
void Check_Dwarf_Rel (Elf32_Rel const &current_reloc)
void Check_Dwarf_Rel (Elf64_AltRel const &current_reloc)
void Check_Dwarf_Rela (const Elf64_AltRela &current_reloc)
void Check_Dwarf_Rela (const Elf32_Rela &current_reloc)
BOOL Is_Dwarf_Section_To_Emit (const char *name)

Variables

static Dwarf_Error dw_error
static BOOL Trace_Unwind = TRUE
static UINT last_when
static BOOL simple_unwind = FALSE
static BOOL has_asm = FALSE
static UINT last_label = 0
static BOOL has_create = FALSE
static const UINT32 fd_to_track [FD_LAST]
static const UINT32 fd_to_dwarf [FD_LAST]
static STfd_to_spill_loc [FD_LAST]
static STcurr_fd_to_spill_loc [FD_LAST]
static STprev_fd_to_spill_loc [FD_LAST]
static const char * CGD_Name [DS_CFA_Last]
static char * fmt_string = "\t%s\t0x%x\n"
static INT unw_info_pu_start_count
static INT32 curloc
static INT32 lastloc
static INTlocal_state
static INTentry_state
static INTexit_state
static char * drop_these []


Define Documentation

#define AS_1BYTE   ".byte"

Definition at line 167 of file cgdwarf_targ.cxx.

Referenced by CFA_dump2asm(), and CIE_dump2asm().

#define AS_4BYTE   ".4byte"

Definition at line 166 of file cgdwarf_targ.cxx.

Referenced by CFA_dump2asm(), CIE_dump2asm(), and FDE_dump2asm().

#define AS_ASCII   ".ascii"

Definition at line 168 of file cgdwarf_targ.cxx.

Referenced by CIE_dump2asm().

#define AS_SLEBW   ".sleb128"

Definition at line 170 of file cgdwarf_targ.cxx.

Referenced by CIE_dump2asm().

#define AS_ULEBW   ".uleb128"

Definition at line 169 of file cgdwarf_targ.cxx.

Referenced by CFA_dump2asm(), and CIE_dump2asm().

#define ENTRY_STATE ( bb   )     (entry_state[BB_id(bb)])

Definition at line 561 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc(), and Compute_Reg_State().

#define EXIT_STATE ( bb   )     (exit_state[BB_id(bb)])

Definition at line 562 of file cgdwarf_targ.cxx.

Referenced by Compute_Reg_State().

#define FD_CFA   28

Definition at line 109 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc(), and update_state().

#define FD_F20   12

Definition at line 47 of file cgdwarf_targ.cxx.

Referenced by Machine_Reg_To_FD().

#define FD_F21   13

Definition at line 48 of file cgdwarf_targ.cxx.

#define FD_F22   14

Definition at line 49 of file cgdwarf_targ.cxx.

#define FD_F23   15

Definition at line 50 of file cgdwarf_targ.cxx.

#define FD_F24   16

Definition at line 51 of file cgdwarf_targ.cxx.

#define FD_F25   17

Definition at line 52 of file cgdwarf_targ.cxx.

#define FD_F26   18

Definition at line 53 of file cgdwarf_targ.cxx.

#define FD_F27   19

Definition at line 54 of file cgdwarf_targ.cxx.

#define FD_F28   20

Definition at line 55 of file cgdwarf_targ.cxx.

#define FD_F29   21

Definition at line 56 of file cgdwarf_targ.cxx.

#define FD_F30   22

Definition at line 57 of file cgdwarf_targ.cxx.

#define FD_F31   23

Definition at line 58 of file cgdwarf_targ.cxx.

#define FD_FIRST   FD_R0

Definition at line 114 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc().

#define FD_GP   9

Definition at line 43 of file cgdwarf_targ.cxx.

Referenced by Machine_Reg_To_FD().

#define FD_JA   11

Definition at line 45 of file cgdwarf_targ.cxx.

Referenced by Machine_Reg_To_FD().

#define FD_LAST   32

Definition at line 115 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc().

#define FD_R0   0

Definition at line 79 of file cgdwarf_targ.cxx.

#define FD_R1   1

Definition at line 81 of file cgdwarf_targ.cxx.

#define FD_R10   10

Definition at line 91 of file cgdwarf_targ.cxx.

#define FD_R11   11

Definition at line 92 of file cgdwarf_targ.cxx.

#define FD_R12   12

Definition at line 93 of file cgdwarf_targ.cxx.

#define FD_R13   13

Definition at line 94 of file cgdwarf_targ.cxx.

#define FD_R14   14

Definition at line 95 of file cgdwarf_targ.cxx.

#define FD_R15   15

Definition at line 96 of file cgdwarf_targ.cxx.

#define FD_R16   16

Definition at line 97 of file cgdwarf_targ.cxx.

#define FD_R17   17

Definition at line 98 of file cgdwarf_targ.cxx.

#define FD_R18   18

Definition at line 99 of file cgdwarf_targ.cxx.

#define FD_R19   19

Definition at line 100 of file cgdwarf_targ.cxx.

#define FD_R2   2

Definition at line 82 of file cgdwarf_targ.cxx.

#define FD_R20   20

Definition at line 101 of file cgdwarf_targ.cxx.

#define FD_R21   21

Definition at line 102 of file cgdwarf_targ.cxx.

#define FD_R22   22

Definition at line 103 of file cgdwarf_targ.cxx.

#define FD_R23   23

Definition at line 104 of file cgdwarf_targ.cxx.

#define FD_R24   24

Definition at line 105 of file cgdwarf_targ.cxx.

#define FD_R25   25

Definition at line 106 of file cgdwarf_targ.cxx.

#define FD_R26   26

Definition at line 107 of file cgdwarf_targ.cxx.

#define FD_R27   27

Definition at line 108 of file cgdwarf_targ.cxx.

#define FD_R29   29

Definition at line 110 of file cgdwarf_targ.cxx.

#define FD_R3   3

Definition at line 84 of file cgdwarf_targ.cxx.

#define FD_R30   30

Definition at line 111 of file cgdwarf_targ.cxx.

#define FD_R31   31

Definition at line 113 of file cgdwarf_targ.cxx.

#define FD_R4   4

Definition at line 85 of file cgdwarf_targ.cxx.

#define FD_R5   5

Definition at line 86 of file cgdwarf_targ.cxx.

#define FD_R6   6

Definition at line 87 of file cgdwarf_targ.cxx.

#define FD_R7   7

Definition at line 88 of file cgdwarf_targ.cxx.

#define FD_R8   8

Definition at line 89 of file cgdwarf_targ.cxx.

#define FD_R9   9

Definition at line 90 of file cgdwarf_targ.cxx.

#define FD_RA   FD_R0

Definition at line 80 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc(), Machine_Reg_To_FD(), and update_state().

#define FD_S0   0

Definition at line 34 of file cgdwarf_targ.cxx.

Referenced by Machine_Reg_To_FD().

#define FD_S1   1

Definition at line 35 of file cgdwarf_targ.cxx.

#define FD_S2   2

Definition at line 36 of file cgdwarf_targ.cxx.

#define FD_S3   3

Definition at line 37 of file cgdwarf_targ.cxx.

#define FD_S4   4

Definition at line 38 of file cgdwarf_targ.cxx.

#define FD_S5   5

Definition at line 39 of file cgdwarf_targ.cxx.

#define FD_S6   6

Definition at line 40 of file cgdwarf_targ.cxx.

#define FD_S7   7

Definition at line 41 of file cgdwarf_targ.cxx.

#define FD_S8   FD_R30

Definition at line 112 of file cgdwarf_targ.cxx.

Referenced by Compute_Reg_State(), and Machine_Reg_To_FD().

#define FD_SL   FD_R2

Definition at line 83 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc(), Compute_Reg_State(), and update_state().

#define LOCAL_STATE ( bb   )     (local_state[BB_id(bb)])

Definition at line 560 of file cgdwarf_targ.cxx.

Referenced by Compute_Reg_State().


Typedef Documentation

typedef UINT32 FD_REG

Definition at line 117 of file cgdwarf_targ.cxx.


Enumeration Type Documentation

enum CGD_STATES

Enumerator:
DS_In_Register 
DS_In_Memory 
DS_CFA_Is_SP 
DS_CFA_Is_Adj_SP 
DS_CFA_Is_FP 
DS_CFA_Last 
DS_In_Register 
DS_In_Memory 
DS_CFA_Is_SP 
DS_CFA_Is_Adj_SP 
DS_CFA_Is_FP 
DS_CFA_Last 

Definition at line 148 of file cgdwarf_targ.cxx.


Function Documentation

static Dwarf_P_Fde Add_Fde_Inst ( Dwarf_P_Fde  fde,
Dwarf_Small  dw_op,
Dwarf_Unsigned  op1,
Dwarf_Unsigned  op2 
) [static]

Dwarf_P_Fde Build_Fde_For_Proc ( Dwarf_P_Debug  dw_dbg,
BB firstbb,
LABEL_IDX  begin_label,
LABEL_IDX  end_label,
INT  end_offset,
INT  low_pc,
INT  high_pc 
)

static INT CFA_dump2asm ( Dwarf_Small  dw_op,
Dwarf_Unsigned  op1,
Dwarf_Unsigned  op2 
) [static]

void Check_Dwarf_Rel ( Elf64_AltRel const &  current_reloc  ) 

Definition at line 1146 of file cgdwarf_targ.cxx.

References FmtAssert, R_IA_64_DIR64MSB, and REL64_type.

void Check_Dwarf_Rel ( Elf32_Rel const &  current_reloc  ) 

Definition at line 1138 of file cgdwarf_targ.cxx.

References FmtAssert, R_IA_64_DIR32MSB, and REL32_type.

void Check_Dwarf_Rela ( const Elf32_Rela current_reloc  ) 

Definition at line 1162 of file cgdwarf_targ.cxx.

References FALSE, FmtAssert, and REL32_type.

void Check_Dwarf_Rela ( const Elf64_AltRela current_reloc  ) 

Definition at line 1154 of file cgdwarf_targ.cxx.

References FALSE, FmtAssert, and REL64_type.

static void CIE_dump2asm ( Dwarf_P_Cie  cie  )  [static]

static void CIE_end_dump2asm ( void   )  [static]

Definition at line 224 of file cgdwarf_targ.cxx.

References Asm_File, Current_PU_Count(), and fprintf().

Referenced by Build_Fde_For_Proc().

static void Compute_Reg_State ( BB firstbb  )  [static]

void dump_tn ( TN  ) 

Definition at line 1121 of file tnutil.cxx.

void Emit_Unwind_Directives_For_OP ( OP op,
FILE f 
)

Definition at line 1133 of file cgdwarf_targ.cxx.

static void FDE_dump2asm ( INT  low_pc,
INT  high_pc 
) [static]

static void FDE_end_dump2asm ( void   )  [static]

Definition at line 232 of file cgdwarf_targ.cxx.

References Asm_File, Current_PU_Count(), and fprintf().

Referenced by Build_Fde_For_Proc().

void Finalize_Unwind_Info ( void   ) 

Definition at line 1127 of file cgdwarf_targ.cxx.

static BOOL Has_Matching_Load_In_BB ( BB bb,
TN dest,
TN spill 
) [static]

static BOOL Has_Matching_Store_In_BB ( BB bb,
TN dest,
TN spill 
) [static]

Definition at line 671 of file cgdwarf_targ.cxx.

References BB_first_op, CLASS_REG_PAIR_EqualP, FALSE, OP_next, OP_opnd, OP_store, TN_class_reg, and TRUE.

Referenced by Build_Fde_For_Proc().

void Init_Unwind_Info ( BOOL  trace  ) 

BOOL Is_Dwarf_Section_To_Emit ( const char *  name  ) 

Definition at line 1184 of file cgdwarf_targ.cxx.

References FALSE, strcmp(), and TRUE.

static BOOL Is_Unwind_Simple ( void   )  [static]

Definition at line 1074 of file cgdwarf_targ.cxx.

References BB_entry, BB_exit, BB_next, BB_prev, FALSE, has_asm, NULL, TRUE, ue_iter, and ue_list.

static FD_REG Machine_Reg_To_FD ( TN tn,
UINT32  mc_id,
ISA_REGISTER_CLASS  c 
) [static]

static FD_REG Save_TN_to_fd ( TN tn  )  [static]

static FD_REG TN_to_fd ( TN tn  )  [static]

Definition at line 544 of file cgdwarf_targ.cxx.

References Machine_Reg_To_FD(), NULL, TN_register, TN_register_class, TN_spill, and UINT32.

Referenced by Build_Fde_For_Proc().

static Dwarf_P_Fde update_state ( Dwarf_P_Fde  fde,
FD_REG  fd_reg,
CGD_STATES current_state,
CGD_STATES  new_state 
) [static]


Variable Documentation

const char* CGD_Name[DS_CFA_Last] [static]

Initial value:

 {
   "DS_In_Register",
   "DS_In_Memory",
   "DS_CFA_Is_SP",
   "DS_CFA_Is_Adj_SP",
   "DS_CFA_Is_FP"
}

Definition at line 157 of file cgdwarf_targ.cxx.

Referenced by update_state().

INT32 curloc [static]

Definition at line 291 of file cgdwarf_targ.cxx.

Referenced by Add_Fde_Inst(), Build_Fde_For_Proc(), i_tem(), and update_state().

ST* curr_fd_to_spill_loc[FD_LAST] [static]

Definition at line 142 of file cgdwarf_targ.cxx.

char* drop_these[] [static]

Initial value:

 {
      
      
  ".debug_line",
     
     
  ".debug_weaknames",
  ".debug_varnames",
  ".debug_typenames",
  ".debug_funcnames",
     
  ".debug_frame",
  0
}

Definition at line 1169 of file cgdwarf_targ.cxx.

Definition at line 65 of file cgdwarf_targ.cxx.

INT * entry_state [static]

Definition at line 558 of file cgdwarf_targ.cxx.

Referenced by Do_Control_Flow_Analysis_Of_Unwind_Info().

INT * exit_state [static]

Definition at line 558 of file cgdwarf_targ.cxx.

Referenced by Do_Control_Flow_Analysis_Of_Unwind_Info().

const UINT32 fd_to_dwarf[FD_LAST] [static]

ST* fd_to_spill_loc[FD_LAST] [static]

Definition at line 141 of file cgdwarf_targ.cxx.

const UINT32 fd_to_track[FD_LAST] [static]

Initial value:

 {
  
  
  
  1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0,
}

Definition at line 119 of file cgdwarf_targ.cxx.

Referenced by Build_Fde_For_Proc(), and update_state().

char* fmt_string = "\t%s\t0x%x\n" [static]

BOOL has_asm = FALSE [static]

Definition at line 69 of file cgdwarf_targ.cxx.

BOOL has_create = FALSE [static]

Definition at line 71 of file cgdwarf_targ.cxx.

UINT last_label = 0 [static]

Definition at line 70 of file cgdwarf_targ.cxx.

UINT last_when [static]

Definition at line 67 of file cgdwarf_targ.cxx.

INT32 lastloc [static]

Definition at line 291 of file cgdwarf_targ.cxx.

Referenced by Add_Fde_Inst(), Build_Fde_For_Proc(), and update_state().

INT* local_state [static]

Definition at line 558 of file cgdwarf_targ.cxx.

ST* prev_fd_to_spill_loc[FD_LAST] [static]

Definition at line 144 of file cgdwarf_targ.cxx.

BOOL simple_unwind = FALSE [static]

Definition at line 68 of file cgdwarf_targ.cxx.

BOOL Trace_Unwind = TRUE [static]

Definition at line 66 of file cgdwarf_targ.cxx.

Definition at line 172 of file cgdwarf_targ.cxx.

Referenced by CIE_dump2asm(), and FDE_dump2asm().


Generated on Wed Apr 8 14:26:55 2009 for Open64 by  doxygen 1.5.6