diff options
author | David Malcolm <dmalcolm@redhat.com> | 2018-04-27 20:20:31 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2018-04-27 20:20:31 +0000 |
commit | 3b67d7e6949d199a0aadf866734332374a3eced9 (patch) | |
tree | b3d13fc05a8b8a76aa3823876440aed5f4886d21 /gcc | |
parent | 16787011ab14619b2395f58fbc3495dc2e35ed66 (diff) | |
download | gcc-3b67d7e6949d199a0aadf866734332374a3eced9.zip gcc-3b67d7e6949d199a0aadf866734332374a3eced9.tar.gz gcc-3b67d7e6949d199a0aadf866734332374a3eced9.tar.bz2 |
input.h: convert some macros to inline functions
gcc/ChangeLog:
* input.h (in_system_header_at): Convert from macro to inline
function.
(from_macro_expansion_at): Likewise.
(from_macro_definition_at): Likewise.
From-SVN: r259727
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/input.h | 34 |
2 files changed, 31 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f81b09f..048ec0b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-04-27 David Malcolm <dmalcolm@redhat.com> + + * input.h (in_system_header_at): Convert from macro to inline + function. + (from_macro_expansion_at): Likewise. + (from_macro_definition_at): Likewise. + 2018-04-27 Jeff Law <law@redhat.com> * config.gcc: Mark tile* targets as deprecated/obsolete. diff --git a/gcc/input.h b/gcc/input.h index 38b45dc..da5451e 100644 --- a/gcc/input.h +++ b/gcc/input.h @@ -73,17 +73,31 @@ extern location_t input_location; Note that this function returns 1 if LOCATION belongs to a token that is part of a macro replacement-list defined in a system header, but expanded in a non-system file. */ -#define in_system_header_at(LOC) \ - (linemap_location_in_system_header_p (line_table, LOC)) -/* Return a positive value if LOCATION is the locus of a token that - 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 + +static inline int +in_system_header_at (location_t loc) +{ + return linemap_location_in_system_header_p (line_table, loc); +} + +/* Return true if LOCATION is the locus of a token that + comes from a macro expansion, false otherwise. */ + +static inline bool +from_macro_expansion_at (location_t loc) +{ + return linemap_location_from_macro_expansion_p (line_table, loc); +} + +/* Return true if LOCATION is the locus of a token that comes from + a macro definition, false 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 bool +from_macro_definition_at (location_t loc) +{ + return linemap_location_from_macro_definition_p (line_table, loc); +} static inline location_t get_pure_location (location_t loc) |