[PATCH] Update the kinds of DeclarationName in the InternalsManual
Justin Bogner
mail at justinbogner.com
Mon Jul 22 17:50:51 PDT 2013
Ping.
Justin Bogner <mail at justinbogner.com> writes:
> The InternalsManual seems to be a bit out of date. Can someone please
> commit?
>
>
> From 1c3d4db702600b6a71555addbe622e3bc0cb5c8d Mon Sep 17 00:00:00 2001
> From: Justin Bogner <mail at justinbogner.com>
> Date: Sun, 14 Jul 2013 15:25:50 -0600
> Subject: [PATCH] docs: Update the kinds of DeclarationName in the
> InternalsManual
>
> A few things were out of date regarding declaration names:
>
> - There are 10 kinds of DeclarationName, not 8
> - Identifier is no longer used for C++ operators, so the note in
> Identifier about them is invalid
> - CXXLiteralOperatorName and CXXUsingDirective weren't documented
> ---
> docs/InternalsManual.rst | 23 +++++++++++++++++------
> 1 file changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/docs/InternalsManual.rst b/docs/InternalsManual.rst
> index 59dd2f9..6f55702 100644
> --- a/docs/InternalsManual.rst
> +++ b/docs/InternalsManual.rst
> @@ -950,17 +950,13 @@ functions, Objective-C methods, C++ constructors, destructors, and operators
> ``DeclarationName`` is designed to efficiently represent any kind of name.
>
> Given a ``DeclarationName`` ``N``, ``N.getNameKind()`` will produce a value
> -that describes what kind of name ``N`` stores. There are 8 options (all of the
> -names are inside the ``DeclarationName`` class).
> +that describes what kind of name ``N`` stores. There are 10 options (all of
> +the names are inside the ``DeclarationName`` class).
>
> ``Identifier``
>
> The name is a simple identifier. Use ``N.getAsIdentifierInfo()`` to retrieve
> the corresponding ``IdentifierInfo*`` pointing to the actual identifier.
> - Note that C++ overloaded operators (e.g., "``operator+``") are represented as
> - special kinds of identifiers. Use ``IdentifierInfo``'s
> - ``getOverloadedOperatorID`` function to determine whether an identifier is an
> - overloaded operator name.
>
> ``ObjCZeroArgSelector``, ``ObjCOneArgSelector``, ``ObjCMultiArgSelector``
>
> @@ -999,6 +995,21 @@ names are inside the ``DeclarationName`` class).
> Use ``N.getCXXOverloadedOperator()`` to retrieve the overloaded operator (a
> value of type ``OverloadedOperatorKind``).
>
> +``CXXLiteralOperatorName``
> +
> + The name is a C++11 user defined literal operator. User defined
> + Literal operators are named according to the suffix they define,
> + e.g., "``_foo``" for "``operator "" _foo``". Use
> + ``N.getCXXLiteralIdentifier()`` to retrieve the corresponding
> + ``IdentifierInfo*`` pointing to the identifier.
> +
> +``CXXUsingDirective``
> +
> + The name is a C++ using directive. Using directives are not really
> + NamedDecls, in that they all have the same name, but they are
> + implemented as such in order to store them in DeclContext
> + effectively.
> +
> ``DeclarationName``\ s are cheap to create, copy, and compare. They require
> only a single pointer's worth of storage in the common cases (identifiers,
> zero- and one-argument Objective-C selectors) and use dense, uniqued storage
More information about the cfe-commits
mailing list