diff options
author | Per Bothner <per@bothner.com> | 2004-06-30 10:58:21 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 2004-06-30 10:58:21 -0700 |
commit | c166747038bc41ee6702618828e5c915cc4e47ea (patch) | |
tree | bf7c0b00dcfa76e28cdeb61f5339d2924ef9dc16 /gcc/input.h | |
parent | b5674962f18be68ae4b22042b09fd251ccd09ed1 (diff) | |
download | gcc-c166747038bc41ee6702618828e5c915cc4e47ea.tar.gz |
Conditionally compile support for --enable-mapped_location.
* input.h: #include line-map.h for source_location typedef.
(BUILTINS_LOCATION, UNKNOWN_LOCATION, expand_location,
LOCATION_FILE, LOCATION_LINE): New macros and functions.
(expanded_location, source_locus): New typedefs.
(push_srcloc): Change parameter list if USE_MAPPED_LOCATION.
* rtl.def (NOTE, ASM_OPERANDS): Modify specifcation, if
USE_MAPPED_LOCATION.
* rtl.h (NOTE_DELETED_LABEL_NAME): New macro.
(NOTE_SOURCE_LOCATION, NOTE_EXPNDED_LOCATION, SET_INSN_DELETED):
New conditional macros.
(ASM_OPERANDS_SOURCE_FILE, ASM_OPERANDS_SOURCE_LINE): Replace
by ASM_OPERANDS_SOURCE_LOCATION if USE_MAPPED_LOCATION.
* tree.h (EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_HAS_LOCATION,
EXPR_LOCUS, SET_EXPR_LOCUS, EXPR_FILENAME, EXPR_LINENO,
DECL_IS_BUILTIN): New macros, most depending on USE_MAPPED__LOCATION.
(tree_exp): Change type of locus to use new source_locus typedef.
* tree.c (build1_stat): Use SET_EXPR_LOCATION.
(annotate_with_locus, annotate_with_file_line): Conditionalize.
(expand_location): New function.
* toplev.c (unknown_location): New static, when USE_MAPPED_LOCATION.
(push_srcloc, pop_loc): Adjust parameter handling.
(process_options): Don't set input_filename by itself.
(lang_dependent_init): Save, set input_location to <built-in>.
(warn_deprecated_use): Use expand_location.
From-SVN: r83918
Diffstat (limited to 'gcc/input.h')
-rw-r--r-- | gcc/input.h | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/gcc/input.h b/gcc/input.h index 6e11023a900..f34c74e908a 100644 --- a/gcc/input.h +++ b/gcc/input.h @@ -22,19 +22,41 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef GCC_INPUT_H #define GCC_INPUT_H +#include "line-map.h" extern struct line_maps line_table; -/* The data structure used to record a location in a translation unit. */ -/* Long-term, we want to get rid of this and typedef fileline location_t. */ -struct location_s GTY (()) +/* The location for declarations in "<built-in>" */ +#define BUILTINS_LOCATION ((source_location) 2) + +typedef struct location_s GTY(()) { /* The name of the source file involved. */ const char *file; /* The line-location in the source file. */ int line; -}; + + /* FUTURE (but confuses gentype): int column. */ +} expanded_location; + +#ifdef USE_MAPPED_LOCATION + +extern expanded_location expand_location (source_location); + +#define UNKNOWN_LOCATION ((source_location) 0) +typedef source_location location_t; /* deprecated typedef */ +typedef source_location source_locus; /* to be removed */ + +#else /* ! USE_MAPPED_LOCATION */ + typedef struct location_s location_t; +typedef location_t *source_locus; + +#define expand_location(FILELINE) (FILELINE) +extern location_t unknown_location; +#define UNKNOWN_LOCATION unknown_location + +#endif /* ! USE_MAPPED_LOCATION */ struct file_stack { @@ -46,8 +68,18 @@ struct file_stack extern const char *main_input_filename; extern location_t input_location; -#define input_line (input_location.line) -#define input_filename (input_location.file) +#ifdef USE_MAPPED_LOCATION +extern void push_srcloc (location_t); +#else /* ! USE_MAPPED_LOCATION */ +extern void push_srcloc (const char *name, int line); +#endif /* ! USE_MAPPED_LOCATION */ +extern void pop_srcloc (void); + +#define LOCATION_FILE(LOC) ((expand_location (LOC)).file) +#define LOCATION_LINE(LOC) ((expand_location (LOC)).line) + +#define input_line LOCATION_LINE(input_location) +#define input_filename LOCATION_FILE(input_location) /* Stack of currently pending input files. The line member is not accurate for the innermost file on the stack. */ @@ -56,7 +88,4 @@ extern struct file_stack *input_file_stack; /* Incremented on each change to input_file_stack. */ extern int input_file_stack_tick; -extern void push_srcloc (const char *name, int line); -extern void pop_srcloc (void); - #endif |