Rename DIBuilder::createNullPtrType to createUnspecifiedType and introduce
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 27 Jun 2013 22:50:59 +0000 (22:50 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 27 Jun 2013 22:50:59 +0000 (22:50 +0000)
a zero-argument createNullPtrType function for creating the canonical
nullptr type.

Differential Revision: http://llvm-reviews.chandlerc.com/D1050

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185114 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DIBuilder.h
lib/IR/DIBuilder.cpp

index 021ef06e6c181f30eb06150164c765bb5b022d40..e7751d18f8af591877fe22bbbc30aa07cf64717c 100644 (file)
@@ -115,8 +115,11 @@ namespace llvm {
     /// 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 0dc0ed1720b51c24e0c592050684220bb46499a3..e30dcdca32ae0fc74b3a6d46643bdfd993a97bc8 100644 (file)
@@ -208,11 +208,11 @@ DIEnumerator DIBuilder::createEnumerator(StringRef Name, int64_t Val) {
   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 @@ DIBasicType DIBuilder::createNullPtrType(StringRef Name) {
   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