aboutsummaryrefslogtreecommitdiff
path: root/libcpp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/init.c')
-rw-r--r--libcpp/init.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libcpp/init.c b/libcpp/init.c
index c211217..aef3998 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -381,6 +381,24 @@ mark_named_operators (cpp_reader *pfile)
}
}
+/* Helper function of cpp_type2name. Return the string associated with
+ named operator TYPE. */
+const char *
+cpp_named_operator2name (enum cpp_ttype type)
+{
+ const struct builtin_operator *b;
+
+ for (b = operator_array;
+ b < (operator_array + ARRAY_SIZE (operator_array));
+ b++)
+ {
+ if (type == b->value)
+ return (const char *) b->name;
+ }
+
+ return NULL;
+}
+
void
cpp_init_special_builtins (cpp_reader *pfile)
{