From d5e6a153ad0449dc019cb6a7ce41f71478d8e491 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 7 Apr 2015 04:07:31 +0000 Subject: [PATCH] DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity() A quick cleanup to sue `DebugNodeRef` instead of `Metadata*` for `MDImportedEntity::getEntity()`. llvm-svn: 234288 --- llvm/include/llvm/IR/DebugInfoMetadata.h | 6 +++--- llvm/lib/IR/DIBuilder.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h index 457e295..af873b9 100644 --- a/llvm/include/llvm/IR/DebugInfoMetadata.h +++ b/llvm/include/llvm/IR/DebugInfoMetadata.h @@ -2020,7 +2020,7 @@ class MDImportedEntity : public DebugNode { ~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 DebugNode { 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(getRawScope()); } - Metadata *getEntity() const { return getRawEntity(); } + DebugNodeRef getEntity() const { return DebugNodeRef(getRawEntity()); } StringRef getName() const { return getStringOperand(2); } Metadata *getRawScope() const { return getOperand(0); } diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp index a6e3d3b..ba314b4 100644 --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -174,7 +174,8 @@ static DIImportedEntity createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope Context, Metadata *NS, unsigned Line, StringRef Name, SmallVectorImpl &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; } -- 2.7.4