⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cp-tree.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Definitions for C++ parsing and type checking.   Copyright (C) 1987 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, 675 Mass Ave, Cambridge, MA 02139, USA.  *//* Borrow everything that is C from c-tree.h,   but do so by copy, not by inclusion, since c-tree.h defines   lang_identifier.  */#ifndef PARANOID#define PARANOID 0#endif/* 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;};/* Macros for access to language-specific slots in an identifier.  */#if !PARANOID#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)#else#define IDENTIFIER_LANG_SPECIFIC_PTR(NODE) \  (my_friendly_assert (TREE_CODE (NODE) == IDENTIFIER_NODE, 325),	\   (struct lang_identifier *) (NODE))#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)	\  (IDENTIFIER_LANG_SPECIFIC_PTR (NODE) -> class_template_info)#endif#if !PARANOID#define IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE))#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE)#else#define IDENTIFIER_TYPE_VALUE(NODE) (*IDENTIFIER_TYPE_VALUE_PTR(NODE))#ifdef __GNUC____inline#endifstatic tree * IDENTIFIER_TYPE_VALUE_PTR(NODE) tree NODE; { return  (my_friendly_assert (TREE_CODE (NODE) == IDENTIFIER_NODE, 326),   &TREE_TYPE (NODE)) ;}#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (IDENTIFIER_TYPE_VALUE(NODE)=TYPE)#endif#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (TREE_TYPE (NODE) ? 1 : 0)extern tree identifier_typedecl_value ();#define IDENTIFIER_TYPEDECL_VALUE(NODE) identifier_typedecl_value (NODE)#define IDENTIFIER_LABEL_VALUE(NODE)	\  (((struct lang_identifier *)(NODE))->x \   ? ((struct lang_identifier *)(NODE))->x->label_value : 0)#define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE)	\  (((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->label_value = (VALUE))#define IDENTIFIER_IMPLICIT_DECL(NODE)	\  (((struct lang_identifier *)(NODE))->x \   ? ((struct lang_identifier *)(NODE))->x->implicit_decl : 0)#define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE)	\  (((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->implicit_decl = (VALUE))#define IDENTIFIER_AS_DESC(NODE)		\  (((struct lang_identifier *)(NODE))->x \   ? ((struct lang_identifier *)(NODE))->x->type_desc : 0)#define SET_IDENTIFIER_AS_DESC(NODE,DESC)	\  (((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->type_desc = (DESC))#define IDENTIFIER_AS_LIST(NODE)		\  (((struct lang_identifier *)(NODE))->x \   ? ((struct lang_identifier *)(NODE))->x->as_list : 0)#define SET_IDENTIFIER_AS_LIST(NODE,LIST)	\  (((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->as_list = (LIST))#define IDENTIFIER_ERROR_LOCUS(NODE)	\  (((struct lang_identifier *)(NODE))->x \   ? ((struct lang_identifier *)(NODE))->x->error_locus : 0)#define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE)	\  (((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->error_locus = (VALUE))#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)/* in tree.c */extern tree purpose_member (), value_member ();extern tree binfo_member ();/* in cp-typeck.c */extern tree build_component_ref (), build_conditional_expr ();extern tree build_x_compound_expr (), build_compound_expr ();extern tree build_unary_op (), build_binary_op (), build_function_call ();extern tree build_binary_op_nodefault ();extern tree build_indirect_ref (), build_array_ref (), build_c_cast ();extern tree build_modify_expr ();extern tree c_sizeof (), c_alignof ();extern tree store_init_value ();extern tree digest_init ();extern tree c_expand_start_case ();extern tree default_conversion ();extern int comptypes (), compparms (), compexcepttypes ();/* Given two integer or real types, return the type for their sum.   Given two compatible ANSI C types, returns the merged type.  */extern tree common_type ();/* in cp-decl.c */extern tree build_label ();/* If non-zero, a VAR_DECL whose cleanup will cause a throw to the   next exception handler.  */extern tree exception_throw_decl;extern int start_function ();extern void finish_function ();extern void store_parm_decls ();extern tree get_parm_info ();extern void pushlevel ();extern tree poplevel ();extern tree groktypename(), lookup_name();extern tree lookup_label(), define_label(), shadow_label ();extern tree implicitly_declare(), getdecls(), gettags ();extern tree start_decl();extern void finish_decl();extern tree start_struct(), finish_struct(), xref_tag(), xref_defn_tag();extern tree finish_exception ();extern tree grokfield(), grokbitfield ();extern tree start_enum(), finish_enum();extern tree build_enumerator();extern tree make_index_type ();extern tree make_anon_name ();#if 0 /* not yet, should get fixed properly later */extern tree make_type_decl ();#endifextern void cplus_decl_attributes ();/* Functions in c-common.c: *//* Concatenate a list of STRING_CST nodes into one STRING_CST.  */extern tree combine_strings ();/* Validate the expression after `case' and apply default promotions.  */extern tree check_case_value ();/* Print an error message for invalid operands to arith operation CODE.   NOP_EXPR is used as a special case (see truthvalue_conversion).  */extern void binary_op_error ();/* Subroutine of build_binary_op_nodefault, used for comparison operations.   See if the operands have both been converted from subword integer types   and, if so, perhaps change them both back to their original type.  */extern tree shorten_compare ();/* Prepare expr to be an argument of a TRUTH_NOT_EXPR,   or validate its data type for an `if' or `while' statement or ?..: exp. */extern tree truthvalue_conversion ();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 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 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, explicit_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 for all old-style non-prototype function decls.  */extern int warn_strict_prototypes;/* Nonzero means warn about suggesting putting in ()'s.  */extern int warn_parentheses;/* 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 traditional constructs whose meanings changed in ANSI C.  */extern int warn_traditional;

⌨️ 快捷键说明

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