GCC Middle and Back End API Reference
dwarf2asm.c File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "flags.h"
#include "tree.h"
#include "rtl.h"
#include "output.h"
#include "target.h"
#include "dwarf2asm.h"
#include "dwarf2.h"
#include "splay-tree.h"
#include "ggc.h"
#include "tm_p.h"
#include "gt-dwarf2asm.h"
Include dependency graph for dwarf2asm.c:

Macros

#define S(p, v)   case p: return v;
#define USE_LINKONCE_INDIRECT   0

Functions

void dw2_assemble_integer ()
void dw2_asm_output_data_raw ()
void dw2_asm_output_data (int size, unsigned HOST_WIDE_INT value, const char *comment,...)
void dw2_asm_output_delta (int size, const char *lab1, const char *lab2, const char *comment,...)
void dw2_asm_output_vms_delta (int size, const char *lab1, const char *lab2, const char *comment,...)
void dw2_asm_output_offset (int size, const char *label, section *base, const char *comment,...)
void dw2_asm_output_addr (int size, const char *label, const char *comment,...)
void dw2_asm_output_addr_rtx (int size, rtx addr, const char *comment,...)
void dw2_asm_output_nstring (const char *str, size_t orig_len, const char *comment,...)
int size_of_uleb128 ()
int size_of_sleb128 ()
int size_of_encoded_value ()
const char * eh_data_format_name ()
void dw2_asm_output_data_uleb128_raw ()
void dw2_asm_output_data_uleb128 (unsigned HOST_WIDE_INT value, const char *comment,...)
void dw2_asm_output_data_sleb128_raw ()
void dw2_asm_output_data_sleb128 (HOST_WIDE_INT value, const char *comment,...)
void dw2_asm_output_delta_uleb128 (const char *lab1, const char *lab2, const char *comment,...)
static int dw2_output_indirect_constant_1 (splay_tree_node, void *)
static int splay_tree_compare_strings ()
rtx dw2_force_const_mem ()
void dw2_output_indirect_constants ()
void dw2_asm_output_encoded_addr_rtx (int encoding, rtx addr, bool is_public, const char *comment,...)

Variables

static splay_tree indirect_pool
static int dw2_const_labelno

Macro Definition Documentation

#define S (   p,
 
)    case p: return v;
#define USE_LINKONCE_INDIRECT   0

Function Documentation

void dw2_asm_output_addr ( int  size,
const char *  label,
const char *  comment,
  ... 
)

Output an absolute reference to a label.

Referenced by add_AT_pubnames(), output_aranges(), and want_pubnames().

void dw2_asm_output_addr_rtx ( int  size,
rtx  addr,
const char *  comment,
  ... 
)

Similar, but use an RTX expression instead of a text label.

void dw2_asm_output_data ( int  size,
unsigned HOST_WIDE_INT  value,
const char *  comment,
  ... 
)

Output an immediate constant in a given SIZE in bytes.

Referenced by add_pubtype(), calc_die_sizes(), output_aranges(), output_die(), output_ranges(), schedule_generic_params_dies_gen(), and size_of_aranges().

void dw2_asm_output_data_raw ( )

Output a value of a given size in target byte order.

void dw2_asm_output_data_sleb128 ( HOST_WIDE_INT  value,
const char *  comment,
  ... 
)

Output a signed LEB128 quantity.

arithmetic shift

References assemble_integer(), BITS_PER_UNIT, and GEN_INT.

Referenced by output_aranges(), and size_of_aranges().

void dw2_asm_output_data_sleb128_raw ( )

Output an signed LEB128 quantity, but only the byte values.

References ASM_COMMENT_START, HOST_WIDE_INT, HOST_WIDE_INT_PRINT_DEC, and targetm.

void dw2_asm_output_data_uleb128 ( unsigned HOST_WIDE_INT  value,
const char *  comment,
  ... 
)

Output an unsigned LEB128 quantity.

More bytes to follow.

Referenced by calc_die_sizes(), include_pubname_in_output(), output_aranges(), size_of_aranges(), and size_of_pubnames().

void dw2_asm_output_data_uleb128_raw ( )

Output an unsigned LEB128 quantity, but only the byte values.

More bytes to follow.

References ASM_COMMENT_START, fprint_whex(), HOST_WIDE_INT, and targetm.

Referenced by output_cfi().

void dw2_asm_output_delta ( int  size,
const char *  lab1,
const char *  lab2,
const char *  comment,
  ... 
)

Output the difference between two symbols in a given size. ??? There appear to be assemblers that do not like such subtraction, but do support ASM_SET_OP. It's unfortunately impossible to do here, since the ASM_SET_OP for the difference symbol must appear after both symbols are defined.

