This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re-RFA PATCH to {extend,invoke,install,md}.texi for C++ attributes and typos



Happy new year etcetera.

This is the updated patch.  It still passes "make info dvi".  Approved?

Uh, should I change the copyright dates to 2001 before committing?


Index: extend.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/extend.texi,v
retrieving revision 1.79
diff -u -3 -p -r1.79 extend.texi
--- extend.texi	2000/12/28 18:48:02	1.79
+++ extend.texi	2000/12/31 05:45:18
@@ -2022,7 +2022,8 @@ attributes are currently defined for var
 @code{transparent_union}, @code{unused}, and @code{weak}.  Some other
 attributes are defined for variables on particular target systems.  Other
 attributes are available for functions (@pxref{Function Attributes}) and
-for types (@pxref{Type Attributes}).
+for types (@pxref{Type Attributes}).  Other front-ends might define more
+attributes (@pxref{C++ Extensions,,Extensions to the C++ Language}).
 
 You may also specify attributes with @samp{__} preceding and following
 each keyword.  This allows you to use them in header files without
@@ -3550,6 +3551,7 @@ Predefined Macros,cpp.info,The C Preproc
                          each needed template instantiation is emitted.
 * Bound member functions:: You can extract a function pointer to the
                         method denoted by a @samp{->*} or @samp{.*} expression.
+* C++ Attributes::  Variable, function, and type attributes for C++ only.
 @end menu
 
 @node Min and Max
@@ -4058,4 +4060,54 @@ fptr p1 = (fptr)(&A::foo);
 @end example
 
 You must specify @samp{-Wno-pmf-conversions} to use this extension.
+
+@node C++ Attributes
+@section C++-Specific Variable, Function, and Type Attributes
+
+Some attributes only make sense for C++ programs.
+
+@table @code
+@item init_priority (@var{priority})
+@cindex init_priority attribute
+
+
+In Standard C++, objects defined at namespace scope are guaranteed to be
+initialized in an order in strict accordance with that of their definitions
+@emph{in a given translation unit}.  No guarantee is made for initializations
+across translation units.  However, GNU C++ allows users to control the
+order of initialization of objects defined at namespace socpe with the
+@code{init_priority} attribute by specifying a relative @var{priority},
+a constant integral expression currently bounded between 101 and 65535
+inclusive.  Lower numbers indicate a higher priority.
+
+In the following example, @code{A} would normally be created before
+@code{B}, but the @code{init_priority} attribute has reversed that order:
+
+@example
+Some_Class  A  __attribute__ ((init_priority (2000)));
+Some_Class  B  __attribute__ ((init_priority (543)));
+@end example
+
+@noindent
+Note that the particular values of @var{priority} do not matter; only their
+relative ordering.
+
+
+@item com_interface
+@cindex com_interface attribute
+
+@c This is based on:  1) grepping the code, 
+@c 2) http://gcc.gnu.org/ml/gcc-bugs/1999-08n/msg01212.html
+@c 3) http://gcc.gnu.org/ml/gcc-bugs/1999-08n/msg01215.html
+@c and 4) a lot of guesswork.  You can tell I don't use COM.  -pme 21Dec00
+
+This type attribute takes no parameters, and marks a class or struct as an
+interface for communication via COM; the class will support the COM ABI
+rather than the full C++ ABI.  Currently this means that RTTI is not possible
+with the resulting class heirarchy.  The virtual pointer table will be
+changed to be COM-compliant.  Also, all classes and structs derived from one
+marked with this attribute are implicitly marked with the same attribute;
+thus, only the base class in a COM hierarchy needs @code{com_interface}.
+
+@end table
 
Index: install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/install.texi,v
retrieving revision 1.49
diff -u -3 -p -r1.49 install.texi
--- install.texi	2000/12/11 00:16:22	1.49
+++ install.texi	2000/12/31 05:45:18
@@ -942,7 +942,7 @@ AMD Am29050 used in a system running a v
 @item avr
 ATMEL AVR-family micro controllers.  These are used in embedded
 applications.  There are no standard Unix configurations.
-See @xref{AVR Options} for the list of supported MCU types.
+@xref{AVR Options}, for the list of supported MCU types.
 
 @item decstation-*
 MIPS-based DECstations can support three different personalities:
Index: invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/invoke.texi,v
retrieving revision 1.250
diff -u -3 -p -r1.250 invoke.texi
--- invoke.texi	2000/12/28 18:48:03	1.250
+++ invoke.texi	2000/12/31 05:45:19
@@ -161,7 +161,7 @@ in the following sections.
 -falt-external-templates
 -ffor-scope  -fno-for-scope  -fno-gnu-keywords  -fhonor-std
 -fhuge-objects  -fno-implicit-templates
--fno-implicit-inline-templates  -finit-priority
+-fno-implicit-inline-templates
 -fno-implement-inlines  -fms-extensions
 -fname-mangling-version-@var{n}  -fno-operator-names
 -fno-optional-diags  -fpermissive
@@ -1263,11 +1263,6 @@ implicitly (i.e. by use); only emit code
 Don't emit code for implicit instantiations of inline templates, either.
 The default is to handle inlines differently so that compiles with and
 without optimization will need the same set of explicit instantiations.
-
-@item -finit-priority
-Support @samp{__attribute__ ((init_priority (n)))} for controlling the
-order of initialization of file-scope objects.  On ELF targets, this
-requires GNU ld 2.10 or later.
 
 @item -fno-implement-inlines
 To save space, do not emit out-of-line copies of inline functions
Index: md.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/md.texi,v
retrieving revision 1.54
diff -u -3 -p -r1.54 md.texi
--- md.texi	2000/12/21 22:08:17	1.54
+++ md.texi	2000/12/31 05:45:19
@@ -2604,7 +2604,7 @@ that the jump optimizer will not delete 
 Conditional branch instruction that decrements a register and
 jumps if the register is non-zero.  Operand 0 is the register to
 decrement and test; operand 1 is the label to jump to if the
-register is non-zero.  @xref{Looping Patterns}
+register is non-zero.  @xref{Looping Patterns}.
 
 This optional instruction pattern is only used by the combiner,
 typically for loops reversed by the loop optimizer when strength
@@ -2620,7 +2620,7 @@ determined until run-time; operand 2 is 
 number of iterations as a @code{const_int}; operand 3 is the number of
 enclosed loops as a @code{const_int} (an innermost loop has a value of
 1); operand 4 is the label to jump to if the register is non-zero.
-@xref{Looping Patterns}
+@xref{Looping Patterns}.
 
 This optional instruction pattern should be defined for machines with
 low-overhead looping instructions as the loop optimizer will try to


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]