DebugInfo: Gut DIDescriptor

PR23080 is almost finished.  With this commit, there's no consequential
API in `DIDescriptor` and its subclasses.  What's left?

  - Default-constructed to `nullptr`.
  - Handy `const_cast<>` (constructed from `const`, but accessors are
    non-`const`).

I think the safe way to catch those is to delete the classes and fix
compile errors.  That'll be my next step, after I delete the `DITypeRef`
(etc.) wrapper around `MDTypeRef`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235069 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-16 01:53:33 +00:00
parent 9c1aa1c021
commit b07e129e63
7 changed files with 19 additions and 69 deletions

View File

@ -203,7 +203,7 @@ DIImportedEntity DIBuilder::createImportedDeclaration(DIScope Context,
// types that have one.
return ::createImportedModule(
VMContext, dwarf::DW_TAG_imported_declaration, Context,
DebugNodeRef::get(cast_or_null<DebugNode>(Decl.get())), Line, Name,
DebugNodeRef::get(cast_or_null<DebugNode>(Decl)), Line, Name,
AllImportedModules);
}
@ -318,7 +318,7 @@ DIDerivedType DIBuilder::createStaticMemberType(DIDescriptor Scope,
unsigned Flags,
llvm::Constant *Val) {
// TAG_member is encoded in DIDerivedType format.
Flags |= DIDescriptor::FlagStaticMember;
Flags |= DebugNode::FlagStaticMember;
return MDDerivedType::get(
VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
MDScopeRef::get(DIScope(getNonCompileUnitScope(Scope))),
@ -529,8 +529,8 @@ DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,
DICompositeType RetTy = MDCompositeType::get(
VMContext, Tag, Name, F, Line,
MDScopeRef::get(DIScope(getNonCompileUnitScope(Scope))), nullptr,
SizeInBits, AlignInBits, 0, DIDescriptor::FlagFwdDecl, nullptr,
RuntimeLang, nullptr, nullptr, UniqueIdentifier);
SizeInBits, AlignInBits, 0, DebugNode::FlagFwdDecl, nullptr, RuntimeLang,
nullptr, nullptr, UniqueIdentifier);
if (!UniqueIdentifier.empty())
retainType(RetTy);
trackIfUnresolved(RetTy);