Referenced by add_AT_pubnames(), calc_die_sizes(), unmark_all_dies(), and want_pubnames().

void dw2_asm_output_delta_uleb128 ( const char *  lab1,
const char *  lab2,
const char *  comment,
  ... 
)
void dw2_asm_output_encoded_addr_rtx ( int  encoding,
rtx  addr,
bool  is_public,
const char *  comment,
  ... 
)

Like dw2_asm_output_addr_rtx, but encode the pointer as directed. If PUBLIC is set and the encoding is DW_EH_PE_indirect, the indirect reference is shared across the entire application (or DSO).

 NULL is <em>always</em> represented as a plain zero, as is 1 for Ada's
 "all others".   
     Allow the target first crack at emitting this.  Some of the
     special relocations require special directives instead of
     just ".4byte" or whatever.   
     Indirection is used to get dynamic relocations out of a
     read-only section.   
         It is very tempting to use force_const_mem so that we share data
         with the normal constant pool.  However, we've already emitted
         the constant pool for this function.  Moreover, we'd like to
         share these constants across the entire unit of translation and
         even, if possible, across the entire application (or DSO).   
         Other encodings should have been handled by
         ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX.   

References dw2_force_const_mem().

void dw2_asm_output_nstring ( const char *  str,
size_t  orig_len,
const char *  comment,
  ... 
)

Output the first ORIG_LEN characters of STR as a string. If ORIG_LEN is equal to -1, ignore this parameter and output the entire STR instead. If COMMENT is not NULL and comments in the debug information have been requested by the user, append the given COMMENT to the generated output.

If an explicit length was given, we can't assume there is a null termination in the string buffer.

References ASM_COMMENT_START.

void dw2_asm_output_offset ( int  size,
const char *  label,
section base,
const char *  comment,
  ... 
)

Output a section-relative reference to a LABEL, which was placed in BASE. In general this can only be done for debugging symbols. E.g. on most targets with the GNU linker, this is accomplished with a direct reference and the knowledge that the debugging section will be placed at VMA 0. Some targets have special relocations for this that we must use.

Referenced by output_die(), and unmark_all_dies().

void dw2_asm_output_vms_delta ( int  size,
const char *  lab1,
const char *  lab2,
const char *  comment,
  ... 
)

Output the difference between two symbols in instruction units in a given size.

VMS Delta is only special on ia64-vms, but this function also gets called on alpha-vms so it has to do something sane.

void dw2_assemble_integer ( )

Dwarf2 assembler output helper routines. Copyright (C) 2001-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. Output an unaligned integer with the given value and size. Prefer not to print a newline, since the caller may want to add a comment.

rtx dw2_force_const_mem ( )

Put X, a SYMBOL_REF, in memory. Return a SYMBOL_REF to the allocated memory. Differs from force_const_mem in that a single pool is used for the entire unit of translation, and the memory is not guaranteed to be "near" the function in any interesting sense. IS_PUBLIC controls whether the symbol can be shared across the entire application (or DSO).

We use strcmp, rather than just comparing pointers, so that the sort order will not depend on the host system.

Referenced by dw2_asm_output_encoded_addr_rtx().

static int dw2_output_indirect_constant_1 ( splay_tree_node  node,
void *  data 
)
static

A helper function for dw2_output_indirect_constants called through splay_tree_foreach. Emit one queued constant to memory.

void dw2_output_indirect_constants ( void  )

Emit the constants queued through dw2_force_const_mem.

const char* eh_data_format_name ( )

Yield a name for a given pointer encoding.

int size_of_encoded_value ( )

Given an encoding, return the number of bytes the format occupies. This is only defined for fixed-size encodings, and so does not include leb128.

int size_of_sleb128 ( )

Return the size of a signed LEB128 quantity.

References BITS_PER_UNIT, gcc_unreachable, and POINTER_SIZE.

int size_of_uleb128 ( )

Return the size of an unsigned LEB128 quantity.

Referenced by clone_tree_hash(), copy_decls_walk(), and loc_descr_equal_p_1().

static int splay_tree_compare_strings ( )
static

Comparison function for a splay tree in which the keys are strings. K1 and K2 have the dynamic type "const char *". Returns <0, 0, or >0 to indicate whether K1 is less than, equal to, or greater than K2, respectively.

The strings are always those from IDENTIFIER_NODEs, and, therefore, we should never have two copies of the same string.

References gcc_assert, GET_CODE, splay_tree_new_ggc, targetm, USE_LINKONCE_INDIRECT, and XSTR.


Variable Documentation

int dw2_const_labelno
static
splay_tree indirect_pool
static