summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 25c0c0137d1..a9e12864010 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -9182,6 +9182,31 @@ is_typedef_decl (tree x)
&& DECL_ORIGINAL_TYPE (x) != NULL_TREE);
}
+/* Record the types used by the current global variable declaration
+ being parsed, so that we can decide later to emit their debug info.
+ Those types are in types_used_by_cur_var_decl, and we are going to
+ store them in the types_used_by_vars_hash hash table.
+ DECL is the declaration of the global variable that has been parsed. */
+
+void
+record_types_used_by_current_var_decl (tree decl)
+{
+ gcc_assert (decl && DECL_P (decl) && TREE_STATIC (decl));
+
+ if (types_used_by_cur_var_decl)
+ {
+ tree node;
+ for (node = types_used_by_cur_var_decl;
+ node;
+ node = TREE_CHAIN (node))
+ {
+ tree type = TREE_PURPOSE (node);
+ types_used_by_var_decl_insert (type, decl);
+ }
+ types_used_by_cur_var_decl = NULL;
+ }
+}
+
/* The C and C++ parsers both use vectors to hold function arguments.
For efficiency, we keep a cache of unused vectors. This is the
cache. */