diff options
author | Olivier Hainque <hainque@adacore.com> | 2009-06-09 15:32:03 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2009-06-09 15:32:03 +0000 |
commit | ff346f70754c95c575fabaecb428d29115e7a7a5 (patch) | |
tree | 5a201c72baed287b76549a13fc9f60bd546845d5 /gcc/ada/gcc-interface/gigi.h | |
parent | 6aa0b21841f542af5e5f30054744f81905108ad0 (diff) | |
download | gcc-ff346f70754c95c575fabaecb428d29115e7a7a5.zip gcc-ff346f70754c95c575fabaecb428d29115e7a7a5.tar.gz gcc-ff346f70754c95c575fabaecb428d29115e7a7a5.tar.bz2 |
utils2.c (build_call_alloc_dealloc_proc): New helper for build_call_alloc_dealloc with arguments to be interpreted...
ada/
* gcc-interface/utils2.c (build_call_alloc_dealloc_proc): New
helper for build_call_alloc_dealloc with arguments to be interpreted
identically. Process the case where a GNAT_PROC to call is provided.
(maybe_wrap_malloc): New helper for build_call_alloc_dealloc, to build
and return an allocator for DATA_SIZE bytes aimed at containing a
DATA_TYPE object, using the default __gnat_malloc allocator. Honor
DATA_TYPE alignments greater than what the latter offers.
(maybe_wrap_free): New helper for build_call_alloc_dealloc, to
release a DATA_TYPE object designated by DATA_PTR using the
__gnat_free entry point.
(build_call_alloc_dealloc): Expect object data type instead of naked
alignment constraint. Use the new helpers.
(build_allocator): Remove special processing for the super-aligned
case, now handled by build_call_alloc_dealloc. Pass data type instead
of the former alignment argument, as expected by the new interface.
* gcc-interface/gigi.h (build_call_alloc_dealloc): Adjust prototype
and comment.
* gcc-interface/trans.c (gnat_to_gnu) <case N_Free_Statement>:
Remove special processing for the super-aligned case, now handled
by build_call_alloc_dealloc. Pass data type instead of the former
alignment argument, as expected by the new interface.
testsuite/
* gnat.dg/align_max.adb: New test.
From-SVN: r148314
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index 4d19b42..7bc89ee 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -843,13 +843,13 @@ extern tree build_component_ref (tree record_variable, tree component, If GNU_OBJ is nonzero, it is an object to deallocate. Otherwise, generate an allocator. - GNU_SIZE is the size of the object in bytes and ALIGN is the alignment - in bits. GNAT_PROC, if present, is a procedure to call and GNAT_POOL - is the storage pool to use. If not present, malloc and free are used. - GNAT_NODE is used to provide an error location for restriction violation - messages. */ + GNU_SIZE is the number of bytes to allocate and GNU_TYPE is the contained + object type, used to determine the to-be-honored address alignment. + GNAT_PROC, if present, is a procedure to call and GNAT_POOL is the storage + pool to use. If not present, malloc and free are used. GNAT_NODE is used + to provide an error location for restriction violation messages. */ extern tree build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, - unsigned align, Entity_Id gnat_proc, + tree gnu_type, Entity_Id gnat_proc, Entity_Id gnat_pool, Node_Id gnat_node); /* Build a GCC tree to correspond to allocating an object of TYPE whose |