/* This file contains the definitions and documentation for the
   tree codes used in GCC.
   Copyright (C) 1987-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/>.  */


/* For tcc_references, tcc_expression, tcc_comparison, tcc_unary,
   tcc_binary, and tcc_statement nodes, which use struct tree_exp, the
   4th element is the number of argument slots to allocate.  This
   determines the size of the tree node object.  Other nodes use
   different structures, and the size is determined by the tree_union
   member structure; the 4th element should be zero.  Languages that
   define language-specific tcc_exceptional or tcc_constant codes must
   define the tree_size langhook to say how big they are.

   These tree codes have been sorted so that the macros in tree.h that
   check for various tree codes are optimized into range checks.  This
   gives a measurable performance improvement.  When adding a new
   code, consider its placement in relation to the other codes.  */

/* Any erroneous construct is parsed into a node of this type.
   This type of node is accepted without complaint in all contexts
   by later parsing activities, to avoid multiple error messages
   for one error.
   No fields in these nodes are used except the TREE_CODE.  */
DEFTREECODE (ERROR_MARK, "error_mark", tcc_exceptional, 0)

/* Used to represent a name (such as, in the DECL_NAME of a decl node).
   Internally it looks like a STRING_CST node.
   There is only one IDENTIFIER_NODE ever made for any particular name.
   Use `get_identifier' to get it (or create it, the first time).  */
DEFTREECODE (IDENTIFIER_NODE, "identifier_node", tcc_exceptional, 0)

/* Has the TREE_VALUE and TREE_PURPOSE fields.  */
/* These nodes are made into lists by chaining through the
   TREE_CHAIN field.  The elements of the list live in the
   TREE_VALUE fields, while TREE_PURPOSE fields are occasionally
   used as well to get the effect of Lisp association lists.  */
DEFTREECODE (TREE_LIST, "tree_list", tcc_exceptional, 0)

/* These nodes contain an array of tree nodes.  */
DEFTREECODE (TREE_VEC, "tree_vec", tcc_exceptional, 0)

/* A symbol binding block.  These are arranged in a tree,
   where the BLOCK_SUBBLOCKS field contains a chain of subblocks
   chained through the BLOCK_CHAIN field.
   BLOCK_SUPERCONTEXT points to the parent block.
     For a block which represents the outermost scope of a function, it
     points to the FUNCTION_DECL node.
   BLOCK_VARS points to a chain of decl nodes.
   BLOCK_CHAIN points to the next BLOCK at the same level.
   BLOCK_ABSTRACT_ORIGIN points to the original (abstract) tree node which
   this block is an instance of, or else is NULL to indicate that this
   block is not an instance of anything else.  When non-NULL, the value
   could either point to another BLOCK node or it could point to a
   FUNCTION_DECL node (e.g. in the case of a block representing the
   outermost scope of a particular inlining of a function).
   TREE_ASM_WRITTEN is nonzero if the block was actually referenced
   in the generated assembly.  */
DEFTREECODE (BLOCK, "block", tcc_exceptional, 0)
