GCC Middle and Back End API Reference
print-tree.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "cgraph.h"
#include "diagnostic.h"
#include "varasm.h"
#include "print-rtl.h"
#include "stor-layout.h"
#include "langhooks.h"
#include "tree-iterator.h"
#include "gimple-pretty-print.h"
#include "tree-cfg.h"
#include "dumpfile.h"
#include "print-tree.h"
#include "file-prefix-map.h"
Include dependency graph for print-tree.cc:

Macros

#define HASH_SIZE   37
 

Functions

void dump_addr (FILE *file, const char *prefix, const void *addr)
 
static void print_real_cst (FILE *file, const_tree node, bool brief)
 
void print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
 
void indent_to (FILE *file, int column)
 
void print_node (FILE *file, const char *prefix, tree node, int indent, bool brief_for_visited)
 
void print_decl_identifier (FILE *file, tree decl, int flags)
 
DEBUG_FUNCTION void debug_tree (tree node)
 
DEBUG_FUNCTION void debug_raw (const tree_node &ref)
 
DEBUG_FUNCTION void debug_raw (const tree_node *ptr)
 
static void dump_tree_via_hooks (const tree_node *ptr, dump_flags_t options)
 
DEBUG_FUNCTION void debug (const tree_node &ref)
 
DEBUG_FUNCTION void debug (const tree_node *ptr)
 
DEBUG_FUNCTION void debug_head (const tree_node &ref)
 
DEBUG_FUNCTION void debug_head (const tree_node *ptr)
 
DEBUG_FUNCTION void debug_body (const tree_node &ref)
 
DEBUG_FUNCTION void debug_body (const tree_node *ptr)
 
DEBUG_FUNCTION void debug_raw (vec< tree, va_gc > &ref)
 
DEBUG_FUNCTION void debug_raw (vec< tree, va_gc > *ptr)
 
static void debug_slim (tree t)
 

Variables

static hash_set< tree > * table = NULL
 

Macro Definition Documentation

◆ HASH_SIZE

#define HASH_SIZE   37
Prints out tree in human readable form - GCC
   Copyright (C) 1990-2024 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/>.   
Define the hash table of nodes already seen.
Such nodes are not repeated; brief cross-references are used.   

Referenced by debug_tree().

Function Documentation

◆ debug() [1/2]

DEBUG_FUNCTION void debug ( const tree_node & ref)

References dump_tree_via_hooks(), and TDF_NONE.

◆ debug() [2/2]

DEBUG_FUNCTION void debug ( const tree_node * ptr)

References debug.

◆ debug_body() [1/2]

DEBUG_FUNCTION void debug_body ( const tree_node & ref)

References debug, dump_function_to_file(), TDF_NONE, and TREE_CODE.

Referenced by debug_body().

◆ debug_body() [2/2]

DEBUG_FUNCTION void debug_body ( const tree_node * ptr)

References debug_body().

◆ debug_head() [1/2]

DEBUG_FUNCTION void debug_head ( const tree_node & ref)

References debug.

Referenced by debug_head().

◆ debug_head() [2/2]

DEBUG_FUNCTION void debug_head ( const tree_node * ptr)

References debug_head().

◆ debug_raw() [1/4]

DEBUG_FUNCTION void debug_raw ( const tree_node & ref)

References debug_tree().

Referenced by debug_raw(), debug_raw(), and debug_raw().

◆ debug_raw() [2/4]

DEBUG_FUNCTION void debug_raw ( const tree_node * ptr)

References debug_raw().

◆ debug_raw() [3/4]

DEBUG_FUNCTION void debug_raw ( vec< tree, va_gc > & ref)
Print the vector of trees VEC on standard error, for debugging.
Most nodes referred to by this one are printed recursively
down to a depth of six.   

References debug_raw(), dump_addr(), and FOR_EACH_VEC_ELT.

◆ debug_raw() [4/4]

DEBUG_FUNCTION void debug_raw ( vec< tree, va_gc > * ptr)

References debug_raw().

◆ debug_slim()

static void debug_slim ( tree t)
static

References print_node_brief().

◆ debug_tree()

DEBUG_FUNCTION void debug_tree ( tree node)
Print the node NODE on standard error, for debugging.
Most nodes referred to by this one are printed recursively
down to a depth of six.   

References HASH_SIZE, NULL, print_node(), and table.

Referenced by debug_raw(), expand_debug_expr(), operands_scanner::get_expr_operands(), gimplify_expr(), odr_types_equivalent_p(), cgraph_node::verify_node(), verify_opaque_type(), verify_type(), verify_type_variant(), and will_be_nonconstant_expr_predicate().

◆ dump_addr()

void dump_addr ( FILE * file,
const char * prefix,
const void * addr )

