2007-02-06 Paolo Bonzini <bonzini@gnu.org>
* tree.c (tree_int_map_hash, tree_int_map_eq, tree_int_map_marked_p):
Remove prototypes and make them non-static.
(struct tree_int_map): Remove.
* tree.h (struct tree_int_map): Move here, turning TO into an
unsigned int.
(tree_int_map_hash, tree_int_map_eq, tree_int_map_marked_p): Declare.
* tree.h (TREE_COMPLEXITY): Remove.
(struct tree_exp): Remove complexity field.
* tree.c (build1_stat): Don't set it.
gcc/ada:
2007-02-06 Paolo Bonzini <bonzini@gnu.org>
* Make-lang.in (ada/decl.o): Add gt-ada-decl.h dependency.
* decl.c: Include gt-ada-decl.h.
(annotate_value_cache): New.
(annotate_value): Use it instead of TREE_COMPLEXITY.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121647
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-02-06 Paolo Bonzini <bonzini@gnu.org>
+
+ * tree.c (tree_int_map_hash, tree_int_map_eq, tree_int_map_marked_p):
+ Remove prototypes and make them non-static.
+ (struct tree_int_map): Remove.
+ * tree.h (struct tree_int_map): Move here, turning TO into an
+ unsigned int.
+ (tree_int_map_hash, tree_int_map_eq, tree_int_map_marked_p): Declare.
+
+ * tree.h (TREE_COMPLEXITY): Remove.
+ (struct tree_exp): Remove complexity field.
+ * tree.c (build1_stat): Don't set it.
+
2007-02-06 Dorit Nuzman <dorit@il.ibm.com>
Victor Kaplansky <victork@il.ibm.com>
+2007-02-06 Paolo Bonzini <bonzini@gnu.org>
+
+ * Make-lang.in (ada/decl.o): Add gt-ada-decl.h dependency.
+ * decl.c: Include gt-ada-decl.h.
+ (annotate_value_cache): New.
+ (annotate_value): Use it instead of TREE_COMPLEXITY.
+
2007-02-03 Kazu Hirata <kazu@codesourcery.com>
* misc.c, utils2.c: Fix comment typos.
$(FLAGS_H) toplev.h convert.h $(TARGET_H) ada/ada.h ada/types.h ada/atree.h \
ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/snames.h \
ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
- $(EXPR_H)
+ $(EXPR_H) gt-ada-decl.h
ada/misc.o : ada/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(EXPR_H) insn-codes.h insn-flags.h insn-config.h recog.h \
#include "fe.h"
#include "sinfo.h"
#include "einfo.h"
+#include "hashtab.h"
#include "ada-tree.h"
#include "gigi.h"
static int defer_debug_level = 0;
static tree defer_debug_incomplete_list;
+/* A hash table used as to cache the result of annotate_value. */
+static GTY ((if_marked ("tree_int_map_marked_p"), param_is (struct tree_int_map)))
+ htab_t annotate_value_cache;
+
static void copy_alias_set (tree, tree);
static tree substitution_list (Entity_Id, Entity_Id, tree, bool);
static bool allocatable_size_p (tree, bool);
Node_Ref_Or_Val ops[3], ret;
int i;
int size;
+ struct tree_int_map **h = NULL;
/* See if we've already saved the value for this node. */
- if (EXPR_P (gnu_size) && TREE_COMPLEXITY (gnu_size))
- return (Node_Ref_Or_Val) TREE_COMPLEXITY (gnu_size);
+ if (EXPR_P (gnu_size))
+ {
+ struct tree_int_map in;
+ if (!annotate_value_cache)
+ annotate_value_cache = htab_create_ggc (512, tree_int_map_hash,
+ tree_int_map_eq, 0);
+ in.from = gnu_size;
+ h = (struct tree_int_map **)
+ htab_find_slot (annotate_value_cache, &in, INSERT);
+
+ if (*h)
+ return (Node_Ref_Or_Val) (*h)->to;
+ }
/* If we do not return inside this switch, TCODE will be set to the
code to use for a Create_Node operand and LEN (set above) will be
}
ret = Create_Node (tcode, ops[0], ops[1], ops[2]);
- TREE_COMPLEXITY (gnu_size) = ret;
+
+ /* Save the result in the cache. */
+ if (h)
+ {
+ *h = ggc_alloc (sizeof (struct tree_int_map));
+ (*h)->from = gnu_size;
+ (*h)->to = ret;
+ }
+
return ret;
}
strcpy (Name_Buffer + len, suffix);
return get_identifier (Name_Buffer);
}
+
+#include "gt-ada-decl.h"
static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
htab_t restrict_base_for_decl;
-struct tree_int_map GTY(())
-{
- tree from;
- unsigned short to;
-};
-static unsigned int tree_int_map_hash (const void *);
-static int tree_int_map_eq (const void *, const void *);
-static int tree_int_map_marked_p (const void *);
static void set_type_quals (tree, int);
static int type_hash_eq (const void *, const void *);
static hashval_t type_hash_hash (const void *);
#else
SET_EXPR_LOCUS (t, NULL);
#endif
- TREE_COMPLEXITY (t) = 0;
TREE_OPERAND (t, 0) = node;
TREE_BLOCK (t) = NULL_TREE;
if (node && !TYPE_P (node))
/* Return true if the trees in the tree_int_map *'s VA and VB are equal. */
-static int
+int
tree_int_map_eq (const void *va, const void *vb)
{
const struct tree_int_map *a = va, *b = vb;
/* Hash a from tree in the tree_int_map * ITEM. */
-static unsigned int
+unsigned int
tree_int_map_hash (const void *item)
{
return htab_hash_pointer (((const struct tree_int_map *)item)->from);
purposes. We simply return true if the from tree_int_map *P's from tree is marked, so that this
structure goes away when the from tree goes away. */
-static int
+int
tree_int_map_marked_p (const void *p)
{
tree from = ((struct tree_int_map *) p)->from;
/* In ordinary expression nodes. */
#define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
-#define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
/* In gimple statements. */
#define GIMPLE_STMT_OPERAND(NODE, I) GIMPLE_STMT_OPERAND_CHECK (NODE, I)
{
struct tree_common common;
source_locus locus;
- int complexity;
tree block;
tree GTY ((special ("tree_exp"),
desc ("TREE_CODE ((tree) &%0)")))
/* In tree-vectorizer.c. */
extern void vect_set_verbosity_level (const char *);
+/* In tree.c. */
struct tree_map GTY(())
{
unsigned int hash;
extern int tree_map_marked_p (const void *);
extern int tree_map_eq (const void *, const void *);
+struct tree_int_map GTY(())
+{
+ tree from;
+ unsigned int to;
+};
+
+extern unsigned int tree_int_map_hash (const void *);
+extern int tree_int_map_eq (const void *, const void *);
+extern int tree_int_map_marked_p (const void *);
+
/* In tree-ssa-address.c. */
extern tree tree_mem_ref_addr (tree, tree);
extern void copy_mem_ref_info (tree, tree);