[PATCH] Rename DIBuilder::createNullPtrType to createUnspecifiedType and introduce a zero-argument createNullPtrType function for creating the canonical nullptr type.

Peter Collingbourne peter at pcc.me.uk
Wed Jun 26 22:34:06 PDT 2013


The name would be embedded in the IR, right?  So I don't think we
can test this code starting from IR.

On Wed, Jun 26, 2013 at 05:42:27PM -0700, Eric Christopher wrote:
> Not for the builder, no. Thought I'd had was to verify that nullptr_t
> after they're passed to the backend come out with the correct name.
> Probably overkill though I guess.
> 
> -eric
> 
> On Wed, Jun 26, 2013 at 5:41 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> > That would be test/CodeGenCXX/debug-info-nullptr.cpp in Clang I
> > believe.  Unless we have a separate set of DIBuilder tests in LLVM
> > (which I couldn't find).
> >
> > On Wed, Jun 26, 2013 at 05:31:36PM -0700, Eric Christopher wrote:
> >> Testcase that checks the name please :)
> >>
> >> -eric
> >>
> >> On Wed, Jun 26, 2013 at 5:28 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> >> > Hi dblaikie,
> >> >
> >> > http://llvm-reviews.chandlerc.com/D1050
> >> >
> >> > Files:
> >> >   include/llvm/DIBuilder.h
> >> >   lib/IR/DIBuilder.cpp
> >> >
> >> > Index: include/llvm/DIBuilder.h
> >> > ===================================================================
> >> > --- include/llvm/DIBuilder.h
> >> > +++ include/llvm/DIBuilder.h
> >> > @@ -115,8 +115,11 @@
> >> >      /// createEnumerator - Create a single enumerator value.
> >> >      DIEnumerator createEnumerator(StringRef Name, int64_t Val);
> >> >
> >> > -    /// createNullPtrType - Create C++0x nullptr type.
> >> > -    DIBasicType createNullPtrType(StringRef Name);
> >> > +    /// \brief Create a DWARF unspecified type.
> >> > +    DIBasicType createUnspecifiedType(StringRef Name);
> >> > +
> >> > +    /// \brief Create C++11 nullptr type.
> >> > +    DIBasicType createNullPtrType();
> >> >
> >> >      /// createBasicType - Create debugging information entry for a basic
> >> >      /// type.
> >> > Index: lib/IR/DIBuilder.cpp
> >> > ===================================================================
> >> > --- lib/IR/DIBuilder.cpp
> >> > +++ lib/IR/DIBuilder.cpp
> >> > @@ -208,11 +208,11 @@
> >> >    return DIEnumerator(MDNode::get(VMContext, Elts));
> >> >  }
> >> >
> >> > -/// createNullPtrType - Create C++11 nullptr type.
> >> > -DIBasicType DIBuilder::createNullPtrType(StringRef Name) {
> >> > +/// \brief Create a DWARF unspecified type.
> >> > +DIBasicType DIBuilder::createUnspecifiedType(StringRef Name) {
> >> >    assert(!Name.empty() && "Unable to create type without name");
> >> > -  // nullptr is encoded in DIBasicType format. Line number, filename,
> >> > -  // ,size, alignment, offset and flags are always empty here.
> >> > +  // Unspecified types are encoded in DIBasicType format. Line number, filename,
> >> > +  // size, alignment, offset and flags are always empty here.
> >> >    Value *Elts[] = {
> >> >      GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_type),
> >> >      NULL, // Filename
> >> > @@ -228,6 +228,11 @@
> >> >    return DIBasicType(MDNode::get(VMContext, Elts));
> >> >  }
> >> >
> >> > +/// \brief Create C++11 nullptr type.
> >> > +DIBasicType DIBuilder::createNullPtrType() {
> >> > +  return createUnspecifiedType("decltype(nullptr)");
> >> > +}
> >> > +
> >> >  /// createBasicType - Create debugging information entry for a basic
> >> >  /// type, e.g 'char'.
> >> >  DIBasicType
> >> >
> >> > _______________________________________________
> >> > llvm-commits mailing list
> >> > llvm-commits at cs.uiuc.edu
> >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >> >
> >>
> >
> > --
> > Peter
> 

-- 
Peter



More information about the llvm-commits mailing list