◆ dump_tree_via_hooks()

static void dump_tree_via_hooks ( const tree_node * ptr,
dump_flags_t options )
static

◆ indent_to()

void indent_to ( FILE * file,
int column )

References i.

Referenced by print_node().

◆ print_decl_identifier()

◆ print_node()

void print_node ( FILE * file,
const char * prefix,
tree node,
int indent,
bool brief_for_visited )
Print the node NODE in full on file FILE, preceded by PREFIX,
starting in column INDENT.   

References hash_set< KeyId, Lazy, Traits >::add(), ADDR_SPACE_GENERIC_P, BINFO_BASE_BINFOS, BINFO_INHERITANCE_CHAIN, BINFO_OFFSET, BINFO_VIRTUALS, BLOCK_ABSTRACT_ORIGIN, BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_SUPERCONTEXT, BLOCK_VARS, built_in_class_names, BUILT_IN_FRONTEND, BUILT_IN_MD, built_in_names, CALL_EXPR_FN, CALL_EXPR_STATIC_CHAIN, CODE_CONTAINS_STRUCT, CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, hash_set< KeyId, Lazy, Traits >::contains(), count, DECL_ABSTRACT_ORIGIN, DECL_ABSTRACT_P, DECL_ALIGN, DECL_ARG_TYPE, DECL_ARGUMENTS, DECL_ATTRIBUTES, DECL_BIT_FIELD, DECL_BIT_FIELD_TYPE, DECL_BUILT_IN_CLASS, DECL_BY_REFERENCE, DECL_COMMON, DECL_CONTEXT, DECL_DECLARED_INLINE_P, DECL_DEFER_OUTPUT, DECL_EXTERNAL, DECL_FE_FUNCTION_CODE(), DECL_FIELD_BIT_OFFSET, DECL_FIELD_OFFSET, DECL_FUNCTION_CODE(), DECL_FUNCTION_SPECIFIC_OPTIMIZATION, DECL_FUNCTION_SPECIFIC_TARGET, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_IN_CONSTANT_POOL, DECL_IN_SYSTEM_HEADER, DECL_IN_TEXT_SECTION, DECL_INCOMING_RTL, DECL_INITIAL, decl_is_tm_clone(), DECL_LANG_FLAG_0, DECL_LANG_FLAG_1, DECL_LANG_FLAG_2, DECL_LANG_FLAG_3, DECL_LANG_FLAG_4, DECL_LANG_FLAG_5, DECL_LANG_FLAG_6, DECL_LANG_FLAG_7, DECL_LANG_FLAG_8, DECL_MD_FUNCTION_CODE(), DECL_MODE, DECL_NAME, DECL_NONADDRESSABLE_P, DECL_NONLOCAL, DECL_NOT_FLEXARRAY, DECL_OFFSET_ALIGN, DECL_PACKED, DECL_PRESERVE_P, DECL_READ_P, DECL_REGISTER, DECL_RESULT_FLD, DECL_RTL, DECL_RTL_SET_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_SOURCE_LOCATION, DECL_STATIC_CHAIN, DECL_STRUCT_FUNCTION, DECL_THREAD_LOCAL_P, DECL_TLS_MODEL, DECL_UID, DECL_UNINLINABLE, DECL_UNSIGNED, DECL_USER_ALIGN, DECL_VALUE_EXPR, DECL_VIRTUAL_P, DECL_WARN_IF_NOT_ALIGN, DECL_WEAK, dump_addr(), dump_flags, EH_LANDING_PAD_NR, expand_location(), EXPR_HAS_LOCATION, EXPR_LOCATION, EXPR_LOCATION_RANGE, fixed_to_decimal(), FIXED_VALUE_TYPE, fndecl_built_in_p(), FOR_EACH_CONSTRUCTOR_ELT, fputc(), GET_MODE_NAME, get_tree_code_name(), HOST_WIDE_INT_PRINT_DEC, HOST_WIDE_INT_PRINT_UNSIGNED, i, IDENTIFIER_POINTER, IMPORTED_DECL_ASSOCIATED_DECL, indent_to(), INTEGRAL_TYPE_P, LABEL_DECL_UID, MAX_TREE_CODES, more_call_expr_args_p(), NUM_POLY_INT_COEFFS, OMP_CLAUSE_CODE, omp_clause_code_name, omp_clause_num_ops, OMP_CLAUSE_OPERAND, POLY_INT_CST_COEFF, pp_flush(), pp_gimple_stmt_1(), print_dec(), lang_hooks::print_decl, lang_hooks::print_identifier, print_node(), print_node_brief(), print_real_cst(), print_rtl(), lang_hooks::print_type, lang_hooks::print_xnode, r, pretty_printer::set_output_stream(), SSA_NAME_DEF_STMT, SSA_NAME_IN_FREE_LIST, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, SSA_NAME_PTR_INFO, SSA_NAME_VAR, SSA_NAME_VERSION, table, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_exceptional, tcc_expression, tcc_reference, tcc_statement, tcc_type, tcc_unary, tcc_vl_exp, TDF_NONE, TDF_NOUID, tls_model_names, wi::to_wide(), TREE_ADDRESSABLE, TREE_ASM_WRITTEN, TREE_CHAIN, TREE_CODE, TREE_CODE_CLASS, TREE_CONSTANT, TREE_DEPRECATED, TREE_FIXED_CST, TREE_IMAGPART, TREE_LANG_FLAG_0, TREE_LANG_FLAG_1, TREE_LANG_FLAG_2, TREE_LANG_FLAG_3, TREE_LANG_FLAG_4, TREE_LANG_FLAG_5, TREE_LANG_FLAG_6, TREE_NOTHROW, TREE_OPERAND, TREE_OPERAND_LENGTH, TREE_OPTIMIZATION, TREE_OVERFLOW, TREE_PRIVATE, TREE_PROTECTED, TREE_PUBLIC, TREE_PURPOSE, TREE_READONLY, TREE_REALPART, TREE_SIDE_EFFECTS, TREE_STATIC, TREE_STRING_LENGTH, TREE_STRING_POINTER, TREE_TARGET_OPTION, TREE_THIS_VOLATILE, TREE_TYPE, TREE_UNAVAILABLE, TREE_USED, TREE_VALUE, TREE_VEC_ELT, TREE_VEC_LENGTH, TREE_VISITED, tsi_end_p(), tsi_next(), tsi_start(), tsi_stmt(), TYPE_ADDR_SPACE, TYPE_ALIAS_SET, TYPE_ALIGN, TYPE_ARG_TYPES, TYPE_ATOMIC, TYPE_ATTRIBUTES, TYPE_CANONICAL, TYPE_CONTEXT, TYPE_CXX_ODR_P, TYPE_DECL_SUPPRESS_DEBUG, TYPE_DOMAIN, TYPE_FIELDS, TYPE_INCLUDES_FLEXARRAY, TYPE_LANG_FLAG_0, TYPE_LANG_FLAG_1, TYPE_LANG_FLAG_2, TYPE_LANG_FLAG_3, TYPE_LANG_FLAG_4, TYPE_LANG_FLAG_5, TYPE_LANG_FLAG_6, TYPE_LANG_FLAG_7, TYPE_MAX_VALUE, TYPE_METHOD_BASETYPE, TYPE_MIN_VALUE, TYPE_MODE, TYPE_NAME, TYPE_NEEDS_CONSTRUCTING, TYPE_NO_FORCE_BLK, TYPE_NONALIASED_COMPONENT, TYPE_OFFSET_BASETYPE, TYPE_P, TYPE_PACKED, TYPE_POINTER_TO, TYPE_PRECISION, TYPE_READONLY, TYPE_REFERENCE_TO, TYPE_RESTRICT, TYPE_REVERSE_STORAGE_ORDER, TYPE_SIGN, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_SIZES_GIMPLIFIED, TYPE_STRING_FLAG, TYPE_STRUCTURAL_EQUALITY_P, TYPE_SYMTAB_ADDRESS, TYPE_TRANSPARENT_AGGR, TYPE_UNSIGNED, TYPE_USER_ALIGN, TYPE_VALUES, TYPE_VECTOR_SUBPARTS(), TYPE_WARN_IF_NOT_ALIGN, vec_safe_length(), VECTOR_CST_ENCODED_ELT, vector_cst_encoded_nelts(), VECTOR_CST_NELTS_PER_PATTERN, and VECTOR_CST_NPATTERNS.

Referenced by add_type_duplicate(), debug_tree(), ipa_icf::sem_variable::dump_to_file(), dump_type_inheritance_graph(), and print_node().

◆ print_node_brief()

◆ print_real_cst()

static void print_real_cst ( FILE * file,
const_tree node,
bool brief )
static
Print to FILE a NODE representing a REAL_CST constant, including
Infinity and NaN.  Be verbose when BFRIEF is false.   

References fputc(), i, real_to_decimal(), REAL_VALUE_ISINF, REAL_VALUE_ISNAN, REAL_VALUE_NEGATIVE, REAL_VALUE_TYPE, TREE_OVERFLOW, and TREE_REAL_CST.

Referenced by print_node(), and print_node_brief().

Variable Documentation

◆ table

hash_set<tree>* table = NULL
static

Referenced by debug_tree(), and print_node().