diff options
author | Jason Merrill <jason@redhat.com> | 2016-09-21 15:59:29 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-09-21 15:59:29 -0400 |
commit | 63cb3926080e7f7e1b93dd94911ad4720813a081 (patch) | |
tree | 452d1f9ed62885789446c7406e5160af2992acdd /gcc | |
parent | c67c64efbe7082e3453f24016795af52179317b2 (diff) | |
download | gcc-63cb3926080e7f7e1b93dd94911ad4720813a081.zip gcc-63cb3926080e7f7e1b93dd94911ad4720813a081.tar.gz gcc-63cb3926080e7f7e1b93dd94911ad4720813a081.tar.bz2 |
Add from_macro_definition_at predicate for locations.
gcc/
* input.h (from_macro_definition_at): New.
libcpp/
* line-map.c (linemap_location_from_macro_definition_p): New.
* line-map.h: Declare it.
From-SVN: r240330
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/input.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 330d9fd..bb998d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-09-21 Jason Merrill <jason@redhat.com> + + * input.h (from_macro_definition_at): New. + 2016-09-21 Segher Boessenkool <segher@kernel.crashing.org> * doc/rtl.texi (JUMP_LABEL): Document RETURN and SIMPLE_RETURN values. diff --git a/gcc/input.h b/gcc/input.h index e95bd3c..fe80605 100644 --- a/gcc/input.h +++ b/gcc/input.h @@ -77,6 +77,11 @@ extern location_t input_location; comes from a macro expansion, O otherwise. */ #define from_macro_expansion_at(LOC) \ ((linemap_location_from_macro_expansion_p (line_table, LOC))) +/* Return a positive value if LOCATION is the locus of a token that comes from + a macro definition, O otherwise. This differs from from_macro_expansion_at + in its treatment of macro arguments, for which this returns false. */ +#define from_macro_definition_at(LOC) \ + ((linemap_location_from_macro_definition_p (line_table, LOC))) static inline location_t get_pure_location (location_t loc) |