cp-tree.h

来自「GCC编译器源代码」· C头文件 代码 · 共 1,508 行 · 第 1/5 页

H
1,508
字号
/* Definitions for C++ parsing and type checking.   Copyright (C) 1987, 93, 94, 95, 1996 Free Software Foundation, Inc.   Hacked by Michael Tiemann (tiemann@cygnus.com)This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING.  If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA.  */#ifndef _CP_TREE_H#define _CP_TREE_H#include "gansidecl.h"/* Language-dependent contents of an identifier.  */struct lang_identifier{  struct tree_identifier ignore;  tree global_value, local_value;  tree class_value;  tree class_template_info;  struct lang_id2 *x;};struct lang_id2{  tree label_value, implicit_decl;  tree type_desc, as_list, error_locus;};typedef struct {  tree t;  int new_type_flag;} flagged_type_tree;/* To identify to the debug emitters if it should pay attention to the   flag `-Wtemplate-debugging'.  */#define HAVE_TEMPLATES 1/* Macros for access to language-specific slots in an identifier.  */#define IDENTIFIER_GLOBAL_VALUE(NODE)	\  (((struct lang_identifier *)(NODE))->global_value)#define IDENTIFIER_CLASS_VALUE(NODE)	\  (((struct lang_identifier *)(NODE))->class_value)#define IDENTIFIER_LOCAL_VALUE(NODE)	\  (((struct lang_identifier *)(NODE))->local_value)#define IDENTIFIER_TEMPLATE(NODE)	\  (((struct lang_identifier *)(NODE))->class_template_info)#define IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (TREE_TYPE (NODE) ? 1 : 0)#define LANG_ID_FIELD(NAME,NODE) \  (((struct lang_identifier *)(NODE))->x \   ? ((struct lang_identifier *)(NODE))->x->NAME : 0)#define SET_LANG_ID(NODE,VALUE,NAME) \  (((struct lang_identifier *)(NODE))->x == 0				    \   ? ((struct lang_identifier *)(NODE))->x				    \      = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0,   \   ((struct lang_identifier *)(NODE))->x->NAME = (VALUE))#define IDENTIFIER_LABEL_VALUE(NODE)	    LANG_ID_FIELD(label_value, NODE)#define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE)   \	SET_LANG_ID(NODE, VALUE, label_value)#define IDENTIFIER_IMPLICIT_DECL(NODE)	    LANG_ID_FIELD(implicit_decl, NODE)#define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \	SET_LANG_ID(NODE, VALUE, implicit_decl)#define IDENTIFIER_AS_DESC(NODE)	    LANG_ID_FIELD(type_desc, NODE)#define SET_IDENTIFIER_AS_DESC(NODE,DESC)	\	SET_LANG_ID(NODE, DESC, type_desc)#define IDENTIFIER_AS_LIST(NODE)	    LANG_ID_FIELD(as_list, NODE)#define SET_IDENTIFIER_AS_LIST(NODE,LIST)	\	SET_LANG_ID(NODE, LIST, as_list)#define IDENTIFIER_ERROR_LOCUS(NODE)	    LANG_ID_FIELD(error_locus, NODE)#define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE)	\	SET_LANG_ID(NODE, VALUE, error_locus)#define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE)/* Nonzero if this identifier is the prefix for a mangled C++ operator name.  */#define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE)#define IDENTIFIER_TYPENAME_P(NODE)	\  (! strncmp (IDENTIFIER_POINTER (NODE),			\	      IDENTIFIER_POINTER (ansi_opname[(int) TYPE_EXPR]),	\	      IDENTIFIER_LENGTH (ansi_opname[(int) TYPE_EXPR])))/* Nonzero means reject anything that ANSI standard C forbids.  */extern int pedantic;/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only.  */#define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type)/* Record in each node resulting from a binary operator   what operator was specified for it.  */#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp))/* Store a value in that field.  */#define C_SET_EXP_ORIGINAL_CODE(exp, code) \  (TREE_COMPLEXITY (exp) = (int)(code))/* If non-zero, a VAR_DECL whose cleanup will cause a throw to the   next exception handler.  */extern tree exception_throw_decl;extern tree double_type_node, long_double_type_node, float_type_node;extern tree char_type_node, unsigned_char_type_node, signed_char_type_node;extern tree ptrdiff_type_node;extern tree short_integer_type_node, short_unsigned_type_node;extern tree long_integer_type_node, long_unsigned_type_node;extern tree long_long_integer_type_node, long_long_unsigned_type_node;extern tree unsigned_type_node;extern tree string_type_node, char_array_type_node, int_array_type_node;extern tree wchar_array_type_node;extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node;extern tree complex_integer_type_node;extern tree complex_float_type_node;extern tree complex_double_type_node;extern tree complex_long_double_type_node;extern tree intQI_type_node, unsigned_intQI_type_node;extern tree intHI_type_node, unsigned_intHI_type_node;extern tree intSI_type_node, unsigned_intSI_type_node;extern tree intDI_type_node, unsigned_intDI_type_node;extern int current_function_returns_value;extern int current_function_returns_null;extern tree current_function_return_value;extern tree ridpointers[];extern tree ansi_opname[];extern tree ansi_assopname[];/* Nonzero means `$' can be in an identifier.  */extern int dollars_in_ident;/* Nonzero means allow type mismatches in conditional expressions;   just make their values `void'.   */extern int flag_cond_mismatch;/* Nonzero means don't recognize the keyword `asm'.  */extern int flag_no_asm;/* For cross referencing.  */extern int flag_gnu_xref;/* For environments where you can use GNU binutils (as, ld in particular).  */extern int flag_gnu_binutils;/* Nonzero means ignore `#ident' directives.  */extern int flag_no_ident;/* Nonzero means warn about implicit declarations.  */extern int warn_implicit;/* Nonzero means warn when all ctors or dtors are private, and the class   has no friends.  */extern int warn_ctor_dtor_privacy;/* Nonzero means warn about function definitions that default the return type   or that use a null return and have a return-type other than void.  */extern int warn_return_type;/* Nonzero means give string constants the type `const char *'   to get extra warnings from them.  These warnings will be too numerous   to be useful, except in thoroughly ANSIfied programs.  */extern int warn_write_strings;/* Nonzero means warn about sizeof(function) or addition/subtraction   of function pointers.  */extern int warn_pointer_arith;/* Nonzero means warn about suggesting putting in ()'s.  */extern int warn_parentheses;/* Nonzero means warn about multiple (redundant) decls for the same single   variable or function.  */extern int warn_redundant_decls;/* Warn if initializer is not completely bracketed.  */extern int warn_missing_braces;/* Warn about comparison of signed and unsigned values.  */extern int warn_sign_compare;/* Warn about a subscript that has type char.  */extern int warn_char_subscripts;/* Nonzero means warn about pointer casts that can drop a type qualifier   from the pointer target type.  */extern int warn_cast_qual;/* Warn about *printf or *scanf format/argument anomalies.  */extern int warn_format;/* Nonzero means warn about non virtual destructors in classes that have   virtual functions.  */extern int warn_nonvdtor;/* Non-zero means warn when we convert a pointer to member function   into a pointer to (void or function).  */extern int warn_pmf2ptr;/* Nonzero means warn about violation of some Effective C++ style rules.  */extern int warn_ecpp;/* Nonzero means warn where overload resolution chooses a promotion from   unsigned to signed over a conversion to an unsigned of the same size.  */extern int warn_sign_promo;/* Non-zero means warn when a function is declared extern and later inline.  */extern int warn_extern_inline;/* Non-zero means warn when an old-style cast is used.  */extern int warn_old_style_cast;/* Nonzero means to treat bitfields as unsigned unless they say `signed'.  */extern int flag_signed_bitfields;/* 3 means write out only virtuals function tables `defined'   in this implementation file.   2 means write out only specific virtual function tables   and give them (C) public access.   1 means write out virtual function tables and give them   (C) public access.   0 means write out virtual function tables and give them   (C) static access (default).   -1 means declare virtual function tables extern.  */extern int write_virtuals;/* True for more efficient but incompatible (not not fully tested)   vtable implementation (using thunks).   0 is old behavior; 1 is new behavior.  */extern int flag_vtable_thunks;/* INTERFACE_ONLY nonzero means that we are in an "interface"   section of the compiler.  INTERFACE_UNKNOWN nonzero means   we cannot trust the value of INTERFACE_ONLY.  If INTERFACE_UNKNOWN   is zero and INTERFACE_ONLY is zero, it means that we are responsible   for exporting definitions that others might need.  */extern int interface_only, interface_unknown;/* Nonzero means we should attempt to elide constructors when possible.  */extern int flag_elide_constructors;/* Nonzero means enable obscure ANSI features and disable GNU extensions   that might cause ANSI-compliant code to be miscompiled.  */extern int flag_ansi;/* Nonzero means do argument matching for overloading according to the   ANSI rules, rather than what g++ used to believe to be correct.  */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?