Home | History | Annotate | Line # | Download | only in gcc
      1  1.12  mrg /* dwarf2out.h - Various declarations for functions found in dwarf2out.cc
      2  1.12  mrg    Copyright (C) 1998-2022 Free Software Foundation, Inc.
      3   1.1  mrg 
      4   1.1  mrg This file is part of GCC.
      5   1.1  mrg 
      6   1.1  mrg GCC is free software; you can redistribute it and/or modify it under
      7   1.1  mrg the terms of the GNU General Public License as published by the Free
      8   1.1  mrg Software Foundation; either version 3, or (at your option) any later
      9   1.1  mrg version.
     10   1.1  mrg 
     11   1.1  mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     12   1.1  mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13   1.1  mrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14   1.1  mrg for more details.
     15   1.1  mrg 
     16   1.1  mrg You should have received a copy of the GNU General Public License
     17   1.1  mrg along with GCC; see the file COPYING3.  If not see
     18   1.1  mrg <http://www.gnu.org/licenses/>.  */
     19   1.1  mrg 
     20   1.3  mrg #ifndef GCC_DWARF2OUT_H
     21   1.3  mrg #define GCC_DWARF2OUT_H 1
     22   1.3  mrg 
     23   1.3  mrg #include "dwarf2.h"	/* ??? Remove this once only used by dwarf2foo.c.  */
     24   1.3  mrg 
     25   1.3  mrg typedef struct die_struct *dw_die_ref;
     26   1.3  mrg typedef const struct die_struct *const_dw_die_ref;
     27   1.3  mrg 
     28   1.5  mrg typedef struct dw_val_node *dw_val_ref;
     29   1.5  mrg typedef struct dw_cfi_node *dw_cfi_ref;
     30   1.5  mrg typedef struct dw_loc_descr_node *dw_loc_descr_ref;
     31   1.3  mrg typedef struct dw_loc_list_struct *dw_loc_list_ref;
     32   1.6  mrg typedef struct dw_discr_list_node *dw_discr_list_ref;
     33   1.5  mrg typedef wide_int *wide_int_ptr;
     34   1.3  mrg 
     35   1.3  mrg 
     36   1.3  mrg /* Call frames are described using a sequence of Call Frame
     37   1.3  mrg    Information instructions.  The register number, offset
     38   1.3  mrg    and address fields are provided as possible operands;
     39   1.3  mrg    their use is selected by the opcode field.  */
     40   1.3  mrg 
     41   1.3  mrg enum dw_cfi_oprnd_type {
     42   1.3  mrg   dw_cfi_oprnd_unused,
     43   1.3  mrg   dw_cfi_oprnd_reg_num,
     44   1.3  mrg   dw_cfi_oprnd_offset,
     45   1.3  mrg   dw_cfi_oprnd_addr,
     46   1.9  mrg   dw_cfi_oprnd_loc,
     47   1.9  mrg   dw_cfi_oprnd_cfa_loc
     48   1.3  mrg };
     49   1.3  mrg 
     50   1.5  mrg typedef union GTY(()) {
     51   1.3  mrg   unsigned int GTY ((tag ("dw_cfi_oprnd_reg_num"))) dw_cfi_reg_num;
     52   1.3  mrg   HOST_WIDE_INT GTY ((tag ("dw_cfi_oprnd_offset"))) dw_cfi_offset;
     53   1.3  mrg   const char * GTY ((tag ("dw_cfi_oprnd_addr"))) dw_cfi_addr;
     54   1.5  mrg   struct dw_loc_descr_node * GTY ((tag ("dw_cfi_oprnd_loc"))) dw_cfi_loc;
     55   1.9  mrg   struct dw_cfa_location * GTY ((tag ("dw_cfi_oprnd_cfa_loc")))
     56   1.9  mrg     dw_cfi_cfa_loc;
     57   1.5  mrg } dw_cfi_oprnd;
     58   1.3  mrg 
     59   1.5  mrg struct GTY(()) dw_cfi_node {
     60   1.3  mrg   enum dwarf_call_frame_info dw_cfi_opc;
     61   1.3  mrg   dw_cfi_oprnd GTY ((desc ("dw_cfi_oprnd1_desc (%1.dw_cfi_opc)")))
     62   1.3  mrg     dw_cfi_oprnd1;
     63   1.3  mrg   dw_cfi_oprnd GTY ((desc ("dw_cfi_oprnd2_desc (%1.dw_cfi_opc)")))
     64   1.3  mrg     dw_cfi_oprnd2;
     65   1.5  mrg };
     66   1.3  mrg 
     67   1.3  mrg 
     68   1.3  mrg typedef vec<dw_cfi_ref, va_gc> *cfi_vec;
     69   1.3  mrg 
     70   1.5  mrg typedef struct dw_fde_node *dw_fde_ref;
     71   1.3  mrg 
     72   1.3  mrg /* All call frame descriptions (FDE's) in the GCC generated DWARF
     73   1.3  mrg    refer to a single Common Information Entry (CIE), defined at
     74   1.3  mrg    the beginning of the .debug_frame section.  This use of a single
     75   1.3  mrg    CIE obviates the need to keep track of multiple CIE's
     76   1.3  mrg    in the DWARF generation routines below.  */
     77   1.3  mrg 
     78   1.5  mrg struct GTY(()) dw_fde_node {
     79   1.3  mrg   tree decl;
     80   1.3  mrg   const char *dw_fde_begin;
     81   1.3  mrg   const char *dw_fde_current_label;
     82   1.3  mrg   const char *dw_fde_end;
     83   1.3  mrg   const char *dw_fde_vms_end_prologue;
     84   1.3  mrg   const char *dw_fde_vms_begin_epilogue;
     85   1.3  mrg   const char *dw_fde_second_begin;
     86   1.3  mrg   const char *dw_fde_second_end;
     87   1.3  mrg   cfi_vec dw_fde_cfi;
     88   1.3  mrg   int dw_fde_switch_cfi_index; /* Last CFI before switching sections.  */
     89   1.3  mrg   HOST_WIDE_INT stack_realignment;
     90   1.3  mrg 
     91   1.3  mrg   unsigned funcdef_number;
     92   1.3  mrg   unsigned fde_index;
     93   1.3  mrg 
     94   1.3  mrg   /* Dynamic realign argument pointer register.  */
     95   1.3  mrg   unsigned int drap_reg;
     96   1.3  mrg   /* Virtual dynamic realign argument pointer register.  */
     97   1.3  mrg   unsigned int vdrap_reg;
     98   1.3  mrg   /* These 3 flags are copied from rtl_data in function.h.  */
     99   1.3  mrg   unsigned all_throwers_are_sibcalls : 1;
    100   1.3  mrg   unsigned uses_eh_lsda : 1;
    101   1.3  mrg   unsigned nothrow : 1;
    102   1.3  mrg   /* Whether we did stack realign in this call frame.  */
    103   1.3  mrg   unsigned stack_realign : 1;
    104   1.3  mrg   /* Whether dynamic realign argument pointer register has been saved.  */
    105   1.3  mrg   unsigned drap_reg_saved: 1;
    106   1.3  mrg   /* True iff dw_fde_begin label is in text_section or cold_text_section.  */
    107   1.3  mrg   unsigned in_std_section : 1;
    108   1.3  mrg   /* True iff dw_fde_second_begin label is in text_section or
    109   1.3  mrg      cold_text_section.  */
    110   1.3  mrg   unsigned second_in_std_section : 1;
    111  1.12  mrg   /* True if Rule 18 described in dwarf2cfi.cc is in action, i.e. for dynamic
    112  1.11  mrg      stack realignment in between pushing of hard frame pointer to stack
    113  1.11  mrg      and setting hard frame pointer to stack pointer.  The register save for
    114  1.11  mrg      hard frame pointer register should be emitted only on the latter
    115  1.11  mrg      instruction.  */
    116  1.11  mrg   unsigned rule18 : 1;
    117  1.12  mrg   /* True if this function is to be ignored by debugger.  */
    118  1.12  mrg   unsigned ignored_debug : 1;
    119   1.5  mrg };
    120   1.3  mrg 
    121   1.3  mrg 
    122  1.12  mrg /* This represents a register, in DWARF_FRAME_REGNUM space, for use in CFA
    123  1.12  mrg    definitions and expressions.
    124  1.12  mrg    Most architectures only need a single register number, but some (amdgcn)
    125  1.12  mrg    have pointers that span multiple registers.  DWARF permits arbitrary
    126  1.12  mrg    register sets but existing use-cases only require contiguous register
    127  1.12  mrg    sets, as represented here.  */
    128  1.12  mrg struct GTY(()) cfa_reg {
    129  1.12  mrg   unsigned int reg;
    130  1.12  mrg   unsigned short span;
    131  1.12  mrg   unsigned short span_width;  /* A.K.A. register mode size.  */
    132  1.12  mrg 
    133  1.12  mrg   cfa_reg& set_by_dwreg (unsigned int r)
    134  1.12  mrg     {
    135  1.12  mrg       reg = r;
    136  1.12  mrg       span = 1;
    137  1.12  mrg       span_width = 0;  /* Unknown size (permitted when span == 1).  */
    138  1.12  mrg       return *this;
    139  1.12  mrg     }
    140  1.12  mrg 
    141  1.12  mrg   bool operator== (const cfa_reg &other) const
    142  1.12  mrg     {
    143  1.12  mrg       return (reg == other.reg && span == other.span
    144  1.12  mrg 	      && (span_width == other.span_width
    145  1.12  mrg 		  || (span == 1
    146  1.12  mrg 		      && (span_width == 0 || other.span_width == 0))));
    147  1.12  mrg     }
    148  1.12  mrg 
    149  1.12  mrg   bool operator!= (const cfa_reg &other) const
    150  1.12  mrg     {
    151  1.12  mrg       return !(*this == other);
    152  1.12  mrg     }
    153  1.12  mrg };
    154  1.12  mrg 
    155   1.3  mrg /* This is how we define the location of the CFA. We use to handle it
    156   1.3  mrg    as REG + OFFSET all the time,  but now it can be more complex.
    157   1.3  mrg    It can now be either REG + CFA_OFFSET or *(REG + BASE_OFFSET) + CFA_OFFSET.
    158   1.3  mrg    Instead of passing around REG and OFFSET, we pass a copy
    159   1.3  mrg    of this structure.  */
    160   1.5  mrg struct GTY(()) dw_cfa_location {
    161   1.9  mrg   poly_int64_pod offset;
    162   1.9  mrg   poly_int64_pod base_offset;
    163   1.3  mrg   /* REG is in DWARF_FRAME_REGNUM space, *not* normal REGNO space.  */
    164  1.12  mrg   struct cfa_reg reg;
    165   1.3  mrg   BOOL_BITFIELD indirect : 1;  /* 1 if CFA is accessed via a dereference.  */
    166   1.3  mrg   BOOL_BITFIELD in_use : 1;    /* 1 if a saved cfa is stored here.  */
    167   1.5  mrg };
    168   1.3  mrg 
    169   1.3  mrg 
    170   1.3  mrg /* Each DIE may have a series of attribute/value pairs.  Values
    171   1.3  mrg    can take on several forms.  The forms that are used in this
    172   1.3  mrg    implementation are listed below.  */
    173   1.3  mrg 
    174   1.3  mrg enum dw_val_class
    175   1.3  mrg {
    176   1.3  mrg   dw_val_class_none,
    177   1.3  mrg   dw_val_class_addr,
    178   1.3  mrg   dw_val_class_offset,
    179   1.3  mrg   dw_val_class_loc,
    180   1.3  mrg   dw_val_class_loc_list,
    181   1.3  mrg   dw_val_class_range_list,
    182   1.3  mrg   dw_val_class_const,
    183   1.3  mrg   dw_val_class_unsigned_const,
    184   1.3  mrg   dw_val_class_const_double,
    185   1.5  mrg   dw_val_class_wide_int,
    186   1.3  mrg   dw_val_class_vec,
    187   1.3  mrg   dw_val_class_flag,
    188   1.3  mrg   dw_val_class_die_ref,
    189   1.3  mrg   dw_val_class_fde_ref,
    190   1.3  mrg   dw_val_class_lbl_id,
    191   1.3  mrg   dw_val_class_lineptr,
    192   1.3  mrg   dw_val_class_str,
    193   1.3  mrg   dw_val_class_macptr,
    194   1.8  mrg   dw_val_class_loclistsptr,
    195   1.3  mrg   dw_val_class_file,
    196   1.3  mrg   dw_val_class_data8,
    197   1.3  mrg   dw_val_class_decl_ref,
    198   1.3  mrg   dw_val_class_vms_delta,
    199   1.6  mrg   dw_val_class_high_pc,
    200   1.6  mrg   dw_val_class_discr_value,
    201   1.8  mrg   dw_val_class_discr_list,
    202   1.8  mrg   dw_val_class_const_implicit,
    203   1.8  mrg   dw_val_class_unsigned_const_implicit,
    204   1.9  mrg   dw_val_class_file_implicit,
    205   1.9  mrg   dw_val_class_view_list,
    206   1.9  mrg   dw_val_class_symview
    207   1.3  mrg };
    208   1.3  mrg 
    209   1.3  mrg /* Describe a floating point constant value, or a vector constant value.  */
    210   1.3  mrg 
    211   1.5  mrg struct GTY(()) dw_vec_const {
    212   1.8  mrg   void * GTY((atomic)) array;
    213   1.3  mrg   unsigned length;
    214   1.3  mrg   unsigned elt_size;
    215   1.5  mrg };
    216   1.3  mrg 
    217   1.6  mrg /* Describe a single value that a discriminant can match.
    218   1.6  mrg 
    219   1.6  mrg    Discriminants (in the "record variant part" meaning) are scalars.
    220   1.6  mrg    dw_discr_list_ref and dw_discr_value are a mean to describe a set of
    221   1.6  mrg    discriminant values that are matched by a particular variant.
    222   1.6  mrg 
    223   1.6  mrg    Discriminants can be signed or unsigned scalars, and can be discriminants
    224   1.6  mrg    values.  Both have to be consistent, though.  */
    225   1.6  mrg 
    226   1.6  mrg struct GTY(()) dw_discr_value {
    227   1.6  mrg   int pos; /* Whether the discriminant value is positive (unsigned).  */
    228   1.6  mrg   union
    229   1.6  mrg     {
    230   1.6  mrg       HOST_WIDE_INT GTY ((tag ("0"))) sval;
    231   1.6  mrg       unsigned HOST_WIDE_INT GTY ((tag ("1"))) uval;
    232   1.6  mrg     }
    233   1.6  mrg   GTY ((desc ("%1.pos"))) v;
    234   1.6  mrg };
    235   1.6  mrg 
    236   1.6  mrg struct addr_table_entry;
    237   1.3  mrg 
    238   1.3  mrg /* The dw_val_node describes an attribute's value, as it is
    239   1.3  mrg    represented internally.  */
    240   1.3  mrg 
    241   1.5  mrg struct GTY(()) dw_val_node {
    242   1.3  mrg   enum dw_val_class val_class;
    243   1.6  mrg   struct addr_table_entry * GTY(()) val_entry;
    244   1.3  mrg   union dw_val_struct_union
    245   1.3  mrg     {
    246   1.3  mrg       rtx GTY ((tag ("dw_val_class_addr"))) val_addr;
    247   1.3  mrg       unsigned HOST_WIDE_INT GTY ((tag ("dw_val_class_offset"))) val_offset;
    248   1.3  mrg       dw_loc_list_ref GTY ((tag ("dw_val_class_loc_list"))) val_loc_list;
    249   1.9  mrg       dw_die_ref GTY ((tag ("dw_val_class_view_list"))) val_view_list;
    250   1.3  mrg       dw_loc_descr_ref GTY ((tag ("dw_val_class_loc"))) val_loc;
    251   1.3  mrg       HOST_WIDE_INT GTY ((default)) val_int;
    252   1.8  mrg       unsigned HOST_WIDE_INT
    253   1.8  mrg 	GTY ((tag ("dw_val_class_unsigned_const"))) val_unsigned;
    254   1.3  mrg       double_int GTY ((tag ("dw_val_class_const_double"))) val_double;
    255   1.5  mrg       wide_int_ptr GTY ((tag ("dw_val_class_wide_int"))) val_wide;
    256   1.3  mrg       dw_vec_const GTY ((tag ("dw_val_class_vec"))) val_vec;
    257   1.3  mrg       struct dw_val_die_union
    258   1.3  mrg 	{
    259   1.3  mrg 	  dw_die_ref die;
    260   1.3  mrg 	  int external;
    261   1.3  mrg 	} GTY ((tag ("dw_val_class_die_ref"))) val_die_ref;
    262   1.3  mrg       unsigned GTY ((tag ("dw_val_class_fde_ref"))) val_fde_index;
    263   1.3  mrg       struct indirect_string_node * GTY ((tag ("dw_val_class_str"))) val_str;
    264   1.3  mrg       char * GTY ((tag ("dw_val_class_lbl_id"))) val_lbl_id;
    265   1.3  mrg       unsigned char GTY ((tag ("dw_val_class_flag"))) val_flag;
    266   1.3  mrg       struct dwarf_file_data * GTY ((tag ("dw_val_class_file"))) val_file;
    267   1.8  mrg       struct dwarf_file_data *
    268   1.8  mrg 	GTY ((tag ("dw_val_class_file_implicit"))) val_file_implicit;
    269   1.3  mrg       unsigned char GTY ((tag ("dw_val_class_data8"))) val_data8[8];
    270   1.3  mrg       tree GTY ((tag ("dw_val_class_decl_ref"))) val_decl_ref;
    271   1.3  mrg       struct dw_val_vms_delta_union
    272   1.3  mrg 	{
    273   1.3  mrg 	  char * lbl1;
    274   1.3  mrg 	  char * lbl2;
    275   1.3  mrg 	} GTY ((tag ("dw_val_class_vms_delta"))) val_vms_delta;
    276   1.6  mrg       dw_discr_value GTY ((tag ("dw_val_class_discr_value"))) val_discr_value;
    277   1.6  mrg       dw_discr_list_ref GTY ((tag ("dw_val_class_discr_list"))) val_discr_list;
    278   1.9  mrg       char * GTY ((tag ("dw_val_class_symview"))) val_symbolic_view;
    279   1.3  mrg     }
    280   1.3  mrg   GTY ((desc ("%1.val_class"))) v;
    281   1.5  mrg };
    282   1.3  mrg 
    283   1.3  mrg /* Locations in memory are described using a sequence of stack machine
    284   1.3  mrg    operations.  */
    285   1.3  mrg 
    286   1.5  mrg struct GTY((chain_next ("%h.dw_loc_next"))) dw_loc_descr_node {
    287   1.3  mrg   dw_loc_descr_ref dw_loc_next;
    288   1.3  mrg   ENUM_BITFIELD (dwarf_location_atom) dw_loc_opc : 8;
    289   1.3  mrg   /* Used to distinguish DW_OP_addr with a direct symbol relocation
    290   1.3  mrg      from DW_OP_addr with a dtp-relative symbol relocation.  */
    291   1.3  mrg   unsigned int dtprel : 1;
    292   1.8  mrg   /* For DW_OP_pick, DW_OP_dup and DW_OP_over operations: true iff.
    293   1.8  mrg      it targets a DWARF prodecure argument.  In this case, it needs to be
    294   1.8  mrg      relocated according to the current frame offset.  */
    295   1.6  mrg   unsigned int frame_offset_rel : 1;
    296   1.3  mrg   int dw_loc_addr;
    297   1.3  mrg   dw_val_node dw_loc_oprnd1;
    298   1.3  mrg   dw_val_node dw_loc_oprnd2;
    299   1.5  mrg };
    300   1.3  mrg 
    301   1.6  mrg /* A variant (inside a record variant part) is selected when the corresponding
    302   1.6  mrg    discriminant matches its set of values (see the comment for dw_discr_value).
    303   1.6  mrg    The following datastructure holds such matching information.  */
    304   1.6  mrg 
    305   1.6  mrg struct GTY(()) dw_discr_list_node {
    306   1.6  mrg   dw_discr_list_ref dw_discr_next;
    307   1.6  mrg 
    308   1.6  mrg   dw_discr_value dw_discr_lower_bound;
    309   1.6  mrg   dw_discr_value dw_discr_upper_bound;
    310   1.6  mrg   /* This node represents only the value in dw_discr_lower_bound when it's
    311   1.6  mrg      zero.  It represents the range between the two fields (bounds included)
    312   1.6  mrg      otherwise.  */
    313   1.6  mrg   int dw_discr_range;
    314   1.6  mrg };
    315   1.3  mrg 
    316  1.12  mrg /* Interface from dwarf2out.cc to dwarf2cfi.cc.  */
    317   1.5  mrg extern struct dw_loc_descr_node *build_cfa_loc
    318   1.9  mrg   (dw_cfa_location *, poly_int64);
    319   1.5  mrg extern struct dw_loc_descr_node *build_cfa_aligned_loc
    320   1.9  mrg   (dw_cfa_location *, poly_int64, HOST_WIDE_INT);
    321  1.12  mrg extern struct dw_loc_descr_node *build_span_loc (struct cfa_reg);
    322   1.5  mrg extern struct dw_loc_descr_node *mem_loc_descriptor
    323   1.5  mrg   (rtx, machine_mode mode, machine_mode mem_mode,
    324   1.3  mrg    enum var_init_status);
    325   1.3  mrg extern bool loc_descr_equal_p (dw_loc_descr_ref, dw_loc_descr_ref);
    326   1.3  mrg extern dw_fde_ref dwarf2out_alloc_current_fde (void);
    327   1.3  mrg 
    328   1.3  mrg extern unsigned long size_of_locs (dw_loc_descr_ref);
    329   1.3  mrg extern void output_loc_sequence (dw_loc_descr_ref, int);
    330   1.3  mrg extern void output_loc_sequence_raw (dw_loc_descr_ref);
    331   1.3  mrg 
    332  1.12  mrg /* Interface from dwarf2cfi.cc to dwarf2out.cc.  */
    333   1.3  mrg extern void lookup_cfa_1 (dw_cfi_ref cfi, dw_cfa_location *loc,
    334   1.3  mrg 			  dw_cfa_location *remember);
    335   1.3  mrg extern bool cfa_equal_p (const dw_cfa_location *, const dw_cfa_location *);
    336   1.3  mrg 
    337   1.3  mrg extern void output_cfi (dw_cfi_ref, dw_fde_ref, int);
    338   1.3  mrg 
    339   1.3  mrg extern GTY(()) cfi_vec cie_cfi_vec;
    340   1.3  mrg 
    341   1.3  mrg /* Interface from dwarf2*.c to the rest of the compiler.  */
    342   1.3  mrg extern enum dw_cfi_oprnd_type dw_cfi_oprnd1_desc
    343   1.3  mrg   (enum dwarf_call_frame_info cfi);
    344   1.3  mrg extern enum dw_cfi_oprnd_type dw_cfi_oprnd2_desc
    345   1.3  mrg   (enum dwarf_call_frame_info cfi);
    346   1.3  mrg 
    347   1.5  mrg extern void output_cfi_directive (FILE *f, struct dw_cfi_node *cfi);
    348   1.3  mrg 
    349   1.3  mrg extern void dwarf2out_emit_cfi (dw_cfi_ref cfi);
    350   1.1  mrg 
    351   1.1  mrg extern void debug_dwarf (void);
    352   1.1  mrg struct die_struct;
    353   1.1  mrg extern void debug_dwarf_die (struct die_struct *);
    354   1.5  mrg extern void debug_dwarf_loc_descr (dw_loc_descr_ref);
    355   1.5  mrg extern void debug (die_struct &ref);
    356   1.5  mrg extern void debug (die_struct *ptr);
    357   1.1  mrg extern void dwarf2out_set_demangle_name_func (const char *(*) (const char *));
    358   1.3  mrg #ifdef VMS_DEBUGGING_INFO
    359   1.3  mrg extern void dwarf2out_vms_debug_main_pointer (void);
    360   1.3  mrg #endif
    361   1.1  mrg 
    362   1.5  mrg enum array_descr_ordering
    363   1.5  mrg {
    364   1.5  mrg   array_descr_ordering_default,
    365   1.5  mrg   array_descr_ordering_row_major,
    366   1.5  mrg   array_descr_ordering_column_major
    367   1.5  mrg };
    368   1.5  mrg 
    369   1.6  mrg #define DWARF2OUT_ARRAY_DESCR_INFO_MAX_DIMEN 16
    370   1.6  mrg 
    371   1.1  mrg struct array_descr_info
    372   1.1  mrg {
    373   1.1  mrg   int ndimensions;
    374   1.5  mrg   enum array_descr_ordering ordering;
    375   1.1  mrg   tree element_type;
    376   1.1  mrg   tree base_decl;
    377   1.1  mrg   tree data_location;
    378   1.1  mrg   tree allocated;
    379   1.1  mrg   tree associated;
    380   1.6  mrg   tree stride;
    381   1.8  mrg   tree rank;
    382   1.6  mrg   bool stride_in_bits;
    383   1.1  mrg   struct array_descr_dimen
    384   1.1  mrg     {
    385   1.5  mrg       /* GCC uses sizetype for array indices, so lower_bound and upper_bound
    386   1.5  mrg 	 will likely be "sizetype" values. However, bounds may have another
    387   1.5  mrg 	 type in the original source code.  */
    388   1.5  mrg       tree bounds_type;
    389   1.1  mrg       tree lower_bound;
    390   1.1  mrg       tree upper_bound;
    391   1.6  mrg 
    392   1.6  mrg       /* Only Fortran uses more than one dimension for array types.  For other
    393   1.6  mrg 	 languages, the stride can be rather specified for the whole array.  */
    394   1.1  mrg       tree stride;
    395   1.6  mrg     } dimen[DWARF2OUT_ARRAY_DESCR_INFO_MAX_DIMEN];
    396   1.6  mrg };
    397   1.6  mrg 
    398   1.6  mrg enum fixed_point_scale_factor
    399   1.6  mrg {
    400   1.6  mrg   fixed_point_scale_factor_binary,
    401   1.6  mrg   fixed_point_scale_factor_decimal,
    402   1.6  mrg   fixed_point_scale_factor_arbitrary
    403   1.6  mrg };
    404   1.6  mrg 
    405   1.6  mrg struct fixed_point_type_info
    406   1.6  mrg {
    407  1.12  mrg   /* The scale factor is the value one has to multiply the actual data with
    408  1.12  mrg      to get the fixed point value.  We support three ways to encode it.  */
    409   1.6  mrg   enum fixed_point_scale_factor scale_factor_kind;
    410   1.6  mrg   union
    411   1.6  mrg     {
    412  1.12  mrg       /* For a binary scale factor, the scale factor is 2 ** binary.  */
    413   1.6  mrg       int binary;
    414  1.12  mrg       /* For a decimal scale factor, the scale factor is 10 ** decimal.  */
    415   1.6  mrg       int decimal;
    416  1.12  mrg       /* For an arbitrary scale factor, the scale factor is the ratio
    417   1.6  mrg 	 numerator / denominator.  */
    418  1.12  mrg       struct { tree numerator; tree denominator; } arbitrary;
    419   1.6  mrg     } scale_factor;
    420   1.1  mrg };
    421   1.3  mrg 
    422  1.12  mrg void dwarf2out_cc_finalize (void);
    423  1.12  mrg 
    424  1.12  mrg /* Some DWARF internals are exposed for the needs of DWARF-based debug
    425  1.12  mrg    formats.  */
    426  1.12  mrg 
    427  1.12  mrg /* Each DIE attribute has a field specifying the attribute kind,
    428  1.12  mrg    a link to the next attribute in the chain, and an attribute value.
    429  1.12  mrg    Attributes are typically linked below the DIE they modify.  */
    430  1.12  mrg 
    431  1.12  mrg typedef struct GTY(()) dw_attr_struct {
    432  1.12  mrg   enum dwarf_attribute dw_attr;
    433  1.12  mrg   dw_val_node dw_attr_val;
    434  1.12  mrg }
    435  1.12  mrg dw_attr_node;
    436  1.12  mrg 
    437  1.12  mrg extern dw_attr_node *get_AT (dw_die_ref, enum dwarf_attribute);
    438  1.12  mrg extern HOST_WIDE_INT AT_int (dw_attr_node *);
    439  1.12  mrg extern unsigned HOST_WIDE_INT AT_unsigned (dw_attr_node *a);
    440  1.12  mrg extern dw_loc_descr_ref AT_loc (dw_attr_node *);
    441  1.12  mrg extern dw_die_ref get_AT_ref (dw_die_ref, enum dwarf_attribute);
    442  1.12  mrg extern const char *get_AT_string (dw_die_ref, enum dwarf_attribute);
    443  1.12  mrg extern enum dw_val_class AT_class (dw_attr_node *);
    444  1.12  mrg extern unsigned HOST_WIDE_INT AT_unsigned (dw_attr_node *);
    445  1.12  mrg extern unsigned get_AT_unsigned (dw_die_ref, enum dwarf_attribute);
    446  1.12  mrg extern int get_AT_flag (dw_die_ref, enum dwarf_attribute);
    447  1.12  mrg 
    448  1.12  mrg extern void add_name_attribute (dw_die_ref, const char *);
    449  1.12  mrg 
    450  1.12  mrg extern dw_die_ref new_die_raw (enum dwarf_tag);
    451  1.12  mrg extern dw_die_ref base_type_die (tree, bool);
    452  1.12  mrg 
    453  1.12  mrg extern dw_die_ref lookup_decl_die (tree);
    454  1.12  mrg extern dw_die_ref lookup_type_die (tree);
    455  1.12  mrg 
    456  1.12  mrg extern dw_die_ref dw_get_die_child (dw_die_ref);
    457  1.12  mrg extern dw_die_ref dw_get_die_sib (dw_die_ref);
    458  1.12  mrg extern enum dwarf_tag dw_get_die_tag (dw_die_ref);
    459  1.12  mrg 
    460  1.12  mrg /* Data about a single source file.  */
    461  1.12  mrg struct GTY((for_user)) dwarf_file_data {
    462  1.12  mrg   const char * key;
    463  1.12  mrg   const char * filename;
    464  1.12  mrg   int emitted_number;
    465  1.12  mrg };
    466  1.12  mrg 
    467  1.12  mrg extern struct dwarf_file_data *get_AT_file (dw_die_ref,
    468  1.12  mrg 					    enum dwarf_attribute);
    469   1.5  mrg 
    470   1.3  mrg #endif /* GCC_DWARF2OUT_H */
    471