diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-10 04:29:45 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-10 04:29:45 +0000 |
commit | c25509f2935768c84f5a12ac00dc6d8f7fa69a30 (patch) | |
tree | 6fdac42a5241d2f4e1527d266faf70cae27bb05d /gcc/c-common.h | |
parent | 5d894556f49d8855376f48fa2d23f5e00b878206 (diff) | |
download | gcc-c25509f2935768c84f5a12ac00dc6d8f7fa69a30.tar.gz |
* Makefile.in (C_AND_OBJC_OBJS): Add c-dump.o.
(c-dump.o): New target.
* c-common.h (flag_dump_translation_unit): New variable.
(C_TYPE_QUALS): New macro.
(strip_array_types): New function.
(DECL_C_BIT_FIELD): New macro.
(SET_DECL_C_BIT_FIELD): Likewise.
(CLEAR_DECL_C_BIT_FIELD): Likewise.
(dump_info_p): New typedef.
(dump_tree_fn): Likewise.
(lang_dump_tree): New variable.
(dump_node_to_file): New function.
* c-common.c (flag_dump_translation_unit): Define it.
(strip_array_types): New function.
* c-decl.c (c_decode_option): Handle -fdump-translation-unit.
* c-lang.c (finish_file): Call dump_node_to_file if
flag_dump_translation_unit.
* c-semantics.c (mark_rtl_for_local_static): Fix typo in comment.
* c-tree.h (DECL_C_BIT_FIELD): Remove declaration.
* c-dump.c: New file.
* Make-lang.in (CXX_C_OBJS): Add c-dump.o.
(dump.o): Update dependency list.
* cp-tree.h (DECL_MAYBE_TEMPLATE): Remove.
(flag_dump_translation_unit): Likewise.
(CP_TYPE_QUALS): Adjust definition.
(DECL_C_BIT_FIELD): Remove.
(SET_DECL_C_BIT_FIELD): Likewise.
(CLEAR_DECL_C_BIT_FIELD): Likewise.
(add_maybe_template): Likewise.
(strip_array_types): Likewise.
(dump_node_to_file): Likewise.
(cp_dump_tree): New function.
* decl.c (init_decl_processing): Set lang_dump_tree.
* decl2.c (flag_dump_translation_unit): Remove.
* dump.c: Move most of it to ../c-dump.c.
(cp_dump_tree): New function.
* pt.c (add_maybe_template): Remove.
* typeck.c (strip_array_types): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37358 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r-- | gcc/c-common.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h index 1776bad1b71..41e771cf780 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -379,6 +379,11 @@ extern int flag_no_builtin; extern int flag_no_nonansi_builtin; +/* If non-NULL, dump the tree structure for the entire translation + unit to this file. */ + +extern const char *flag_dump_translation_unit; + /* Nonzero means warn about suggesting putting in ()'s. */ extern int warn_parentheses; @@ -398,6 +403,14 @@ extern int warn_conversion; #define C_TYPE_FUNCTION_P(type) \ (TREE_CODE (type) == FUNCTION_TYPE) +/* Return the qualifiers that apply to this type. In C++, that means + descending through array types. Note that this macro evaluates its + arguments mor than once. */ +#define C_TYPE_QUALS(TYPE) \ + (TYPE_QUALS ((TREE_CODE (TYPE) == ARRAY_TYPE \ + && c_language == clk_cplusplus) \ + ? strip_array_types (TYPE) : TYPE)) + /* For convenience we define a single macro to identify the class of object or incomplete types. */ #define C_TYPE_OBJECT_OR_INCOMPLETE_P(type) \ @@ -480,6 +493,7 @@ extern tree build_va_arg PARAMS ((tree, tree)); extern int self_promoting_args_p PARAMS ((tree)); extern tree simple_type_promotes_to PARAMS ((tree)); +extern tree strip_array_types PARAMS ((tree)); /* These macros provide convenient access to the various _STMT nodes. */ @@ -657,6 +671,14 @@ extern int anon_aggr_type_p PARAMS ((tree)); sub-variables that make up the anonymous union. */ #define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE)) +/* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */ +#define DECL_C_BIT_FIELD(NODE) \ + (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) == 1) +#define SET_DECL_C_BIT_FIELD(NODE) \ + (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 1) +#define CLEAR_DECL_C_BIT_FIELD(NODE) \ + (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) + extern void emit_local_var PARAMS ((tree)); extern void make_rtl_for_local_static PARAMS ((tree)); extern tree expand_cond PARAMS ((tree)); @@ -722,6 +744,20 @@ extern int c_safe_from_p PARAMS ((rtx, tree)); #endif +/* In dump.c */ + +typedef struct dump_info *dump_info_p; + +/* A callback function used dump language-specific parts of tree + nodes. Returns non-zero if it does not want the usual dumping of + the second argument. */ + +typedef int (*dump_tree_fn) PARAMS ((dump_info_p, tree)); + +extern dump_tree_fn lang_dump_tree; + +extern void dump_node_to_file PARAMS ((tree, const char *)); + /* Information recorded about each file examined during compilation. */ struct c_fileinfo |