aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/include/cpplib.h1
-rw-r--r--libcpp/macro.c9
3 files changed, 16 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 89b582d..2352b7d 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70296
+ * include/cpplib.h (cpp_fun_like_macro_p): New prototype.
+ * macro.c (cpp_fun_like_macro_p): New function.
+
2016-03-15 Richard Henderson <rth@redhat.com>
* line-map.c (new_linemap): Make alloc_size a size_t.
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 882f80c..35b0375 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -813,6 +813,7 @@ extern int cpp_avoid_paste (cpp_reader *, const cpp_token *,
extern const cpp_token *cpp_get_token (cpp_reader *);
extern const cpp_token *cpp_get_token_with_location (cpp_reader *,
source_location *);
+extern bool cpp_fun_like_macro_p (cpp_hashnode *);
extern const unsigned char *cpp_macro_definition (cpp_reader *,
cpp_hashnode *);
extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
diff --git a/libcpp/macro.c b/libcpp/macro.c
index cfb09ce..759fbe7 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -3301,6 +3301,15 @@ check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro,
}
}
+/* Returns true of NODE is a function-like macro. */
+bool
+cpp_fun_like_macro_p (cpp_hashnode *node)
+{
+ return (node->type == NT_MACRO
+ && (node->flags & (NODE_BUILTIN | NODE_MACRO_ARG)) == 0
+ && node->value.macro->fun_like);
+}
+
/* Returns the name, arguments and expansion of a macro, in a format
suitable to be read back in again, and therefore also for DWARF 2
debugging info. e.g. "PASTE(X, Y) X ## Y", or "MACNAME EXPANSION".