diff options
author | Jason Merrill <jason@redhat.com> | 2002-01-15 17:27:07 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-01-15 17:27:07 -0500 |
commit | de097a2d7d044caf6841fa395bb322d4ef8ba841 (patch) | |
tree | 9dec30bd55dcecc61d1bc99e776548971a77e3dd /gcc/c-common.h | |
parent | 93e9a9924741c257172f3384ae199b45b5364886 (diff) | |
download | gcc-de097a2d7d044caf6841fa395bb322d4ef8ba841.tar.gz |
c-common.def (FILE_STMT): New code.
* c-common.def (FILE_STMT): New code.
* c-common.c (statement_code_p): It's a statement.
* c-common.h (stmt_tree_s): Add x_last_filename.
(FILE_STMT_FILENAME_NODE, FILE_STMT_FILENAME): New macros.
(last_expr_filename): New macro.
* c-semantics.c (begin_stmt_tree): Initialize it.
(add_stmt): If the filename changed, also insert a
FILE_STMT.
(expand_stmt): Handle seeing one.
From-SVN: r48881
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r-- | gcc/c-common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h index 873021bc2db..3aaa513ed66 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -257,6 +257,8 @@ struct stmt_tree_s { /* The type of the last expression statement. (This information is needed to implement the statement-expression extension.) */ tree x_last_expr_type; + /* The last filename we recorded. */ + const char *x_last_expr_filename; /* In C++, Non-zero if we should treat statements as full expressions. In particular, this variable is no-zero if at the end of a statement we should destroy any temporaries created @@ -296,6 +298,10 @@ struct language_function { #define last_expr_type (current_stmt_tree ()->x_last_expr_type) +/* The name of the last file we have seen. */ + +#define last_expr_filename (current_stmt_tree ()->x_last_expr_filename) + /* LAST_TREE contains the last statement parsed. These are chained together through the TREE_CHAIN field, but often need to be re-organized since the parse is performed bottom-up. This macro @@ -688,6 +694,12 @@ extern tree strip_array_types PARAMS ((tree)); #define ASM_VOLATILE_P(NODE) \ (ASM_CV_QUAL (ASM_STMT_CHECK (NODE)) != NULL_TREE) +/* The filename we are changing to as of this FILE_STMT. */ +#define FILE_STMT_FILENAME_NODE(NODE) \ + (TREE_OPERAND (FILE_STMT_CHECK (NODE), 0)) +#define FILE_STMT_FILENAME(NODE) \ + (IDENTIFIER_POINTER (FILE_STMT_FILENAME_NODE (NODE))) + /* The line-number at which a statement began. But if STMT_LINENO_FOR_FN_P does holds, then this macro gives the line number for the end of the current function instead. */ |