aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/misc.c')
-rw-r--r--gcc/fortran/misc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/fortran/misc.c b/gcc/fortran/misc.c
index f1fdbf5..bf0eca8 100644
--- a/gcc/fortran/misc.c
+++ b/gcc/fortran/misc.c
@@ -78,6 +78,12 @@ gfc_clear_ts (gfc_typespec *ts)
ts->kind = 0;
ts->derived = NULL;
ts->cl = NULL;
+ /* flag that says if the type is C interoperable */
+ ts->is_c_interop = 0;
+ /* says what f90 type the C kind interops with */
+ ts->f90_type = BT_UNKNOWN;
+ /* flag that says whether it's from iso_c_binding or not */
+ ts->is_iso_c = 0;
}
@@ -285,3 +291,18 @@ gfc_done_2 (void)
gfc_module_done_2 ();
}
+
+/* Returns the index into the table of C interoperable kinds where the
+ kind with the given name (c_kind_name) was found. */
+
+int
+get_c_kind(const char *c_kind_name, CInteropKind_t kinds_table[])
+{
+ int index = 0;
+
+ for (index = 0; index < ISOCBINDING_LAST; index++)
+ if (strcmp (kinds_table[index].name, c_kind_name) == 0)
+ return index;
+
+ return ISOCBINDING_INVALID;
+}