diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2014-04-14 13:51:42 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2014-04-14 13:51:42 +0000 |
commit | 4116e7d0e0cd33503b5968808ef6e6edc987d816 (patch) | |
tree | 4771338dc746c23f1d3f4b9d8667099152513f47 /gcc/ada/gcc-interface | |
parent | cb27986c9b5f270f880089d0bda74d10e76e8a3d (diff) | |
download | gcc-4116e7d0e0cd33503b5968808ef6e6edc987d816.zip gcc-4116e7d0e0cd33503b5968808ef6e6edc987d816.tar.gz gcc-4116e7d0e0cd33503b5968808ef6e6edc987d816.tar.bz2 |
opt.ads (Suppress_Back_Annotation): Remove as unused.
* opt.ads (Suppress_Back_Annotation): Remove as unused.
* fe.h (Back_Annotate_Rep_Info): Likewise.
(Global_Discard_Names): Likewise.
(List_Representation_Info): Declare.
* types.h (Uint_Minus_1): Likewise.
* repinfo.ads: Document back-annotation change.
* gcc-interface/gigi.h (init_gnat_decl): Declare.
(destroy_gnat_decl): Likewise.
* gcc-interface/decl.c (annotate_value): Do not create the cache of
annotated values here but...
<CALL_EXPR>: Only inline the call if -gnatR3 is specified or we are
in ASIS mode.
(init_gnat_decl): ...here instead. New function.
(destroy_gnat_decl): Likewise.
* gcc-interface/trans.c (gigi): Call {init|destroy}_gnat_decl.
* gcc-interface/utils.c (init_gnat_utils): Minor reformatting.
Co-Authored-By: Robert Dewar <dewar@adacore.com>
From-SVN: r209371
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 51 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 6 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 2 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 4 |
4 files changed, 46 insertions, 17 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 1e07693..ae512b0 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -7467,12 +7467,8 @@ annotate_value (tree gnu_size) { struct tree_int_map *e; - if (!annotate_value_cache) - annotate_value_cache = htab_create_ggc (512, tree_int_map_hash, - tree_int_map_eq, 0); in.base.from = gnu_size; - e = (struct tree_int_map *) - htab_find (annotate_value_cache, &in); + e = (struct tree_int_map *) htab_find (annotate_value_cache, &in); if (e) return (Node_Ref_Or_Val) e->to; @@ -7559,11 +7555,17 @@ annotate_value (tree gnu_size) break; case CALL_EXPR: - { - tree t = maybe_inline_call_in_expr (gnu_size); - if (t) - return annotate_value (t); - } + /* In regular mode, inline back only if symbolic annotation is requested + in order to avoid memory explosion on big discriminated record types. + But not in ASIS mode, as symbolic annotation is required for DDA. */ + if (List_Representation_Info == 3 || type_annotate_only) + { + tree t = maybe_inline_call_in_expr (gnu_size); + if (t) + return annotate_value (t); + } + else + return Uint_Minus_1; /* Fall through... */ @@ -7592,11 +7594,10 @@ annotate_value (tree gnu_size) if (in.base.from) { struct tree_int_map **h; - /* We can't assume the hash table data hasn't moved since the - initial look up, so we have to search again. Allocating and - inserting an entry at that point would be an alternative, but - then we'd better discard the entry if we decided not to cache - it. */ + /* We can't assume the hash table data hasn't moved since the initial + look up, so we have to search again. Allocating and inserting an + entry at that point would be an alternative, but then we'd better + discard the entry if we decided not to cache it. */ h = (struct tree_int_map **) htab_find_slot (annotate_value_cache, &in, INSERT); gcc_assert (!*h); @@ -8922,4 +8923,24 @@ concat_name (tree gnu_name, const char *suffix) return get_identifier_with_length (new_name, len); } +/* Initialize data structures of the decl.c module. */ + +void +init_gnat_decl (void) +{ + /* Initialize the cache of annotated values. */ + annotate_value_cache + = htab_create_ggc (512, tree_int_map_hash, tree_int_map_eq, 0); +} + +/* Destroy data structures of the decl.c module. */ + +void +destroy_gnat_decl (void) +{ + /* Destroy the cache of annotated values. */ + htab_delete (annotate_value_cache); + annotate_value_cache = NULL; +} + #include "gt-ada-decl.h" diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index b709273..76fa2ab 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -210,6 +210,12 @@ extern tree create_concat_name (Entity_Id gnat_entity, const char *suffix); the name followed by "___" and the specified suffix. */ extern tree concat_name (tree gnu_name, const char *suffix); +/* Initialize data structures of the decl.c module. */ +extern void init_gnat_decl (void); + +/* Destroy data structures of the decl.c module. */ +extern void destroy_gnat_decl (void); + /* Highest number in the front-end node table. */ extern int max_gnat_nodes; diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 4a4d0fa..59358ff 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -353,6 +353,7 @@ gigi (Node_Id gnat_root, /* Initialize ourselves. */ init_code_table (); + init_gnat_decl (); init_gnat_utils (); /* If we are just annotating types, give VOID_TYPE zero sizes to avoid @@ -727,6 +728,7 @@ gigi (Node_Id gnat_root, } /* Destroy ourselves. */ + destroy_gnat_decl (); destroy_gnat_utils (); /* We cannot track the location of errors past this point. */ diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 014fe36..cfa0791 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -251,8 +251,8 @@ init_gnat_utils (void) dummy_node_table = ggc_alloc_cleared_vec_tree (max_gnat_nodes); /* Initialize the hash table of padded types. */ - pad_type_hash_table = htab_create_ggc (512, pad_type_hash_hash, - pad_type_hash_eq, 0); + pad_type_hash_table + = htab_create_ggc (512, pad_type_hash_hash, pad_type_hash_eq, 0); } /* Destroy data structures of the utils.c module. */ |