From 43d861a5bc03c1c9ed1dde4ca7bf1593771d7e6e Mon Sep 17 00:00:00 2001 From: Razya Ladelsky Date: Mon, 28 May 2007 11:10:27 +0000 Subject: matrix-reorg.c: New file. 2007-05-07 Razya Ladelsky * matrix-reorg.c: New file. Implement matrix flattening and transposing optimization. * tree-pass.h: Add matrix reorg pass. * common.opt: Add fipa-mreorg flag. * Makefile.in: Add matrix-reorg.c. * passes.c: Add matrix reorg pass. * varpool.c (add_new_static_var): New function. * cgraph.h (add_new_static_var): Declare. From-SVN: r125126 --- gcc/varpool.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gcc/varpool.c') diff --git a/gcc/varpool.c b/gcc/varpool.c index 7791ada..1732726 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -33,6 +33,8 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #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. @@ -459,4 +461,28 @@ varpool_output_debug_info (void) 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" -- cgit v1.1