#include "debug.h"
#include "target.h"
#include "output.h"
+#include "tree-gimple.h"
+#include "tree-flow.h"
/* This file contains basic routines manipulating variable pool.
else
node->next_needed = NULL;
}
+ /* varpool_nodes_queue is now empty, clear the pointer to the last element
+ in the queue. */
+ varpool_last_needed_node = NULL;
return changed;
}
timevar_pop (TV_SYMOUT);
}
+/* Create a new global variable of type TYPE. */
+tree
+add_new_static_var (tree type)
+{
+ tree new_decl;
+ struct varpool_node *new_node;
+
+ new_decl = create_tmp_var (type, NULL);
+ DECL_NAME (new_decl) = create_tmp_var_name (NULL);
+ TREE_READONLY (new_decl) = 0;
+ TREE_STATIC (new_decl) = 1;
+ TREE_USED (new_decl) = 1;
+ DECL_CONTEXT (new_decl) = NULL_TREE;
+ DECL_ABSTRACT (new_decl) = 0;
+ lang_hooks.dup_lang_specific_decl (new_decl);
+ create_var_ann (new_decl);
+ new_node = varpool_node (new_decl);
+ varpool_mark_needed_node (new_node);
+ add_referenced_var (new_decl);
+ varpool_finalize_decl (new_decl);
+
+ return new_node->decl;
+}
+
#include "gt-varpool.h"