[cfe-commits] r59441 - in /cfe/trunk: Driver/ docs/ include/clang/AST/ include/clang/Basic/ include/clang/Lex/ lib/AST/ lib/Basic/ lib/CodeGen/ lib/Sema/

Doug Gregor doug.gregor at gmail.com
Mon Nov 17 10:10:52 PST 2008


On Mon, Nov 17, 2008 at 1:05 PM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
> Douglas Gregor wrote:
>>
>> Author: dgregor
>> Date: Mon Nov 17 08:58:09 2008
>> New Revision: 59441
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=59441&view=rev
>> Log:
>> Introduction the DeclarationName class, as a single, general method of
>> representing the names of declarations in the C family of
>> languages. DeclarationName is used in NamedDecl to store the name of
>> the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
>>
>
> Nitpicking the documentation here.

Great, thanks!

>>
>> +
>> +<p>Given
>> +  a <code>DeclarationName</code> <code>N</code>,
>> <code>N.getNameKind()</code>
>> +  will produce a valid that describes what kind of name <code>N</code>
>> +  stores. There are 7 options (all of the names are inside
>> +  the <code>DeclarationName</code> class)</p>
>>
>
> Will produce a "valid"?

Oops, "value".

>>
>> +
>> +  <dt>CXXDestructorName</dt>
>> +  <dd>The name is a C++ destructor
>> +    name. Use <code>N.getCXXNameType()</code> to retrieve
>> +    the <a href="#QualType">type</a> whose destructor is being
>> +    named. This type is always a canonical type.</dd>
>>
>>
>
> Does this take into account the seriously weird ways in which a destructor
> can be called?
>
> struct Foo {
>  typedef Foo Bar;
> };
> typedef Foo Baz;
>
> Foo f;
> f.Baz::~Bar()

Yuck. DeclarationName itself will only be concerned with the "~Bar"
part of this (which will actually be represented as ~Foo in the
DeclarationName, since we store the canonical type). Qualified name
lookup will deal with the Baz:: part, and the rest will need to be
dealt with in our representation of pseudo-destructor expressions
(which I haven't thought about yet).

  - Doug



More information about the cfe-commits mailing list