[llvm] r235323 - DebugInfo: Remove typedefs for DITypeRef, etc.

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Apr 20 11:20:05 PDT 2015


Author: dexonsmith
Date: Mon Apr 20 13:20:03 2015
New Revision: 235323

URL: http://llvm.org/viewvc/llvm-project?rev=235323&view=rev
Log:
DebugInfo: Remove typedefs for DITypeRef, etc.

Remove typedefs for type refs:

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

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

Modified: llvm/trunk/include/llvm/IR/DIBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DIBuilder.h?rev=235323&r1=235322&r2=235323&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DIBuilder.h (original)
+++ llvm/trunk/include/llvm/IR/DIBuilder.h Mon Apr 20 13:20:03 2015
@@ -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 *
-    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,

Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=235323&r1=235322&r2=235323&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Mon Apr 20 13:20:03 2015
@@ -88,9 +88,6 @@ DECLARE_SIMPLIFY_DESCRIPTOR(DIImportedEn
 
 typedef DebugNodeArray DIArray;
 typedef MDTypeRefArray DITypeArray;
-typedef DebugNodeRef DIDescriptorRef;
-typedef MDScopeRef DIScopeRef;
-typedef MDTypeRef DITypeRef;
 
 class DISubrange {
   MDSubrange *N;

Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=235323&r1=235322&r2=235323&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Mon Apr 20 13:20:03 2015
@@ -2141,7 +2141,7 @@ public:
   /// \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 {

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=235323&r1=235322&r2=235323&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Apr 20 13:20:03 2015
@@ -174,13 +174,13 @@ DIType DbgVariable::getType() const {
     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())
-        return resolve(DITypeRef(DT->getBaseType()));
+        return resolve(DT->getBaseType());
     }
   }
   return Ty;

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=235323&r1=235322&r2=235323&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Mon Apr 20 13:20:03 2015
@@ -617,7 +617,7 @@ static bool isUnsignedDIType(DwarfDebug
            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.
@@ -813,7 +813,7 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const
   // 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.

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=235323&r1=235322&r2=235323&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Mon Apr 20 13:20:03 2015
@@ -622,13 +622,13 @@ MDExpression* DIBuilder::createBitPieceE
   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;





More information about the llvm-commits mailing list