diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-09-25 20:15:10 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-09-25 20:15:10 +0000 |
commit | dee12fcd11764d3a1c2f5f6f8d00a2b17f1119ec (patch) | |
tree | 135262bbdf17968f20151428c4863f4df55757d0 /gcc/ada/gcc-interface/decl.c | |
parent | dea976c48066580dff56c1055027d7398072bfc9 (diff) | |
download | gcc-dee12fcd11764d3a1c2f5f6f8d00a2b17f1119ec.zip gcc-dee12fcd11764d3a1c2f5f6f8d00a2b17f1119ec.tar.gz gcc-dee12fcd11764d3a1c2f5f6f8d00a2b17f1119ec.tar.bz2 |
decl.c (gnat_to_gnu_entity): Use XNEW instead of xmalloc.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Subtype>: Use
XNEW instead of xmalloc. Do not build useless pointer type.
<E_Anonymous_Access_Subprogram_Type>: Use XNEW instead of xmalloc.
* gcc-interface/trans.c (gnat_to_gnu) <N_Raise_Constraint_Error>: Tidy.
* gcc-interface/utils2.c (build_unary_op): Remove local variable.
From-SVN: r179168
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index d96f683..fb552ae 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -3512,8 +3512,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) fill it in later. */ if (!definition && defer_incomplete_level != 0) { - struct incomplete *p - = (struct incomplete *) xmalloc (sizeof (struct incomplete)); + struct incomplete *p = XNEW (struct incomplete); gnu_type = build_pointer_type @@ -3838,15 +3837,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) case E_Access_Subtype: /* We treat this as identical to its base type; any constraint is - meaningful only to the front end. + meaningful only to the front-end. The designated type must be elaborated as well, if it does not have its own freeze node. Designated (sub)types created for constrained components of records with discriminants are - not frozen by the front end and thus not elaborated by gigi, + not frozen by the front-end and thus not elaborated by gigi, because their use may appear before the base type is frozen, and because it is not clear that they are needed anywhere in - Gigi. With the current model, there is no correct place where + gigi. With the current model, there is no correct place where they could be elaborated. */ gnu_type = gnat_to_gnu_type (Etype (gnat_entity)); @@ -3860,20 +3859,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) elaborate it later. */ if (!definition && defer_incomplete_level != 0) { - struct incomplete *p - = (struct incomplete *) xmalloc (sizeof (struct incomplete)); - tree gnu_ptr_type - = build_pointer_type - (make_dummy_type (Directly_Designated_Type (gnat_entity))); + struct incomplete *p = XNEW (struct incomplete); - p->old_type = TREE_TYPE (gnu_ptr_type); + p->old_type + = make_dummy_type (Directly_Designated_Type (gnat_entity)); p->full_type = Directly_Designated_Type (gnat_entity); p->next = defer_incomplete_list; defer_incomplete_list = p; } else if (!IN (Ekind (Base_Type - (Directly_Designated_Type (gnat_entity))), - Incomplete_Or_Private_Kind)) + (Directly_Designated_Type (gnat_entity))), + Incomplete_Or_Private_Kind)) gnat_to_gnu_entity (Directly_Designated_Type (gnat_entity), NULL_TREE, 0); } |