DebugInfo: Remove typedefs for DITypeRef, etc.
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 20 Apr 2015 18:20:03 +0000 (18:20 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 20 Apr 2015 18:20:03 +0000 (18:20 +0000)
Remove typedefs for type refs:

  - DITypeRef => MDTypeRef
  - DIScopeRef => MDScopeRef
  - DIDescriptorRef => DebugNodeRef

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

include/llvm/IR/DIBuilder.h
include/llvm/IR/DebugInfo.h
include/llvm/IR/DebugInfoMetadata.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/IR/DIBuilder.cpp

index db876549ca86a47fc5bf842f9397288d1d60b0ee..983f2fc70c05a22250e14b8926c13eaa1263cacd 100644 (file)
@@ -522,7 +522,7 @@ namespace llvm {
     /// FIXME: this is added for dragonegg. Once we update dragonegg
     /// to call resolve function, this will be removed.
     MDSubprogram *
     /// FIXME: this is added for dragonegg. Once we update dragonegg
     /// to call resolve function, this will be removed.
     MDSubprogram *
-    createFunction(DIScopeRef Scope, StringRef Name, StringRef LinkageName,
+    createFunction(MDScopeRef Scope, StringRef Name, StringRef LinkageName,
                    MDFile *File, unsigned LineNo, MDSubroutineType *Ty,
                    bool isLocalToUnit, bool isDefinition, unsigned ScopeLine,
                    unsigned Flags = 0, bool isOptimized = false,
                    MDFile *File, unsigned LineNo, MDSubroutineType *Ty,
                    bool isLocalToUnit, bool isDefinition, unsigned ScopeLine,
                    unsigned Flags = 0, bool isOptimized = false,
index eede59d725d64c8c791564d796b3ccbddc6b9879..2762086b6e9d37d04ec3c7fb09472e995e705339 100644 (file)
@@ -88,9 +88,6 @@ DECLARE_SIMPLIFY_DESCRIPTOR(DIImportedEntity)
 
 typedef DebugNodeArray DIArray;
 typedef MDTypeRefArray DITypeArray;
 
 typedef DebugNodeArray DIArray;
 typedef MDTypeRefArray DITypeArray;
-typedef DebugNodeRef DIDescriptorRef;
-typedef MDScopeRef DIScopeRef;
-typedef MDTypeRef DITypeRef;
 
 class DISubrange {
   MDSubrange *N;
 
 class DISubrange {
   MDSubrange *N;
index 62373c4b09f37db127f8abc33b28fba3824d1dfc..6fef1895ec3deeaca27de66d990efb023abaea09 100644 (file)
@@ -2141,7 +2141,7 @@ public:
   /// \brief Get the type.
   ///
   /// \note Objective-C doesn't have an ODR, so there is no benefit in storing
   /// \brief Get the type.
   ///
   /// \note Objective-C doesn't have an ODR, so there is no benefit in storing
-  /// the type as a DITypeRef here.
+  /// a type ref here.
   MDType *getType() const { return cast_or_null<MDType>(getRawType()); }
 
   StringRef getFilename() const {
   MDType *getType() const { return cast_or_null<MDType>(getRawType()); }
 
   StringRef getFilename() const {
index 0336b946e85758c53b74dcbec6bea350e2f59304..c69edddc0498e12156deece590406bc069d46cce 100644 (file)
@@ -174,13 +174,13 @@ DIType DbgVariable::getType() const {
     uint16_t tag = Ty->getTag();
 
     if (tag == dwarf::DW_TAG_pointer_type)
     uint16_t tag = Ty->getTag();
 
     if (tag == dwarf::DW_TAG_pointer_type)
-      subType = resolve(DITypeRef(cast<MDDerivedType>(Ty)->getBaseType()));
+      subType = resolve(cast<MDDerivedType>(Ty)->getBaseType());
 
     auto Elements = cast<MDCompositeTypeBase>(subType)->getElements();
     for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
       auto *DT = cast<MDDerivedTypeBase>(Elements[i]);
       if (getName() == DT->getName())
 
     auto Elements = cast<MDCompositeTypeBase>(subType)->getElements();
     for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
       auto *DT = cast<MDDerivedTypeBase>(Elements[i]);
       if (getName() == DT->getName())
-        return resolve(DITypeRef(DT->getBaseType()));
+        return resolve(DT->getBaseType());
     }
   }
   return Ty;
     }
   }
   return Ty;
index b73ca99961ef81354b722617f97e6994e2f74887..1dd6b49e48bd72e9a8bd96cf8509fade0046df28 100644 (file)
@@ -617,7 +617,7 @@ static bool isUnsignedDIType(DwarfDebug *DD, DIType Ty) {
            T == dwarf::DW_TAG_volatile_type ||
            T == dwarf::DW_TAG_restrict_type ||
            T == dwarf::DW_TAG_enumeration_type);
            T == dwarf::DW_TAG_volatile_type ||
            T == dwarf::DW_TAG_restrict_type ||
            T == dwarf::DW_TAG_enumeration_type);
-    if (DITypeRef Deriv = DTy->getBaseType())
+    if (MDTypeRef Deriv = DTy->getBaseType())
       return isUnsignedDIType(DD, DD->resolve(Deriv));
     // FIXME: Enums without a fixed underlying type have unknown signedness
     // here, leading to incorrectly emitted constants.
       return isUnsignedDIType(DD, DD->resolve(Deriv));
     // FIXME: Enums without a fixed underlying type have unknown signedness
     // here, leading to incorrectly emitted constants.
@@ -813,7 +813,7 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
   // DW_TAG_restrict_type is not supported in DWARF2
   if (Ty->getTag() == dwarf::DW_TAG_restrict_type && DD->getDwarfVersion() <= 2)
     return getOrCreateTypeDIE(
   // DW_TAG_restrict_type is not supported in DWARF2
   if (Ty->getTag() == dwarf::DW_TAG_restrict_type && DD->getDwarfVersion() <= 2)
     return getOrCreateTypeDIE(
-        resolve(DITypeRef(cast<MDDerivedType>(Ty)->getBaseType())));
+        resolve(cast<MDDerivedType>(Ty)->getBaseType()));
 
   // Construct the context before querying for the existence of the DIE in case
   // such construction creates the DIE.
 
   // Construct the context before querying for the existence of the DIE in case
   // such construction creates the DIE.
index 891fb861ac9f76977b093b6aed729187936eddc5..9e0474ebce092686d058fada25b5ddb30f2d7c33 100644 (file)
@@ -622,13 +622,13 @@ MDExpression* DIBuilder::createBitPieceExpression(unsigned OffsetInBytes,
   return MDExpression::get(VMContext, Addr);
 }
 
   return MDExpression::get(VMContext, Addr);
 }
 
-MDSubprogram* DIBuilder::createFunction(DIScopeRef Context, StringRef Name,
-                                       StringRef LinkageName, MDFile* File,
-                                       unsigned LineNo, MDSubroutineType* Ty,
-                                       bool isLocalToUnit, bool isDefinition,
-                                       unsigned ScopeLine, unsigned Flags,
-                                       bool isOptimized, Function *Fn,
-                                       MDNode *TParams, MDNode *Decl) {
+MDSubprogram *DIBuilder::createFunction(MDScopeRef Context, StringRef Name,
+                                        StringRef LinkageName, MDFile *File,
+                                        unsigned LineNo, MDSubroutineType *Ty,
+                                        bool isLocalToUnit, bool isDefinition,
+                                        unsigned ScopeLine, unsigned Flags,
+                                        bool isOptimized, Function *Fn,
+                                        MDNode *TParams, MDNode *Decl) {
   // dragonegg does not generate identifier for types, so using an empty map
   // to resolve the context should be fine.
   DITypeIdentifierMap EmptyMap;
   // dragonegg does not generate identifier for types, so using an empty map
   // to resolve the context should be fine.
   DITypeIdentifierMap EmptyMap;