[dragonegg PATCH] Fix debug info for std::nullptr_t

Eric Christopher echristo at gmail.com
Wed Jun 26 16:57:52 PDT 2013


On Wed, Jun 26, 2013 at 4:52 PM, Robinson, Paul
<Paul_Robinson at playstation.sony.com> wrote:
>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
>> bounces at cs.uiuc.edu] On Behalf Of David Blaikie
>> On Wed, Jun 26, 2013 at 3:46 PM, Peter Collingbourne <peter at pcc.me.uk>
>> wrote:
>> > On Wed, Jun 26, 2013 at 02:42:49PM -0700, David Blaikie wrote:
>> >> On Wed, Jun 26, 2013 at 2:35 PM, Peter Collingbourne
>> <peter at pcc.me.uk> wrote:
>> >> > So the name is left unspecified.  Unsurprisingly, Clang and GCC
>> have
>> >> > diverged here -- Clang uses "nullptr_t" as the name while GCC uses
>> >> > "decltype(nullptr)".  A standards proposal of sorts [1] proposes
>> that
>> >> > "decltype(nullptr)" be used.
>> >> > [1]
>> http://wiki.dwarfstd.org/index.php?title=C%2B%2B0x:_Null_pointer
>> >>
>> >> The proposal (which isn't proposing anything) merely states that "the
>> >> type of nullptr is decltype(nullptr)" which is true but incomplete,
>> >> the C++ standard states "The pointer literal is the keyword nullptr.
>> >> It is a prvalue of type std::nullptr_t." (though I'll admit we
>> >> probably don't put the nullptr_t type in the std namespace)
>> >
>> > It's a badly written proposal.  The actual "proposal" (to use
>> > "decltype(nullptr)" as the name) is hidden in the "example" section
>> > (and could possibly be inferred from the other sections and a leap
>> > of faith).
>>
>> Yeah, it's not clear which parts of the example are intended to be
>> significant.
>>
>> > I wouldn't call the proposal incomplete, at least not in the way
>> > you mention.
>>
>> Well, more that it didn't propose any change to DWARF, so I'm not sure
>> what it was really proposing.
>
> The history is that somebody on the DWARF committee was tasked with
> identifying all the new C++0x features that might require new DWARF
> features, and creating proposals to address them.  'nullptr' was on
> the list, but he concluded "nothing to do here" at least as far as
> the DWARF spec is concerned.
>

Yeah. Secret handshakes and all are annoying for communicating between
producers and consumers, but I'm not sure if we need another type tag
to refer to c++ nullptr specifically.

-eric

> DWARF per se doesn't care what the name is, and an example from the
> DWARF wiki can hardly be considered definitive.  On the other hand,
> if a debugger wants that type to have a particular name, and/or a
> compiler is willing to provide it, that's up to y'all.
>



More information about the llvm-commits mailing list