aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-10-31 22:04:39 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-10-31 22:04:39 -0400
commitec52b1115dda4b0e38aa5620b0c3914b69008a24 (patch)
treec668c63e9650ae10b834fb88da25c23030215504 /gcc/tree.h
parent202be748c9997016f1b08c98291db4b7b9b02a5f (diff)
downloadgcc-ec52b1115dda4b0e38aa5620b0c3914b69008a24.zip
gcc-ec52b1115dda4b0e38aa5620b0c3914b69008a24.tar.gz
gcc-ec52b1115dda4b0e38aa5620b0c3914b69008a24.tar.bz2
tree.h (EXPR_LOC_OR_HERE): New macro.
* tree.h (EXPR_LOC_OR_HERE): New macro. * builtins.c (c_strlen): Use it. * c-decl.c (build_enumerator): Likewise. * gimplify.c (internal_get_tmp_var): Likewise. (shortcut_cond_expr): Likewise. (gimplify_one_sizepos): Likewise. c-family/ * c-common.c (conversion_warning, warn_for_collisions_1): Use EXPR_LOC_OR_HERE. cp/ * decl.c (pop_switch): Use EXPR_LOC_OR_HERE. * typeck.c (convert_for_assignment): Likewise. From-SVN: r166123
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index f0b1e74..2de56c7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1598,6 +1598,7 @@ struct GTY(()) tree_constructor {
(EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
#define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
#define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
+#define EXPR_LOC_OR_HERE(NODE) (EXPR_HAS_LOCATION (NODE) ? (NODE)->exp.locus : input_location)
#define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
#define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)