1161304Snetchild/* This file contains the definitions and documentation for the 2161304Snetchild additional tree codes used in the GNU C++ compiler (see tree.def 3161304Snetchild for the standard codes). 4161304Snetchild Copyright (C) 1987-2015 Free Software Foundation, Inc. 5161304Snetchild Hacked by Michael Tiemann (tiemann@cygnus.com) 6161304Snetchild 7161304SnetchildThis file is part of GCC. 8161304Snetchild 9161304SnetchildGCC is free software; you can redistribute it and/or modify 10161304Snetchildit under the terms of the GNU General Public License as published by 11161304Snetchildthe Free Software Foundation; either version 3, or (at your option) 12161304Snetchildany later version. 13161304Snetchild 14161304SnetchildGCC is distributed in the hope that it will be useful, 15161304Snetchildbut WITHOUT ANY WARRANTY; without even the implied warranty of 16161304SnetchildMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17161304SnetchildGNU General Public License for more details. 18161304Snetchild 19161304SnetchildYou should have received a copy of the GNU General Public License 20161304Snetchildalong with GCC; see the file COPYING3. If not see 21161304Snetchild<http://www.gnu.org/licenses/>. */ 22161304Snetchild 23161304Snetchild 24161304Snetchild/* An OFFSET_REF is used in two situations: 25161304Snetchild 26161304Snetchild 1. An expression of the form `A::m' where `A' is a class and `m' is 27161304Snetchild a non-static member. In this case, operand 0 will be a TYPE 28161304Snetchild (corresponding to `A') and operand 1 will be a FIELD_DECL, 29161304Snetchild BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m'). 30161304Snetchild 31161304Snetchild The expression is a pointer-to-member if its address is taken, 32161304Snetchild but simply denotes a member of the object if its address is not 33161304Snetchild taken. 34161304Snetchild 35161304Snetchild This form is only used during the parsing phase; once semantic 36161304Snetchild analysis has taken place they are eliminated. 37161304Snetchild 38161304Snetchild 2. An expression of the form `x.*p'. In this case, operand 0 will 39246290Sdchagin be an expression corresponding to `x' and operand 1 will be an 40161304Snetchild expression with pointer-to-member type. */ 41161304SnetchildDEFTREECODE (OFFSET_REF, "offset_ref", tcc_reference, 2) 42246290Sdchagin 43161304Snetchild/* A pointer-to-member constant. For a pointer-to-member constant 44161304Snetchild `X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the 45246290Sdchagin PTRMEM_CST_MEMBER is the _DECL for `Y'. */ 46161304SnetchildDEFTREECODE (PTRMEM_CST, "ptrmem_cst", tcc_constant, 0) 47161304Snetchild 48161304Snetchild/* For NEW_EXPR, operand 0 is the placement list. 49161304Snetchild Operand 1 is the new-declarator. 50161304Snetchild Operand 2 is the number of elements in the array. 51161304Snetchild Operand 3 is the initializer. */ 52161304SnetchildDEFTREECODE (NEW_EXPR, "nw_expr", tcc_expression, 4) 53161304SnetchildDEFTREECODE (VEC_NEW_EXPR, "vec_nw_expr", tcc_expression, 3) 54161304Snetchild 55161304Snetchild/* For DELETE_EXPR, operand 0 is the store to be destroyed. 56161304Snetchild Operand 1 is the value to pass to the destroying function 57161304Snetchild saying whether the store should be deallocated as well. */ 58161304SnetchildDEFTREECODE (DELETE_EXPR, "dl_expr", tcc_expression, 2) 59161304SnetchildDEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", tcc_expression, 2) 60161304Snetchild 61161304Snetchild/* Value is reference to particular overloaded class method. 62246290Sdchagin Operand 0 is the class, operand 1 is the field 63246290Sdchagin The COMPLEXITY field holds the class level (usually 0). */ 64246290SdchaginDEFTREECODE (SCOPE_REF, "scope_ref", tcc_reference, 2) 65246290Sdchagin 66246290Sdchagin/* When composing an object with a member, this is the result. 67246290Sdchagin Operand 0 is the object. Operand 1 is the member (usually 68246290Sdchagin a dereferenced pointer to member). */ 69246290SdchaginDEFTREECODE (MEMBER_REF, "member_ref", tcc_reference, 2) 70246290Sdchagin 71246290Sdchagin/* Type conversion operator in C++. TREE_TYPE is type that this 72246290Sdchagin operator converts to. Operand is expression to be converted. */ 73246290SdchaginDEFTREECODE (TYPE_EXPR, "type_expr", tcc_expression, 1) 74246290Sdchagin 75246290Sdchagin/* AGGR_INIT_EXPRs have a variably-sized representation similar to 76246290Sdchagin that of CALL_EXPRs. Operand 0 is an INTEGER_CST node containing the 77246290Sdchagin operand count, operand 1 is the function which performs initialization, 78246290Sdchagin operand 2 is the slot which was allocated for this expression, and 79246290Sdchagin the remaining operands are the arguments to the initialization function. */ 80246290SdchaginDEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", tcc_vl_exp, 3) 81246290Sdchagin 82246290Sdchagin/* Initialization of an array from another array, expressed at a high level 83246290Sdchagin so that it works with TARGET_EXPR. Operand 0 is the target, operand 1 84246290Sdchagin is the initializer. */ 85246290SdchaginDEFTREECODE (VEC_INIT_EXPR, "vec_init_expr", tcc_expression, 2) 86246290Sdchagin 87246290Sdchagin/* A throw expression. operand 0 is the expression, if there was one, 88246290Sdchagin else it is NULL_TREE. */ 89246290SdchaginDEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1) 90246290Sdchagin 91246290Sdchagin/* An empty class object. The TREE_TYPE gives the class type. We use 92246290Sdchagin these to avoid actually creating instances of the empty classes. */ 93246290SdchaginDEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0) 94246290Sdchagin 95246290Sdchagin/* A reference to a member function or member functions from a base 96246290Sdchagin class. BASELINK_FUNCTIONS gives the FUNCTION_DECL, 97246290Sdchagin TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the 98246290Sdchagin functions. BASELINK_BINFO gives the base from which the functions 99246290Sdchagin come, i.e., the base to which the `this' pointer must be converted 100246290Sdchagin before the functions are called. BASELINK_ACCESS_BINFO gives the 101246290Sdchagin base used to name the functions. 102246290Sdchagin 103246290Sdchagin A BASELINK is an expression; the TREE_TYPE of the BASELINK gives 104246290Sdchagin the type of the expression. This type is either a FUNCTION_TYPE, 105246290Sdchagin METHOD_TYPE, or `unknown_type_node' indicating that the function is 106246290Sdchagin overloaded. */ 107246290SdchaginDEFTREECODE (BASELINK, "baselink", tcc_exceptional, 0) 108246290Sdchagin 109246290Sdchagin/* Template definition. The following fields have the specified uses, 110246290Sdchagin although there are other macros in cp-tree.h that should be used for 111246290Sdchagin accessing this data. 112246290Sdchagin DECL_ARGUMENTS template parm vector 113246290Sdchagin DECL_TEMPLATE_INFO template text &c 114246290Sdchagin DECL_VINDEX list of instantiations already produced; 115246290Sdchagin only done for functions so far 116246290Sdchagin For class template: 117246290Sdchagin DECL_INITIAL associated templates (methods &c) 118246290Sdchagin DECL_TEMPLATE_RESULT null 119161304Snetchild For non-class templates: 120161304Snetchild TREE_TYPE type of object to be constructed 121165408Sjkim DECL_TEMPLATE_RESULT decl for object to be created 122161304Snetchild (e.g., FUNCTION_DECL with tmpl parms used) 123161304Snetchild */ 124161304SnetchildDEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0) 125161304Snetchild 126161304Snetchild/* Index into a template parameter list. The TEMPLATE_PARM_IDX gives 127161304Snetchild the index (from 0) of the parameter, while the TEMPLATE_PARM_LEVEL 128246290Sdchagin gives the level (from 1) of the parameter. 129246290Sdchagin 130246290Sdchagin Here's an example: 131161304Snetchild 132161304Snetchild template <class T> // Index 0, Level 1. 133246290Sdchagin struct S 134246290Sdchagin { 135161304Snetchild template <class U, // Index 0, Level 2. 136161304Snetchild class V> // Index 1, Level 2. 137165408Sjkim void f(); 138161304Snetchild }; 139161304Snetchild 140246290Sdchagin The DESCENDANTS will be a chain of TEMPLATE_PARM_INDEXs descended 141246290Sdchagin from this one. The first descendant will have the same IDX, but 142246290Sdchagin its LEVEL will be one less. The TREE_CHAIN field is used to chain 143246290Sdchagin together the descendants. The TEMPLATE_PARM_DECL is the 144246290Sdchagin declaration of this parameter, either a TYPE_DECL or CONST_DECL. 145165408Sjkim The TEMPLATE_PARM_ORIG_LEVEL is the LEVEL of the most distant 146246290Sdchagin parent, i.e., the LEVEL that the parameter originally had when it 147161304Snetchild was declared. For example, if we instantiate S<int>, we will have: 148161304Snetchild 149165408Sjkim struct S<int> 150246290Sdchagin { 151165408Sjkim template <class U, // Index 0, Level 1, Orig Level 2 152161304Snetchild class V> // Index 1, Level 1, Orig Level 2 153161304Snetchild void f(); 154161304Snetchild }; 155161304Snetchild 156161304Snetchild The LEVEL is the level of the parameter when we are worrying about 157246290Sdchagin the types of things; the ORIG_LEVEL is the level when we are 158246290Sdchagin worrying about instantiating things. */ 159246290SdchaginDEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", tcc_exceptional, 0) 160161304Snetchild 161161304Snetchild/* Index into a template parameter list for template template parameters. 162161304Snetchild This parameter must be a type. The TYPE_FIELDS value will be a 163161304Snetchild TEMPLATE_PARM_INDEX. 164161304Snetchild 165161304Snetchild It is used without template arguments like TT in C<TT>, 166161304Snetchild TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO is NULL_TREE 167161304Snetchild and TYPE_NAME is a TEMPLATE_DECL. */ 168161304SnetchildDEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0) 169161304Snetchild 170161304Snetchild/* The ordering of the following codes is optimized for the checking 171246290Sdchagin macros in tree.h. Changing the order will degrade the speed of the 172246290Sdchagin compiler. TEMPLATE_TYPE_PARM, TYPENAME_TYPE, TYPEOF_TYPE, 173246290Sdchagin BOUND_TEMPLATE_TEMPLATE_PARM. */ 174246290Sdchagin 175246290Sdchagin/* Index into a template parameter list. This parameter must be a type. 176165408Sjkim The type.values field will be a TEMPLATE_PARM_INDEX. */ 177246290SdchaginDEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", tcc_type, 0) 178246290Sdchagin 179246290Sdchagin/* A type designated by `typename T::t'. TYPE_CONTEXT is `T', 180165408Sjkim TYPE_NAME is an IDENTIFIER_NODE for `t'. If the type was named via 181165408Sjkim template-id, TYPENAME_TYPE_FULLNAME will hold the TEMPLATE_ID_EXPR. 182161304Snetchild TREE_TYPE is always NULL. */ 183161304SnetchildDEFTREECODE (TYPENAME_TYPE, "typename_type", tcc_type, 0) 184246290Sdchagin 185165408Sjkim/* A type designated by `__typeof (expr)'. TYPEOF_TYPE_EXPR is the 186161304Snetchild expression in question. */ 187161304SnetchildDEFTREECODE (TYPEOF_TYPE, "typeof_type", tcc_type, 0) 188161304Snetchild 189161304Snetchild/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments 190161304Snetchild like TT<int>. 191161304Snetchild In this case, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO contains the 192161304Snetchild template name and its bound arguments. TYPE_NAME is a TYPE_DECL. */ 193161304SnetchildDEFTREECODE (BOUND_TEMPLATE_TEMPLATE_PARM, "bound_template_template_parm", 194161304Snetchild tcc_type, 0) 195161304Snetchild 196246290Sdchagin/* For template template argument of the form `T::template C'. 197246290Sdchagin TYPE_CONTEXT is `T', the template parameter dependent object. 198161304Snetchild TYPE_NAME is an IDENTIFIER_NODE for `C', the member class template. */ 199246290SdchaginDEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0) 200246290Sdchagin 201246290Sdchagin/* A using declaration. USING_DECL_SCOPE contains the specified 202246290Sdchagin scope. In a member using decl, unless DECL_DEPENDENT_P is true, 203165408Sjkim USING_DECL_DECLS contains the _DECL or OVERLOAD so named. This is 204246290Sdchagin not an alias, but is later expanded into multiple aliases. */ 205161304SnetchildDEFTREECODE (USING_DECL, "using_decl", tcc_declaration, 0) 206246290Sdchagin 207246290Sdchagin/* A using directive. The operand is USING_STMT_NAMESPACE. */ 208246290SdchaginDEFTREECODE (USING_STMT, "using_stmt", tcc_statement, 1) 209165408Sjkim 210246290Sdchagin/* An un-parsed default argument. Holds a vector of input tokens and 211161304Snetchild a vector of places where the argument was instantiated before 212161304Snetchild parsing had occurred. */ 213246290SdchaginDEFTREECODE (DEFAULT_ARG, "default_arg", tcc_exceptional, 0) 214246290Sdchagin 215246290Sdchagin/* An uninstantiated/unevaluated noexcept-specification. For the 216246290Sdchagin uninstantiated case, DEFERRED_NOEXCEPT_PATTERN is the pattern from the 217246290Sdchagin template, and DEFERRED_NOEXCEPT_ARGS are the template arguments to 218246290Sdchagin substitute into the pattern when needed. For the unevaluated case, 219161304Snetchild those slots are NULL_TREE and we use get_defaulted_eh_spec to find 220161304Snetchild the exception-specification. */ 221161304SnetchildDEFTREECODE (DEFERRED_NOEXCEPT, "deferred_noexcept", tcc_exceptional, 0) 222161304Snetchild 223161304Snetchild/* A template-id, like foo<int>. The first operand is the template. 224161304Snetchild The second is NULL if there are no explicit arguments, or a 225161304Snetchild TREE_VEC of arguments. The template will be a FUNCTION_DECL, 226161304Snetchild TEMPLATE_DECL, or an OVERLOAD. If the template-id refers to a 227161304Snetchild member template, the template may be an IDENTIFIER_NODE. */ 228161304SnetchildDEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", tcc_expression, 2) 229246290Sdchagin 230246290Sdchagin/* A list-like node for chaining overloading candidates. TREE_TYPE is 231161304Snetchild the original name, and the parameter is the FUNCTION_DECL. */ 232246290SdchaginDEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0) 233246290Sdchagin 234246290Sdchagin/* A pseudo-destructor, of the form "OBJECT.~DESTRUCTOR" or 235246290Sdchagin "OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The 236165408Sjkim second operand (if non-NULL) is the SCOPE. The third operand is 237246290Sdchagin the TYPE node corresponding to the DESTRUCTOR. The type of the 238161304Snetchild first operand will always be a scalar type. 239246290Sdchagin 240246290Sdchagin The type of a PSEUDO_DTOR_EXPR is always "void", even though it can 241246290Sdchagin be used as if it were a zero-argument function. We handle the 242165408Sjkim function-call case specially, and giving it "void" type prevents it 243246290Sdchagin being used in expressions in ways that are not permitted. */ 244165408SjkimDEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3) 245246290Sdchagin 246246290Sdchagin/* A whole bunch of tree codes for the initial, superficial parsing of 247246290Sdchagin templates. */ 248246290SdchaginDEFTREECODE (MODOP_EXPR, "modop_expr", tcc_expression, 3) 249165408SjkimDEFTREECODE (CAST_EXPR, "cast_expr", tcc_unary, 1) 250246290SdchaginDEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", tcc_unary, 1) 251161304SnetchildDEFTREECODE (CONST_CAST_EXPR, "const_cast_expr", tcc_unary, 1) 252246290SdchaginDEFTREECODE (STATIC_CAST_EXPR, "static_cast_expr", tcc_unary, 1) 253246290SdchaginDEFTREECODE (DYNAMIC_CAST_EXPR, "dynamic_cast_expr", tcc_unary, 1) 254246290SdchaginDEFTREECODE (IMPLICIT_CONV_EXPR, "implicit_conv_expr", tcc_unary, 1) 255246290SdchaginDEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", tcc_expression, 2) 256246290SdchaginDEFTREECODE (TYPEID_EXPR, "typeid_expr", tcc_expression, 1) 257246290SdchaginDEFTREECODE (NOEXCEPT_EXPR, "noexcept_expr", tcc_unary, 1) 258161304Snetchild 259161304Snetchild/* A placeholder for an expression that is not type-dependent, but 260161304Snetchild does occur in a template. When an expression that is not 261161304Snetchild type-dependent appears in a larger expression, we must compute the 262161304Snetchild type of that larger expression. That computation would normally 263161304Snetchild modify the original expression, which would change the mangling of 264161304Snetchild that expression if it appeared in a template argument list. In 265161304Snetchild that situation, we create a NON_DEPENDENT_EXPR to take the place of 266161304Snetchild the original expression. The expression is the only operand -- it 267161304Snetchild is only needed for diagnostics. */ 268246290SdchaginDEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", tcc_expression, 1) 269246290Sdchagin 270246290Sdchagin/* CTOR_INITIALIZER is a placeholder in template code for a call to 271246290Sdchagin setup_vtbl_pointer (and appears in all functions, not just ctors). */ 272246290SdchaginDEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", tcc_expression, 1) 273165408Sjkim 274246290SdchaginDEFTREECODE (TRY_BLOCK, "try_block", tcc_statement, 2) 275161304Snetchild 276161304SnetchildDEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", tcc_statement, 2) 277246290Sdchagin 278246290Sdchagin/* A HANDLER wraps a catch handler for the HANDLER_TYPE. If this is 279246290Sdchagin CATCH_ALL_TYPE, then the handler catches all types. The declaration of 280246290Sdchagin the catch variable is in HANDLER_PARMS, and the body block in 281165408Sjkim HANDLER_BODY. */ 282246290SdchaginDEFTREECODE (HANDLER, "handler", tcc_statement, 2) 283161304Snetchild 284246290Sdchagin/* A MUST_NOT_THROW_EXPR wraps an expression that may not 285246290Sdchagin throw, and must call terminate if it does. The second argument 286246290Sdchagin is a condition, used in templates to express noexcept (condition). */ 287165408SjkimDEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", tcc_expression, 2) 288246290Sdchagin 289165408Sjkim/* A CLEANUP_STMT marks the point at which a declaration is fully 290161304Snetchild constructed. The CLEANUP_EXPR is run on behalf of CLEANUP_DECL 291246290Sdchagin when CLEANUP_BODY completes. */ 292246290SdchaginDEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_statement, 3) 293246290Sdchagin 294246290Sdchagin/* Represents an 'if' statement. The operands are IF_COND, 295246290Sdchagin THEN_CLAUSE, and ELSE_CLAUSE, and the current scope, respectively. */ 296246290Sdchagin/* ??? It is currently still necessary to distinguish between IF_STMT 297161304Snetchild and COND_EXPR for the benefit of templates. */ 298161304SnetchildDEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 4) 299161304Snetchild 300165408Sjkim/* Used to represent a `for' statement. The operands are 301165408Sjkim FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ 302165408SjkimDEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 5) 303165408Sjkim 304165408Sjkim/* Used to represent a range-based `for' statement. The operands are 305165408Sjkim RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY, and RANGE_FOR_SCOPE, 306165408Sjkim respectively. Only used in templates. */ 307246290SdchaginDEFTREECODE (RANGE_FOR_STMT, "range_for_stmt", tcc_statement, 4) 308246290Sdchagin 309165408Sjkim/* Used to represent a 'while' statement. The operands are WHILE_COND 310246290Sdchagin and WHILE_BODY, respectively. */ 311246290SdchaginDEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2) 312246290Sdchagin 313165408Sjkim/* Used to represent a 'do' statement. The operands are DO_BODY and 314246290Sdchagin DO_COND, respectively. */ 315165408SjkimDEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2) 316165408Sjkim 317165408Sjkim/* Used to represent a 'break' statement. */ 318165408SjkimDEFTREECODE (BREAK_STMT, "break_stmt", tcc_statement, 0) 319165408Sjkim 320165408Sjkim/* Used to represent a 'continue' statement. */ 321165408SjkimDEFTREECODE (CONTINUE_STMT, "continue_stmt", tcc_statement, 0) 322246290Sdchagin 323246290Sdchagin/* Used to represent a 'switch' statement. The operands are 324246290Sdchagin SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE, and 325165408Sjkim SWITCH_STMT_SCOPE, respectively. */ 326246290SdchaginDEFTREECODE (SWITCH_STMT, "switch_stmt", tcc_statement, 4) 327165408Sjkim 328246290Sdchagin/* Used to represent an expression statement. Use `EXPR_STMT_EXPR' to 329246290Sdchagin obtain the expression. */ 330246290SdchaginDEFTREECODE (EXPR_STMT, "expr_stmt", tcc_expression, 1) 331165408Sjkim 332246290SdchaginDEFTREECODE (TAG_DEFN, "tag_defn", tcc_expression, 0) 333165408Sjkim 334165408Sjkim/* Represents an 'offsetof' expression during template expansion. */ 335165408SjkimDEFTREECODE (OFFSETOF_EXPR, "offsetof_expr", tcc_expression, 1) 336165408Sjkim 337246290Sdchagin/* Represents the -> operator during template expansion. */ 338246290SdchaginDEFTREECODE (ARROW_EXPR, "arrow_expr", tcc_expression, 1) 339246290Sdchagin 340246290Sdchagin/* Represents an '__alignof__' expression during template 341165408Sjkim expansion. */ 342246290SdchaginDEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_expression, 1) 343165408Sjkim 344165408Sjkim/* Represents an Objective-C++ '@encode' expression during template 345246290Sdchagin expansion. */ 346165408SjkimDEFTREECODE (AT_ENCODE_EXPR, "at_encode_expr", tcc_expression, 1) 347165408Sjkim 348165408Sjkim/* A STMT_EXPR represents a statement-expression during template 349165408Sjkim expansion. This is the GCC extension { ( ... ) }. The 350161304Snetchild STMT_EXPR_STMT is the statement given by the expression. */ 351161304SnetchildDEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1) 352161304Snetchild 353161304Snetchild/* Unary plus. Operand 0 is the expression to which the unary plus 354161304Snetchild is applied. */ 355161304SnetchildDEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", tcc_unary, 1) 356161304Snetchild 357246290Sdchagin/** C++11 extensions. */ 358246290Sdchagin 359246290Sdchagin/* A static assertion. This is a C++11 extension. 360246290Sdchagin STATIC_ASSERT_CONDITION contains the condition that is being 361246290Sdchagin checked. STATIC_ASSERT_MESSAGE contains the message (a string 362246290Sdchagin literal) to be displayed if the condition fails to hold. */ 363246290SdchaginDEFTREECODE (STATIC_ASSERT, "static_assert", tcc_exceptional, 0) 364246290Sdchagin 365165408Sjkim/* Represents an argument pack of types (or templates). An argument 366246290Sdchagin pack stores zero or more arguments that will be used to instantiate 367161304Snetchild a parameter pack. 368246290Sdchagin 369246290Sdchagin ARGUMENT_PACK_ARGS retrieves the arguments stored in the argument 370246290Sdchagin pack. 371246290Sdchagin 372165408Sjkim Example: 373246290Sdchagin template<typename... Values> 374161304Snetchild class tuple { ... }; 375161304Snetchild 376246290Sdchagin tuple<int, float, double> t; 377246290Sdchagin 378246290Sdchagin Values is a (template) parameter pack. When tuple<int, float, 379246290Sdchagin double> is instantiated, the Values parameter pack is instantiated 380165408Sjkim with the argument pack <int, float, double>. ARGUMENT_PACK_ARGS will 381246290Sdchagin be a TREE_VEC containing int, float, and double. */ 382161304SnetchildDEFTREECODE (TYPE_ARGUMENT_PACK, "type_argument_pack", tcc_type, 0) 383161304Snetchild 384161304Snetchild/* Represents an argument pack of values, which can be used either for 385161304Snetchild non-type template arguments or function call arguments. 386161304Snetchild 387161304Snetchild NONTYPE_ARGUMENT_PACK plays precisely the same role as 388165408Sjkim TYPE_ARGUMENT_PACK, but will be used for packing non-type template 389246290Sdchagin arguments (e.g., "int... Dimensions") or function arguments ("const 390246290Sdchagin Args&... args"). */ 391246290SdchaginDEFTREECODE (NONTYPE_ARGUMENT_PACK, "nontype_argument_pack", tcc_expression, 1) 392246290Sdchagin 393165408Sjkim/* Represents a type expression that will be expanded into a list of 394246290Sdchagin types when instantiated with one or more argument packs. 395161304Snetchild 396246290Sdchagin PACK_EXPANSION_PATTERN retrieves the expansion pattern. This is 397246290Sdchagin the type or expression that we will substitute into with each 398246290Sdchagin argument in an argument pack. 399246290Sdchagin 400165408Sjkim SET_PACK_EXPANSION_PATTERN sets the expansion pattern. 401246290Sdchagin 402165408Sjkim PACK_EXPANSION_PARAMETER_PACKS contains a TREE_LIST of the parameter 403161304Snetchild packs that are used in this pack expansion. 404161304Snetchild 405161304Snetchild Example: 406246290Sdchagin template<typename... Values> 407246290Sdchagin struct tied : tuple<Values&...> { 408246290Sdchagin // ... 409246290Sdchagin }; 410165408Sjkim 411246290Sdchagin The derivation from tuple contains a TYPE_PACK_EXPANSION for the 412161304Snetchild template arguments. Its PACK_EXPANSION_PATTERN is "Values&" and its 413161304Snetchild PACK_EXPANSION_PARAMETER_PACKS will contain "Values". */ 414246290SdchaginDEFTREECODE (TYPE_PACK_EXPANSION, "type_pack_expansion", tcc_type, 0) 415165408Sjkim 416161304Snetchild/* Represents an expression that will be expanded into a list of 417 expressions when instantiated with one or more argument packs. 418 419 EXPR_PACK_EXPANSION plays precisely the same role as TYPE_PACK_EXPANSION, 420 but will be used for expressions. */ 421DEFTREECODE (EXPR_PACK_EXPANSION, "expr_pack_expansion", tcc_expression, 3) 422 423/* Selects the Ith parameter out of an argument pack. This node will 424 be used when instantiating pack expansions; see 425 tsubst_pack_expansion. 426 427 ARGUMENT_PACK_SELECT_FROM_PACK contains the *_ARGUMENT_PACK node 428 from which the argument will be selected. 429 430 ARGUMENT_PACK_SELECT_INDEX contains the index into the argument 431 pack that will be returned by this ARGUMENT_PACK_SELECT node. The 432 index is a machine integer. */ 433DEFTREECODE (ARGUMENT_PACK_SELECT, "argument_pack_select", tcc_exceptional, 0) 434 435/** C++ extensions. */ 436 437/* Represents a trait expression during template expansion. */ 438DEFTREECODE (TRAIT_EXPR, "trait_expr", tcc_exceptional, 0) 439 440/* A lambda expression. This is a C++0x extension. 441 LAMBDA_EXPR_DEFAULT_CAPTURE_MODE is an enum for the default, which may be 442 none. 443 LAMBDA_EXPR_CAPTURE_LIST holds the capture-list, including `this'. 444 LAMBDA_EXPR_THIS_CAPTURE goes straight to the capture of `this', if it exists. 445 LAMBDA_EXPR_PENDING_PROXIES is a vector of capture proxies which need to 446 be pushed once scope returns to the lambda. 447 LAMBDA_EXPR_MUTABLE_P signals whether this lambda was declared mutable. 448 LAMBDA_EXPR_RETURN_TYPE holds the return type, if it was specified. */ 449DEFTREECODE (LAMBDA_EXPR, "lambda_expr", tcc_exceptional, 0) 450 451/* The declared type of an expression. This is a C++0x extension. 452 DECLTYPE_TYPE_EXPR is the expression whose type we are computing. 453 DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P states whether the 454 expression was parsed as an id-expression or a member access 455 expression. When false, it was parsed as a full expression. 456 DECLTYPE_FOR_LAMBDA_CAPTURE is set if we want lambda capture semantics. 457 DECLTYPE_FOR_LAMBDA_RETURN is set if we want lambda return deduction. */ 458DEFTREECODE (DECLTYPE_TYPE, "decltype_type", tcc_type, 0) 459 460/* A type designated by `__underlying_type (type)'. 461 UNDERLYING_TYPE_TYPE is the type in question. */ 462DEFTREECODE (UNDERLYING_TYPE, "underlying_type", tcc_type, 0) 463 464/* A type designated by one of the bases type traits. 465 BASES_TYPE is the type in question. */ 466DEFTREECODE (BASES, "bases", tcc_type, 0) 467 468/* Used to represent the template information stored by template 469 specializations. 470 The accessors are: 471 TI_TEMPLATE the template declaration associated to the specialization 472 TI_ARGS the arguments of the template specialization 473 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING the vector of typedefs used in 474 the pattern of the template for which access check is needed at template 475 instantiation time. */ 476DEFTREECODE (TEMPLATE_INFO, "template_info", tcc_exceptional, 0) 477 478/* 479Local variables: 480mode:c 481End: 482*/ 483