}
DwarfUnit::DwarfUnit(unsigned UID, dwarf::Tag UnitTag,
- const MDCompileUnit *Node, AsmPrinter *A, DwarfDebug *DW,
+ const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW,
DwarfFile *DWU)
: UniqueID(UID), CUNode(Node), UnitDie(UnitTag), DebugInfoOffset(0), Asm(A),
DD(DW), DU(DWU), IndexTyDie(nullptr), Section(nullptr) {
}
/// Check whether the DIE for this MDNode can be shared across CUs.
-static bool isShareableAcrossCUs(const DebugNode *D) {
+static bool isShareableAcrossCUs(const DINode *D) {
// When the MDNode can be part of the type system, the DIE can be shared
// across CUs.
// Combining type units and cross-CU DIE sharing is lower value (since
// level already) but may be implementable for some value in projects
// building multiple independent libraries with LTO and then linking those
// together.
- return (isa<MDType>(D) ||
- (isa<MDSubprogram>(D) && !cast<MDSubprogram>(D)->isDefinition())) &&
+ return (isa<DIType>(D) ||
+ (isa<DISubprogram>(D) && !cast<DISubprogram>(D)->isDefinition())) &&
!GenerateDwarfTypeUnits;
}
-DIE *DwarfUnit::getDIE(const DebugNode *D) const {
+DIE *DwarfUnit::getDIE(const DINode *D) const {
if (isShareableAcrossCUs(D))
return DU->getDIE(D);
return MDNodeToDieMap.lookup(D);
}
-void DwarfUnit::insertDIE(const DebugNode *Desc, DIE *D) {
+void DwarfUnit::insertDIE(const DINode *Desc, DIE *D) {
if (isShareableAcrossCUs(Desc)) {
DU->insertDIE(Desc, D);
return;
Entry);
}
-DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DebugNode *N) {
+DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N) {
assert(Tag != dwarf::DW_TAG_auto_variable &&
Tag != dwarf::DW_TAG_arg_variable);
Parent.addChild(make_unique<DIE>((dwarf::Tag)Tag));
addUInt(Die, dwarf::DW_AT_decl_line, None, Line);
}
-void DwarfUnit::addSourceLine(DIE &Die, const MDLocalVariable *V) {
+void DwarfUnit::addSourceLine(DIE &Die, const DILocalVariable *V) {
assert(V);
addSourceLine(Die, V->getLine(), V->getScope()->getFilename(),
V->getScope()->getDirectory());
}
-void DwarfUnit::addSourceLine(DIE &Die, const MDGlobalVariable *G) {
+void DwarfUnit::addSourceLine(DIE &Die, const DIGlobalVariable *G) {
assert(G);
addSourceLine(Die, G->getLine(), G->getFilename(), G->getDirectory());
}
-void DwarfUnit::addSourceLine(DIE &Die, const MDSubprogram *SP) {
+void DwarfUnit::addSourceLine(DIE &Die, const DISubprogram *SP) {
assert(SP);
addSourceLine(Die, SP->getLine(), SP->getFilename(), SP->getDirectory());
}
-void DwarfUnit::addSourceLine(DIE &Die, const MDType *Ty) {
+void DwarfUnit::addSourceLine(DIE &Die, const DIType *Ty) {
assert(Ty);
addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory());
}
-void DwarfUnit::addSourceLine(DIE &Die, const MDObjCProperty *Ty) {
+void DwarfUnit::addSourceLine(DIE &Die, const DIObjCProperty *Ty) {
assert(Ty);
addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory());
}
-void DwarfUnit::addSourceLine(DIE &Die, const MDNamespace *NS) {
+void DwarfUnit::addSourceLine(DIE &Die, const DINamespace *NS) {
addSourceLine(Die, NS->getLine(), NS->getFilename(), NS->getDirectory());
}
void DwarfUnit::addBlockByrefAddress(const DbgVariable &DV, DIE &Die,
dwarf::Attribute Attribute,
const MachineLocation &Location) {
- const MDType *Ty = DV.getType();
- const MDType *TmpTy = Ty;
+ const DIType *Ty = DV.getType();
+ const DIType *TmpTy = Ty;
uint16_t Tag = Ty->getTag();
bool isPointer = false;
StringRef varName = DV.getName();
if (Tag == dwarf::DW_TAG_pointer_type) {
- auto *DTy = cast<MDDerivedType>(Ty);
+ auto *DTy = cast<DIDerivedType>(Ty);
TmpTy = resolve(DTy->getBaseType());
isPointer = true;
}
// Find the __forwarding field and the variable field in the __Block_byref
// struct.
- DebugNodeArray Fields = cast<MDCompositeTypeBase>(TmpTy)->getElements();
- const MDDerivedType *varField = nullptr;
- const MDDerivedType *forwardingField = nullptr;
+ DINodeArray Fields = cast<DICompositeTypeBase>(TmpTy)->getElements();
+ const DIDerivedType *varField = nullptr;
+ const DIDerivedType *forwardingField = nullptr;
for (unsigned i = 0, N = Fields.size(); i < N; ++i) {
- auto *DT = cast<MDDerivedType>(Fields[i]);
+ auto *DT = cast<DIDerivedType>(Fields[i]);
StringRef fieldName = DT->getName();
if (fieldName == "__forwarding")
forwardingField = DT;
}
/// Return true if type encoding is unsigned.
-static bool isUnsignedDIType(DwarfDebug *DD, const MDType *Ty) {
- if (auto *DTy = dyn_cast<MDDerivedTypeBase>(Ty)) {
+static bool isUnsignedDIType(DwarfDebug *DD, const DIType *Ty) {
+ if (auto *DTy = dyn_cast<DIDerivedTypeBase>(Ty)) {
dwarf::Tag T = (dwarf::Tag)Ty->getTag();
// Encode pointer constants as unsigned bytes. This is used at least for
// null pointer constant emission.
T == dwarf::DW_TAG_volatile_type ||
T == dwarf::DW_TAG_restrict_type ||
T == dwarf::DW_TAG_enumeration_type);
- if (MDTypeRef Deriv = DTy->getBaseType())
+ if (DITypeRef 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 false;
}
- auto *BTy = cast<MDBasicType>(Ty);
+ auto *BTy = cast<DIBasicType>(Ty);
unsigned Encoding = BTy->getEncoding();
assert((Encoding == dwarf::DW_ATE_unsigned ||
Encoding == dwarf::DW_ATE_unsigned_char ||
}
/// If this type is derived from a base type then return base type size.
-static uint64_t getBaseTypeSize(DwarfDebug *DD, const MDDerivedType *Ty) {
+static uint64_t getBaseTypeSize(DwarfDebug *DD, const DIDerivedType *Ty) {
unsigned Tag = Ty->getTag();
if (Tag != dwarf::DW_TAG_member && Tag != dwarf::DW_TAG_typedef &&
BaseType->getTag() == dwarf::DW_TAG_rvalue_reference_type)
return Ty->getSizeInBits();
- if (auto *DT = dyn_cast<MDDerivedType>(BaseType))
+ if (auto *DT = dyn_cast<DIDerivedType>(BaseType))
return getBaseTypeSize(DD, DT);
return BaseType->getSizeInBits();
}
void DwarfUnit::addConstantValue(DIE &Die, const ConstantInt *CI,
- const MDType *Ty) {
+ const DIType *Ty) {
addConstantValue(Die, CI->getValue(), Ty);
}
void DwarfUnit::addConstantValue(DIE &Die, const MachineOperand &MO,
- const MDType *Ty) {
+ const DIType *Ty) {
assert(MO.isImm() && "Invalid machine operand!");
addConstantValue(Die, isUnsignedDIType(DD, Ty), MO.getImm());
Unsigned ? dwarf::DW_FORM_udata : dwarf::DW_FORM_sdata, Val);
}
-void DwarfUnit::addConstantValue(DIE &Die, const APInt &Val, const MDType *Ty) {
+void DwarfUnit::addConstantValue(DIE &Die, const APInt &Val, const DIType *Ty) {
addConstantValue(Die, Val, isUnsignedDIType(DD, Ty));
}
GlobalValue::getRealLinkageName(LinkageName));
}
-void DwarfUnit::addTemplateParams(DIE &Buffer, DebugNodeArray TParams) {
+void DwarfUnit::addTemplateParams(DIE &Buffer, DINodeArray TParams) {
// Add template parameters.
for (const auto *Element : TParams) {
- if (auto *TTP = dyn_cast<MDTemplateTypeParameter>(Element))
+ if (auto *TTP = dyn_cast<DITemplateTypeParameter>(Element))
constructTemplateTypeParameterDIE(Buffer, TTP);
- else if (auto *TVP = dyn_cast<MDTemplateValueParameter>(Element))
+ else if (auto *TVP = dyn_cast<DITemplateValueParameter>(Element))
constructTemplateValueParameterDIE(Buffer, TVP);
}
}
-DIE *DwarfUnit::getOrCreateContextDIE(const MDScope *Context) {
- if (!Context || isa<MDFile>(Context))
+DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) {
+ if (!Context || isa<DIFile>(Context))
return &getUnitDie();
- if (auto *T = dyn_cast<MDType>(Context))
+ if (auto *T = dyn_cast<DIType>(Context))
return getOrCreateTypeDIE(T);
- if (auto *NS = dyn_cast<MDNamespace>(Context))
+ if (auto *NS = dyn_cast<DINamespace>(Context))
return getOrCreateNameSpace(NS);
- if (auto *SP = dyn_cast<MDSubprogram>(Context))
+ if (auto *SP = dyn_cast<DISubprogram>(Context))
return getOrCreateSubprogramDIE(SP);
return getDIE(Context);
}
-DIE *DwarfUnit::createTypeDIE(const MDCompositeType *Ty) {
+DIE *DwarfUnit::createTypeDIE(const DICompositeType *Ty) {
auto *Context = resolve(Ty->getScope());
DIE *ContextDIE = getOrCreateContextDIE(Context);
// Create new type.
DIE &TyDIE = createAndAddDIE(Ty->getTag(), *ContextDIE, Ty);
- constructTypeDIE(TyDIE, cast<MDCompositeType>(Ty));
+ constructTypeDIE(TyDIE, cast<DICompositeType>(Ty));
updateAcceleratorTables(Context, Ty, TyDIE);
return &TyDIE;
if (!TyNode)
return nullptr;
- auto *Ty = cast<MDType>(TyNode);
+ auto *Ty = cast<DIType>(TyNode);
assert(Ty == resolve(Ty->getRef()) &&
"type was not uniqued, possible ODR violation.");
// DW_TAG_restrict_type is not supported in DWARF2
if (Ty->getTag() == dwarf::DW_TAG_restrict_type && DD->getDwarfVersion() <= 2)
- return getOrCreateTypeDIE(
- resolve(cast<MDDerivedType>(Ty)->getBaseType()));
+ return getOrCreateTypeDIE(resolve(cast<DIDerivedType>(Ty)->getBaseType()));
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
updateAcceleratorTables(Context, Ty, TyDIE);
- if (auto *BT = dyn_cast<MDBasicType>(Ty))
+ if (auto *BT = dyn_cast<DIBasicType>(Ty))
constructTypeDIE(TyDIE, BT);
- else if (auto *STy = dyn_cast<MDSubroutineType>(Ty))
+ else if (auto *STy = dyn_cast<DISubroutineType>(Ty))
constructTypeDIE(TyDIE, STy);
- else if (auto *CTy = dyn_cast<MDCompositeType>(Ty)) {
+ else if (auto *CTy = dyn_cast<DICompositeType>(Ty)) {
if (GenerateDwarfTypeUnits && !Ty->isForwardDecl())
if (MDString *TypeId = CTy->getRawIdentifier()) {
DD->addDwarfTypeUnitType(getCU(), TypeId->getString(), TyDIE, CTy);
}
constructTypeDIE(TyDIE, CTy);
} else {
- constructTypeDIE(TyDIE, cast<MDDerivedType>(Ty));
+ constructTypeDIE(TyDIE, cast<DIDerivedType>(Ty));
}
return &TyDIE;
}
-void DwarfUnit::updateAcceleratorTables(const MDScope *Context,
- const MDType *Ty, const DIE &TyDIE) {
+void DwarfUnit::updateAcceleratorTables(const DIScope *Context,
+ const DIType *Ty, const DIE &TyDIE) {
if (!Ty->getName().empty() && !Ty->isForwardDecl()) {
bool IsImplementation = 0;
- if (auto *CT = dyn_cast<MDCompositeTypeBase>(Ty)) {
+ if (auto *CT = dyn_cast<DICompositeTypeBase>(Ty)) {
// A runtime language of 0 actually means C/C++ and that any
// non-negative value is some version of Objective-C/C++.
IsImplementation = CT->getRuntimeLang() == 0 || CT->isObjcClassComplete();
unsigned Flags = IsImplementation ? dwarf::DW_FLAG_type_implementation : 0;
DD->addAccelType(Ty->getName(), TyDIE, Flags);
- if (!Context || isa<MDCompileUnit>(Context) || isa<MDFile>(Context) ||
- isa<MDNamespace>(Context))
+ if (!Context || isa<DICompileUnit>(Context) || isa<DIFile>(Context) ||
+ isa<DINamespace>(Context))
addGlobalType(Ty, TyDIE, Context);
}
}
-void DwarfUnit::addType(DIE &Entity, const MDType *Ty,
+void DwarfUnit::addType(DIE &Entity, const DIType *Ty,
dwarf::Attribute Attribute) {
assert(Ty && "Trying to add a type that doesn't exist?");
addDIEEntry(Entity, Attribute, Entry);
}
-std::string DwarfUnit::getParentContextString(const MDScope *Context) const {
+std::string DwarfUnit::getParentContextString(const DIScope *Context) const {
if (!Context)
return "";
return "";
std::string CS;
- SmallVector<const MDScope *, 1> Parents;
- while (!isa<MDCompileUnit>(Context)) {
+ SmallVector<const DIScope *, 1> Parents;
+ while (!isa<DICompileUnit>(Context)) {
Parents.push_back(Context);
if (Context->getScope())
Context = resolve(Context->getScope());
// Reverse iterate over our list to go from the outermost construct to the
// innermost.
for (auto I = Parents.rbegin(), E = Parents.rend(); I != E; ++I) {
- const MDScope *Ctx = *I;
+ const DIScope *Ctx = *I;
StringRef Name = Ctx->getName();
- if (Name.empty() && isa<MDNamespace>(Ctx))
+ if (Name.empty() && isa<DINamespace>(Ctx))
Name = "(anonymous namespace)";
if (!Name.empty()) {
CS += Name;
return CS;
}
-void DwarfUnit::constructTypeDIE(DIE &Buffer, const MDBasicType *BTy) {
+void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIBasicType *BTy) {
// Get core information.
StringRef Name = BTy->getName();
// Add name if not anonymous or intermediate type.
addUInt(Buffer, dwarf::DW_AT_byte_size, None, Size);
}
-void DwarfUnit::constructTypeDIE(DIE &Buffer, const MDDerivedType *DTy) {
+void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
// Get core information.
StringRef Name = DTy->getName();
uint64_t Size = DTy->getSizeInBits() >> 3;
uint16_t Tag = Buffer.getTag();
// Map to main type, void will not have a type.
- const MDType *FromTy = resolve(DTy->getBaseType());
+ const DIType *FromTy = resolve(DTy->getBaseType());
if (FromTy)
addType(Buffer, FromTy);
if (Tag == dwarf::DW_TAG_ptr_to_member_type)
addDIEEntry(
Buffer, dwarf::DW_AT_containing_type,
- *getOrCreateTypeDIE(resolve(cast<MDDerivedType>(DTy)->getClassType())));
+ *getOrCreateTypeDIE(resolve(cast<DIDerivedType>(DTy)->getClassType())));
// Add source line info if available and TyDesc is not a forward declaration.
if (!DTy->isForwardDecl())
addSourceLine(Buffer, DTy);
}
-void DwarfUnit::constructSubprogramArguments(DIE &Buffer, MDTypeRefArray Args) {
+void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args) {
for (unsigned i = 1, N = Args.size(); i < N; ++i) {
- const MDType *Ty = resolve(Args[i]);
+ const DIType *Ty = resolve(Args[i]);
if (!Ty) {
assert(i == N-1 && "Unspecified parameter must be the last argument");
createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer);
}
}
-void DwarfUnit::constructTypeDIE(DIE &Buffer, const MDSubroutineType *CTy) {
+void DwarfUnit::constructTypeDIE(DIE &Buffer, const DISubroutineType *CTy) {
// Add return type. A void return won't have a type.
- auto Elements = cast<MDSubroutineType>(CTy)->getTypeArray();
+ auto Elements = cast<DISubroutineType>(CTy)->getTypeArray();
if (Elements.size())
if (auto RTy = resolve(Elements[0]))
addType(Buffer, RTy);
addFlag(Buffer, dwarf::DW_AT_rvalue_reference);
}
-void DwarfUnit::constructTypeDIE(DIE &Buffer, const MDCompositeType *CTy) {
+void DwarfUnit::constructTypeDIE(DIE &Buffer, const DICompositeType *CTy) {
// Add name if not anonymous or intermediate type.
StringRef Name = CTy->getName();
case dwarf::DW_TAG_union_type:
case dwarf::DW_TAG_class_type: {
// Add elements to structure type.
- DebugNodeArray Elements = CTy->getElements();
+ DINodeArray Elements = CTy->getElements();
for (const auto *Element : Elements) {
if (!Element)
continue;
- if (auto *SP = dyn_cast<MDSubprogram>(Element))
+ if (auto *SP = dyn_cast<DISubprogram>(Element))
getOrCreateSubprogramDIE(SP);
- else if (auto *DDTy = dyn_cast<MDDerivedType>(Element)) {
+ else if (auto *DDTy = dyn_cast<DIDerivedType>(Element)) {
if (DDTy->getTag() == dwarf::DW_TAG_friend) {
DIE &ElemDie = createAndAddDIE(dwarf::DW_TAG_friend, Buffer);
addType(ElemDie, resolve(DDTy->getBaseType()), dwarf::DW_AT_friend);
} else {
constructMemberDIE(Buffer, DDTy);
}
- } else if (auto *Property = dyn_cast<MDObjCProperty>(Element)) {
+ } else if (auto *Property = dyn_cast<DIObjCProperty>(Element)) {
DIE &ElemDie = createAndAddDIE(Property->getTag(), Buffer);
StringRef PropertyName = Property->getName();
addString(ElemDie, dwarf::DW_AT_APPLE_property_name, PropertyName);
// This is outside the DWARF spec, but GDB expects a DW_AT_containing_type
// inside C++ composite types to point to the base class with the vtable.
if (auto *ContainingType =
- dyn_cast_or_null<MDCompositeType>(resolve(CTy->getVTableHolder())))
+ dyn_cast_or_null<DICompositeType>(resolve(CTy->getVTableHolder())))
addDIEEntry(Buffer, dwarf::DW_AT_containing_type,
*getOrCreateTypeDIE(ContainingType));
}
void DwarfUnit::constructTemplateTypeParameterDIE(
- DIE &Buffer, const MDTemplateTypeParameter *TP) {
+ DIE &Buffer, const DITemplateTypeParameter *TP) {
DIE &ParamDIE =
createAndAddDIE(dwarf::DW_TAG_template_type_parameter, Buffer);
// Add the type if it exists, it could be void and therefore no type.
}
void DwarfUnit::constructTemplateValueParameterDIE(
- DIE &Buffer, const MDTemplateValueParameter *VP) {
+ DIE &Buffer, const DITemplateValueParameter *VP) {
DIE &ParamDIE = createAndAddDIE(VP->getTag(), Buffer);
// Add the type if there is one, template template and template parameter
}
}
-DIE *DwarfUnit::getOrCreateNameSpace(const MDNamespace *NS) {
+DIE *DwarfUnit::getOrCreateNameSpace(const DINamespace *NS) {
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(NS->getScope());
return &NDie;
}
-DIE *DwarfUnit::getOrCreateSubprogramDIE(const MDSubprogram *SP, bool Minimal) {
+DIE *DwarfUnit::getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal) {
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE (as is the case for member function
// declarations).
return &SPDie;
}
-bool DwarfUnit::applySubprogramDefinitionAttributes(const MDSubprogram *SP,
+bool DwarfUnit::applySubprogramDefinitionAttributes(const DISubprogram *SP,
DIE &SPDie) {
DIE *DeclDie = nullptr;
StringRef DeclLinkageName;
return true;
}
-void DwarfUnit::applySubprogramAttributes(const MDSubprogram *SP, DIE &SPDie,
+void DwarfUnit::applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie,
bool Minimal) {
if (!Minimal)
if (applySubprogramDefinitionAttributes(SP, SPDie))
Language == dwarf::DW_LANG_ObjC))
addFlag(SPDie, dwarf::DW_AT_prototyped);
- const MDSubroutineType *SPTy = SP->getType();
+ const DISubroutineType *SPTy = SP->getType();
assert(SPTy->getTag() == dwarf::DW_TAG_subroutine_type &&
"the type of a subprogram should be a subroutine");
addFlag(SPDie, dwarf::DW_AT_explicit);
}
-void DwarfUnit::constructSubrangeDIE(DIE &Buffer, const MDSubrange *SR,
+void DwarfUnit::constructSubrangeDIE(DIE &Buffer, const DISubrange *SR,
DIE *IndexTy) {
DIE &DW_Subrange = createAndAddDIE(dwarf::DW_TAG_subrange_type, Buffer);
addDIEEntry(DW_Subrange, dwarf::DW_AT_type, *IndexTy);
return IndexTyDie;
}
-void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, const MDCompositeType *CTy) {
+void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy) {
if (CTy->isVector())
addFlag(Buffer, dwarf::DW_AT_GNU_vector);
DIE *IdxTy = getIndexTyDie();
// Add subranges to array type.
- DebugNodeArray Elements = CTy->getElements();
+ DINodeArray Elements = CTy->getElements();
for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
// FIXME: Should this really be such a loose cast?
- if (auto *Element = dyn_cast_or_null<DebugNode>(Elements[i]))
+ if (auto *Element = dyn_cast_or_null<DINode>(Elements[i]))
if (Element->getTag() == dwarf::DW_TAG_subrange_type)
- constructSubrangeDIE(Buffer, cast<MDSubrange>(Element), IdxTy);
+ constructSubrangeDIE(Buffer, cast<DISubrange>(Element), IdxTy);
}
}
-void DwarfUnit::constructEnumTypeDIE(DIE &Buffer, const MDCompositeType *CTy) {
- DebugNodeArray Elements = CTy->getElements();
+void DwarfUnit::constructEnumTypeDIE(DIE &Buffer, const DICompositeType *CTy) {
+ DINodeArray Elements = CTy->getElements();
// Add enumerators to enumeration type.
for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
- auto *Enum = dyn_cast_or_null<MDEnumerator>(Elements[i]);
+ auto *Enum = dyn_cast_or_null<DIEnumerator>(Elements[i]);
if (Enum) {
DIE &Enumerator = createAndAddDIE(dwarf::DW_TAG_enumerator, Buffer);
StringRef Name = Enum->getName();
Value);
}
}
- const MDType *DTy = resolve(CTy->getBaseType());
+ const DIType *DTy = resolve(CTy->getBaseType());
if (DTy) {
addType(Buffer, DTy);
addFlag(Buffer, dwarf::DW_AT_enum_class);
for (auto CI = ContainingTypeMap.begin(), CE = ContainingTypeMap.end();
CI != CE; ++CI) {
DIE &SPDie = *CI->first;
- const DebugNode *D = CI->second;
+ const DINode *D = CI->second;
if (!D)
continue;
DIE *NDie = getDIE(D);
}
}
-void DwarfUnit::constructMemberDIE(DIE &Buffer, const MDDerivedType *DT) {
+void DwarfUnit::constructMemberDIE(DIE &Buffer, const DIDerivedType *DT) {
DIE &MemberDie = createAndAddDIE(DT->getTag(), Buffer);
StringRef Name = DT->getName();
if (!Name.empty())
addFlag(MemberDie, dwarf::DW_AT_artificial);
}
-DIE *DwarfUnit::getOrCreateStaticMemberDIE(const MDDerivedType *DT) {
+DIE *DwarfUnit::getOrCreateStaticMemberDIE(const DIDerivedType *DT) {
if (!DT)
return nullptr;
DIE &StaticMemberDIE = createAndAddDIE(DT->getTag(), *ContextDIE, DT);
- const MDType *Ty = resolve(DT->getBaseType());
+ const DIType *Ty = resolve(DT->getBaseType());
addString(StaticMemberDIE, dwarf::DW_AT_name, DT->getName());
addType(StaticMemberDIE, Ty);