aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.h
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2004-06-30 10:58:21 -0700
committerPer Bothner <bothner@gcc.gnu.org>2004-06-30 10:58:21 -0700
commitc166747038bc41ee6702618828e5c915cc4e47ea (patch)
treebf7c0b00dcfa76e28cdeb61f5339d2924ef9dc16 /gcc/rtl.h
parentb5674962f18be68ae4b22042b09fd251ccd09ed1 (diff)
downloadgcc-c166747038bc41ee6702618828e5c915cc4e47ea.zip
gcc-c166747038bc41ee6702618828e5c915cc4e47ea.tar.gz
gcc-c166747038bc41ee6702618828e5c915cc4e47ea.tar.bz2
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/rtl.h')
-rw-r--r--gcc/rtl.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 333c95d..6013087 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -914,7 +914,22 @@ extern const char * const reg_note_name[];
/* Opaque data. */
#define NOTE_DATA(INSN) RTL_CHECKC1 (INSN, 4, NOTE)
+#define NOTE_DELETED_LABEL_NAME(INSN) XCSTR (INSN, 4, NOTE)
+#ifdef USE_MAPPED_LOCATION
+#define NOTE_SOURCE_LOCATION(INSN) XCUINT (INSN, 5, NOTE)
+#define NOTE_EXPANDED_LOCATION(XLOC, INSN) \
+ (XLOC) = expand_location (NOTE_SOURCE_LOCATION (INSN))
+#define SET_INSN_DELETED(INSN) \
+ (PUT_CODE (INSN, NOTE), NOTE_LINE_NUMBER (INSN) = NOTE_INSN_DELETED)
+#else
+#define NOTE_EXPANDED_LOCATION(XLOC, INSN) \
+ ((XLOC).file = NOTE_SOURCE_FILE (INSN), \
+ (XLOC).line = NOTE_LINE_NUMBER (INSN))
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
+#define SET_INSN_DELETED(INSN) \
+ (PUT_CODE (INSN, NOTE), NOTE_SOURCE_FILE (INSN) = 0, \
+ NOTE_LINE_NUMBER (INSN) = NOTE_INSN_DELETED)
+#endif
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE)
@@ -1247,8 +1262,12 @@ do { \
XSTR (XCVECEXP (RTX, 4, N, ASM_OPERANDS), 0)
#define ASM_OPERANDS_INPUT_MODE(RTX, N) \
GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS))
+#ifdef USE_MAPPED_LOCATION
+#define ASM_OPERANDS_SOURCE_LOCATION(RTX) XCUINT (RTX, 5, ASM_OPERANDS)
+#else
#define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS)
#define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS)
+#endif
/* 1 if RTX is a mem and we should keep the alias set for this mem
unchanged when we access a component. Set to 1, or example, when we
@@ -2001,6 +2020,11 @@ extern GTY(()) rtx return_address_pointer_rtx;
#ifndef NO_GENRTL_H
#include "genrtl.h"
+#ifndef USE_MAPPED_LOCATION
+#undef gen_rtx_ASM_OPERANDS
+#define gen_rtx_ASM_OPERANDS(MODE, ARG0, ARG1, ARG2, ARG3, ARG4, LOC) \
+ gen_rtx_fmt_ssiEEsi (ASM_OPERANDS, (MODE), (ARG0), (ARG1), (ARG2), (ARG3), (ARG4), (LOC).file, (LOC).line)
+#endif
#endif
/* There are some RTL codes that require special attention; the