diff options
author | Laurynas Biveinis <laurynas.biveinis@gmail.com> | 2012-07-30 02:30:52 +0000 |
---|---|---|
committer | Laurynas Biveinis <lauras@gcc.gnu.org> | 2012-07-30 02:30:52 +0000 |
commit | c0fd34971d2d719227d63ed8d069089862ec9c9f (patch) | |
tree | 17345bf96a8e18558d9570c89caead4ccc1f2122 /gcc/doc | |
parent | 1c5f95e6ec470584f537c632200b92c9feb5f7f3 (diff) | |
download | gcc-c0fd34971d2d719227d63ed8d069089862ec9c9f.zip gcc-c0fd34971d2d719227d63ed8d069089862ec9c9f.tar.gz gcc-c0fd34971d2d719227d63ed8d069089862ec9c9f.tar.bz2 |
gengtype.c (adjust_field_type): Diagnose duplicate "length" option applications and option being applied to...
gcc:
2012-07-27 Laurynas Biveinis <laurynas.biveinis@gmail.com>
Steven Bosscher <steven@gcc.gnu.org>
* gengtype.c (adjust_field_type): Diagnose duplicate "length"
option applications and option being applied to arrays of atomic
types.
(walk_type): Allow "atomic" option on strings too.
* dwarf2out.h (struct dw_vec_struct): Use the "atomic" GTY option
for the array field.
* vec.h: Describe the atomic object "A" type of the macros in
the header comment.
(VEC_T_GTY_ATOMIC, DEF_VEC_A, DEF_VEC_ALLOC_A): Define.
* emit-rtl.c (locations_locators_vals): use the atomic object
vector.
* doc/gty.texi: Clarify that GTY option "length" is only for
arrays of non-atomic objects. Fix typo in the description of the
"atomic" option.
gcc/java:
2012-07-24 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* jcf.h (CPool): Use the "atomic" GTY option for the tags field.
(bootstrap_method): Likewise for the bootstrap_arguments field.
libcpp:
2012-07-24 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* include/line-map.h (line_map_macro): Use the "atomic" GTY option
for the macro_locations field.
Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
From-SVN: r189951
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/gty.texi | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi index cff3ffd..ad0423a 100644 --- a/gcc/doc/gty.texi +++ b/gcc/doc/gty.texi @@ -134,8 +134,8 @@ The available options are: @item length ("@var{expression}") There are two places the type machinery will need to be explicitly told -the length of an array. The first case is when a structure ends in a -variable-length array, like this: +the length of an array of non-atomic objects. The first case is when a +structure ends in a variable-length array, like this: @smallexample struct GTY(()) rtvec_def @{ int num_elem; /* @r{number of elements} */ @@ -163,6 +163,11 @@ This second use of @code{length} also works on global variables, like: static GTY((length("reg_known_value_size"))) rtx *reg_known_value; @end verbatim +Note that the @code{length} option is only meant for use with arrays of +non-atomic objects, that is, objects that contain pointers pointing to +other GTY-managed objects. For other GC-allocated arrays and strings +you should use @code{atomic}. + @findex skip @item skip @@ -411,7 +416,7 @@ Here is an example of how to use it: @smallexample struct GTY(()) my_struct @{ int number_of_elements; - unsigned int GTY ((atomic)) * elements; + unsigned int * GTY ((atomic)) elements; @}; @end smallexample In this case, @code{elements} is a pointer under GC, and the memory it |