[llvm] r234288 - DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Apr 6 21:07:31 PDT 2015


Author: dexonsmith
Date: Mon Apr  6 23:07:31 2015
New Revision: 234288

URL: http://llvm.org/viewvc/llvm-project?rev=234288&view=rev
Log:
DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()

A quick cleanup to sue `DebugNodeRef` instead of `Metadata*` for
`MDImportedEntity::getEntity()`.

Modified:
    llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
    llvm/trunk/lib/IR/DIBuilder.cpp

Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=234288&r1=234287&r2=234288&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Mon Apr  6 23:07:31 2015
@@ -2020,7 +2020,7 @@ class MDImportedEntity : public DebugNod
   ~MDImportedEntity() {}
 
   static MDImportedEntity *getImpl(LLVMContext &Context, unsigned Tag,
-                                   MDScope *Scope, Metadata *Entity,
+                                   MDScope *Scope, DebugNodeRef Entity,
                                    unsigned Line, StringRef Name,
                                    StorageType Storage,
                                    bool ShouldCreate = true) {
@@ -2040,7 +2040,7 @@ class MDImportedEntity : public DebugNod
 
 public:
   DEFINE_MDNODE_GET(MDImportedEntity,
-                    (unsigned Tag, MDScope *Scope, Metadata *Entity,
+                    (unsigned Tag, MDScope *Scope, DebugNodeRef Entity,
                      unsigned Line, StringRef Name = ""),
                     (Tag, Scope, Entity, Line, Name))
   DEFINE_MDNODE_GET(MDImportedEntity,
@@ -2052,7 +2052,7 @@ public:
 
   unsigned getLine() const { return Line; }
   MDScope *getScope() const { return cast_or_null<MDScope>(getRawScope()); }
-  Metadata *getEntity() const { return getRawEntity(); }
+  DebugNodeRef getEntity() const { return DebugNodeRef(getRawEntity()); }
   StringRef getName() const { return getStringOperand(2); }
 
   Metadata *getRawScope() const { return getOperand(0); }

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=234288&r1=234287&r2=234288&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Mon Apr  6 23:07:31 2015
@@ -174,7 +174,8 @@ static DIImportedEntity
 createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope Context,
                      Metadata *NS, unsigned Line, StringRef Name,
                      SmallVectorImpl<TrackingMDNodeRef> &AllImportedModules) {
-  DIImportedEntity M = MDImportedEntity::get(C, Tag, Context, NS, Line, Name);
+  DIImportedEntity M =
+      MDImportedEntity::get(C, Tag, Context, DebugNodeRef(NS), Line, Name);
   AllImportedModules.emplace_back(M.get());
   return M;
 }





More information about the llvm-commits mailing list