aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-11-09 11:14:37 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-11-09 11:14:37 -0500
commit7dbb85a7932149aa5bac38fd77424b15c0248990 (patch)
treeaf7983d092e390f212209b62a57e8d2eac7d8be6 /gcc/doc
parent52dccf7ac9926edabb9574d6440314938a33c143 (diff)
downloadgcc-7dbb85a7932149aa5bac38fd77424b15c0248990.zip
gcc-7dbb85a7932149aa5bac38fd77424b15c0248990.tar.gz
gcc-7dbb85a7932149aa5bac38fd77424b15c0248990.tar.bz2
Add C++ attribute abi_tag and -Wabi-tag option.
gcc/ * attribs.c (lookup_attribute_spec): Handle getting a TREE_LIST. gcc/c-family/ * c.opt (Wabi-tag): New. gcc/cp/ * tree.c (cxx_attribute_table): Add abi_tag attribute. (check_abi_tag_redeclaration, handle_abi_tag_attribute): New. * class.c (find_abi_tags_r, check_abi_tags): New. (check_bases, check_field_decl): Call check_abi_tags. * decl.c (redeclaration_error_message): Call check_abi_tag_redeclaration. * mangle.c (tree_string_cmp, write_abi_tags): New. (write_unqualified_name): Call write_abi_tags. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_TAGGED_NAME. libiberty/ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_TAGGED_NAME. (d_make_comp, d_find_pack, d_print_comp): Likewise. (d_abi_tags): New. (d_name): Call it. From-SVN: r193367
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 54fd548..fe09b85 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -15598,6 +15598,27 @@ You must specify @option{-Wno-pmf-conversions} to use this extension.
Some attributes only make sense for C++ programs.
@table @code
+@item abi_tag ("@var{tag}", ...)
+@cindex @code{abi_tag} attribute
+The @code{abi_tag} attribute can be applied to a function or class
+declaration. It modifies the mangled name of the function or class to
+incorporate the tag name, in order to distinguish the function or
+class from an earlier version with a different ABI; perhaps the class
+has changed size, or the function has a different return type that is
+not encoded in the mangled name.
+
+The argument can be a list of strings of arbitrary length. The
+strings are sorted on output, so the order of the list is
+unimportant.
+
+A redeclaration of a function or class must not add new ABI tags,
+since doing so would change the mangled name.
+
+The @option{-Wabi-tag} flag enables a warning about a class which does
+not have all the ABI tags used by its subobjects; for users with code
+that needs to coexist with an earlier ABI, using this option can help
+to find all affected types that need to be tagged.
+
@item init_priority (@var{priority})
@cindex @code{init_priority} attribute