mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
DIEEntry: Refer to the specified DIE via reference rather than pointer.
Makes some more cases (the unit tests, specifically), lexically compatible with a change to unique_ptr. llvm-svn: 207261
This commit is contained in:
parent
e5d83756ee
commit
e3e1144d71
@ -376,12 +376,12 @@ void DIEEntry::EmitValue(AsmPrinter *AP, dwarf::Form Form) const {
|
||||
|
||||
if (Form == dwarf::DW_FORM_ref_addr) {
|
||||
const DwarfDebug *DD = AP->getDwarfDebug();
|
||||
unsigned Addr = Entry->getOffset();
|
||||
unsigned Addr = Entry.getOffset();
|
||||
assert(!DD->useSplitDwarf() && "TODO: dwo files can't have relocations.");
|
||||
// For DW_FORM_ref_addr, output the offset from beginning of debug info
|
||||
// section. Entry->getOffset() returns the offset from start of the
|
||||
// compile unit.
|
||||
DwarfCompileUnit *CU = DD->lookupUnit(Entry->getUnit());
|
||||
DwarfCompileUnit *CU = DD->lookupUnit(Entry.getUnit());
|
||||
assert(CU && "CUDie should belong to a CU.");
|
||||
Addr += CU->getDebugInfoOffset();
|
||||
if (AP->MAI->doesDwarfUseRelocationsAcrossSections())
|
||||
@ -392,7 +392,7 @@ void DIEEntry::EmitValue(AsmPrinter *AP, dwarf::Form Form) const {
|
||||
CU->getSectionSym(),
|
||||
DIEEntry::getRefAddrSize(AP));
|
||||
} else
|
||||
AP->EmitInt32(Entry->getOffset());
|
||||
AP->EmitInt32(Entry.getOffset());
|
||||
}
|
||||
|
||||
unsigned DIEEntry::getRefAddrSize(AsmPrinter *AP) {
|
||||
@ -409,7 +409,7 @@ unsigned DIEEntry::getRefAddrSize(AsmPrinter *AP) {
|
||||
|
||||
#ifndef NDEBUG
|
||||
void DIEEntry::print(raw_ostream &O) const {
|
||||
O << format("Die: 0x%lx", (long)(intptr_t)Entry);
|
||||
O << format("Die: 0x%lx", (long)(intptr_t)&Entry);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -405,14 +405,13 @@ public:
|
||||
/// this class can also be used as a proxy for a debug information entry not
|
||||
/// yet defined (ie. types.)
|
||||
class DIEEntry : public DIEValue {
|
||||
DIE *const Entry;
|
||||
DIE &Entry;
|
||||
|
||||
public:
|
||||
explicit DIEEntry(DIE *E) : DIEValue(isEntry), Entry(E) {
|
||||
assert(E && "Cannot construct a DIEEntry with a null DIE");
|
||||
explicit DIEEntry(DIE &E) : DIEValue(isEntry), Entry(E) {
|
||||
}
|
||||
|
||||
DIE *getEntry() const { return Entry; }
|
||||
DIE &getEntry() const { return Entry; }
|
||||
|
||||
/// EmitValue - Emit debug information entry offset.
|
||||
///
|
||||
|
@ -309,7 +309,7 @@ void DIEHash::hashAttribute(AttrEntry Attr, dwarf::Tag Tag) {
|
||||
// ... An attribute that refers to another type entry T is processed as
|
||||
// follows:
|
||||
case DIEValue::isEntry:
|
||||
hashDIEEntry(Attribute, Tag, *cast<DIEEntry>(Value)->getEntry());
|
||||
hashDIEEntry(Attribute, Tag, cast<DIEEntry>(Value)->getEntry());
|
||||
break;
|
||||
case DIEValue::isInteger: {
|
||||
addULEB128('A');
|
||||
|
@ -323,7 +323,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
|
||||
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) {
|
||||
// Pick up abstract subprogram DIE.
|
||||
SPDie = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
|
||||
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
|
||||
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, *AbsSPDIE);
|
||||
} else {
|
||||
DISubprogram SPDecl = SP.getFunctionDeclaration();
|
||||
if (!SPDecl.isSubprogram()) {
|
||||
@ -346,7 +346,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
|
||||
DIE *SPDeclDie = SPDie;
|
||||
SPDie =
|
||||
&SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
|
||||
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, SPDeclDie);
|
||||
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, *SPDeclDie);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -471,7 +471,7 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DwarfCompileUnit &TheCU,
|
||||
}
|
||||
|
||||
DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
|
||||
TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, OriginDIE);
|
||||
TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE);
|
||||
|
||||
// If we have multiple ranges, emit them into the range section.
|
||||
if (ScopeRanges.size() > 1)
|
||||
@ -614,7 +614,7 @@ DIE *DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU,
|
||||
ScopeDIE->addChild(I);
|
||||
|
||||
if (DS.isSubprogram() && ObjectPointer != nullptr)
|
||||
TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_object_pointer, ObjectPointer);
|
||||
TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer);
|
||||
|
||||
return ScopeDIE;
|
||||
}
|
||||
@ -748,7 +748,7 @@ void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU,
|
||||
TheCU.addSourceLine(IMDie, Module.getLineNumber(),
|
||||
Module.getContext().getFilename(),
|
||||
Module.getContext().getDirectory());
|
||||
TheCU.addDIEEntry(IMDie, dwarf::DW_AT_import, EntityDie);
|
||||
TheCU.addDIEEntry(IMDie, dwarf::DW_AT_import, *EntityDie);
|
||||
StringRef Name = Module.getName();
|
||||
if (!Name.empty())
|
||||
TheCU.addString(IMDie, dwarf::DW_AT_name, Name);
|
||||
@ -1939,8 +1939,8 @@ static dwarf::PubIndexEntryDescriptor computeIndexValue(DwarfUnit *CU,
|
||||
// look for that now.
|
||||
DIEValue *SpecVal = Die->findAttribute(dwarf::DW_AT_specification);
|
||||
if (SpecVal) {
|
||||
DIE *SpecDIE = cast<DIEEntry>(SpecVal)->getEntry();
|
||||
if (SpecDIE->findAttribute(dwarf::DW_AT_external))
|
||||
DIE &SpecDIE = cast<DIEEntry>(SpecVal)->getEntry();
|
||||
if (SpecDIE.findAttribute(dwarf::DW_AT_external))
|
||||
Linkage = dwarf::GIEL_EXTERNAL;
|
||||
} else if (Die->findAttribute(dwarf::DW_AT_external))
|
||||
Linkage = dwarf::GIEL_EXTERNAL;
|
||||
|
@ -75,7 +75,7 @@ DwarfUnit::~DwarfUnit() {
|
||||
|
||||
/// createDIEEntry - Creates a new DIEEntry to be a proxy for a debug
|
||||
/// information entry.
|
||||
DIEEntry *DwarfUnit::createDIEEntry(DIE *Entry) {
|
||||
DIEEntry *DwarfUnit::createDIEEntry(DIE &Entry) {
|
||||
DIEEntry *Value = new (DIEValueAllocator) DIEEntry(Entry);
|
||||
return Value;
|
||||
}
|
||||
@ -355,7 +355,7 @@ void DwarfUnit::addLabelDelta(DIE &Die, dwarf::Attribute Attribute,
|
||||
|
||||
/// addDIEEntry - Add a DIE attribute data and value.
|
||||
///
|
||||
void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE *Entry) {
|
||||
void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry) {
|
||||
addDIEEntry(Die, Attribute, createDIEEntry(Entry));
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ void DwarfUnit::addDIETypeSignature(DIE &Die, const DwarfTypeUnit &Type) {
|
||||
void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute,
|
||||
DIEEntry *Entry) {
|
||||
const DIE *DieCU = Die.getUnitOrNull();
|
||||
const DIE *EntryCU = Entry->getEntry()->getUnitOrNull();
|
||||
const DIE *EntryCU = Entry->getEntry().getUnitOrNull();
|
||||
if (!DieCU)
|
||||
// We assume that Die belongs to this CU, if it is not linked to any CU yet.
|
||||
DieCU = &getUnitDie();
|
||||
@ -1055,7 +1055,7 @@ void DwarfUnit::addType(DIE &Entity, DIType Ty, dwarf::Attribute Attribute) {
|
||||
DIE *Buffer = getOrCreateTypeDIE(Ty);
|
||||
|
||||
// Set up proxy.
|
||||
Entry = createDIEEntry(Buffer);
|
||||
Entry = createDIEEntry(*Buffer);
|
||||
insertDIEEntry(Ty, Entry);
|
||||
addDIEEntry(Entity, Attribute, Entry);
|
||||
}
|
||||
@ -1149,7 +1149,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) {
|
||||
|
||||
if (Tag == dwarf::DW_TAG_ptr_to_member_type)
|
||||
addDIEEntry(Buffer, dwarf::DW_AT_containing_type,
|
||||
getOrCreateTypeDIE(resolve(DTy.getClassType())));
|
||||
*getOrCreateTypeDIE(resolve(DTy.getClassType())));
|
||||
// Add source line info if available and TyDesc is not a forward declaration.
|
||||
if (!DTy.isForwardDecl())
|
||||
addSourceLine(Buffer, DTy);
|
||||
@ -1267,7 +1267,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
||||
|
||||
DIEEntry *Entry = getDIEEntry(Element);
|
||||
if (!Entry) {
|
||||
Entry = createDIEEntry(&ElemDie);
|
||||
Entry = createDIEEntry(ElemDie);
|
||||
insertDIEEntry(Element, Entry);
|
||||
}
|
||||
} else
|
||||
@ -1280,7 +1280,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
||||
DICompositeType ContainingType(resolve(CTy.getContainingType()));
|
||||
if (ContainingType)
|
||||
addDIEEntry(Buffer, dwarf::DW_AT_containing_type,
|
||||
getOrCreateTypeDIE(ContainingType));
|
||||
*getOrCreateTypeDIE(ContainingType));
|
||||
|
||||
if (CTy.isObjcClassComplete())
|
||||
addFlag(Buffer, dwarf::DW_AT_APPLE_objc_complete_type);
|
||||
@ -1431,7 +1431,7 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
|
||||
|
||||
if (DeclDie)
|
||||
// Refer function declaration directly.
|
||||
addDIEEntry(SPDie, dwarf::DW_AT_specification, DeclDie);
|
||||
addDIEEntry(SPDie, dwarf::DW_AT_specification, *DeclDie);
|
||||
|
||||
// Add the linkage name if we have one and it isn't in the Decl.
|
||||
StringRef LinkageName = SP.getLinkageName();
|
||||
@ -1638,7 +1638,7 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
|
||||
!GVContext.isFile() && !DD->isSubprogramContext(GVContext)) {
|
||||
// Create specification DIE.
|
||||
VariableSpecDIE = &createAndAddDIE(dwarf::DW_TAG_variable, *UnitDie);
|
||||
addDIEEntry(*VariableSpecDIE, dwarf::DW_AT_specification, VariableDIE);
|
||||
addDIEEntry(*VariableSpecDIE, dwarf::DW_AT_specification, *VariableDIE);
|
||||
addBlock(*VariableSpecDIE, dwarf::DW_AT_location, Loc);
|
||||
// A static member's declaration is already flagged as such.
|
||||
if (!SDMDecl.Verify())
|
||||
@ -1699,7 +1699,7 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
|
||||
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.
|
||||
void DwarfUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy) {
|
||||
DIE &DW_Subrange = createAndAddDIE(dwarf::DW_TAG_subrange_type, Buffer);
|
||||
addDIEEntry(DW_Subrange, dwarf::DW_AT_type, IndexTy);
|
||||
addDIEEntry(DW_Subrange, dwarf::DW_AT_type, *IndexTy);
|
||||
|
||||
// The LowerBound value defines the lower bounds which is typically zero for
|
||||
// C/C++. The Count value is the number of elements. Values are 64 bit. If
|
||||
@ -1788,7 +1788,7 @@ void DwarfUnit::constructContainingTypeDIEs() {
|
||||
DIE *NDie = getDIE(D);
|
||||
if (!NDie)
|
||||
continue;
|
||||
addDIEEntry(SPDie, dwarf::DW_AT_containing_type, NDie);
|
||||
addDIEEntry(SPDie, dwarf::DW_AT_containing_type, *NDie);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1808,7 +1808,7 @@ DIE *DwarfUnit::constructVariableDIEImpl(const DbgVariable &DV,
|
||||
DbgVariable *AbsVar = DV.getAbstractVariable();
|
||||
DIE *AbsDIE = AbsVar ? AbsVar->getDIE() : nullptr;
|
||||
if (AbsDIE)
|
||||
addDIEEntry(*VariableDie, dwarf::DW_AT_abstract_origin, AbsDIE);
|
||||
addDIEEntry(*VariableDie, dwarf::DW_AT_abstract_origin, *AbsDIE);
|
||||
else {
|
||||
if (!Name.empty())
|
||||
addString(*VariableDie, dwarf::DW_AT_name, Name);
|
||||
|
@ -328,7 +328,7 @@ public:
|
||||
const MCSymbol *Lo);
|
||||
|
||||
/// addDIEEntry - Add a DIE attribute data and value.
|
||||
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE *Entry);
|
||||
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry);
|
||||
|
||||
/// addDIEEntry - Add a DIE attribute data and value.
|
||||
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIEEntry *Entry);
|
||||
@ -516,7 +516,7 @@ private:
|
||||
|
||||
/// createDIEEntry - Creates a new DIEEntry to be a proxy for a debug
|
||||
/// information entry.
|
||||
DIEEntry *createDIEEntry(DIE *Entry);
|
||||
DIEEntry *createDIEEntry(DIE &Entry);
|
||||
|
||||
/// resolve - Look in the DwarfDebug map for the MDNode that
|
||||
/// corresponds to the reference.
|
||||
|
@ -103,7 +103,7 @@ TEST(DIEHashTest, TypeWithMember) {
|
||||
DIEInteger Five(5);
|
||||
Int.addValue(dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, &Five);
|
||||
|
||||
DIEEntry IntRef(&Int);
|
||||
DIEEntry IntRef(Int);
|
||||
Member->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &IntRef);
|
||||
|
||||
uint64_t MD5Res = DIEHash().computeTypeSignature(Unnamed);
|
||||
@ -142,7 +142,7 @@ TEST(DIEHashTest, ReusedType) {
|
||||
DIEInteger Five(5);
|
||||
Int.addValue(dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, &Five);
|
||||
|
||||
DIEEntry IntRef(&Int);
|
||||
DIEEntry IntRef(Int);
|
||||
Mem1->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &IntRef);
|
||||
Mem2->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &IntRef);
|
||||
|
||||
@ -162,7 +162,7 @@ TEST(DIEHashTest, RecursiveType) {
|
||||
DIE *Mem = new DIE(dwarf::DW_TAG_member);
|
||||
DIEString MemStr(&One, "mem");
|
||||
Mem->addValue(dwarf::DW_AT_name, dwarf::DW_FORM_strp, &MemStr);
|
||||
DIEEntry FooRef(&Foo);
|
||||
DIEEntry FooRef(Foo);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooRef);
|
||||
// DW_AT_external and DW_AT_declaration are ignored anyway, so skip them.
|
||||
|
||||
@ -189,10 +189,10 @@ TEST(DIEHashTest, Pointer) {
|
||||
|
||||
DIE FooPtr(dwarf::DW_TAG_pointer_type);
|
||||
FooPtr.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Eight);
|
||||
DIEEntry FooRef(&Foo);
|
||||
DIEEntry FooRef(Foo);
|
||||
FooPtr.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooRef);
|
||||
|
||||
DIEEntry FooPtrRef(&FooPtr);
|
||||
DIEEntry FooPtrRef(FooPtr);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooPtrRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -218,14 +218,14 @@ TEST(DIEHashTest, Reference) {
|
||||
|
||||
DIE FooRef(dwarf::DW_TAG_reference_type);
|
||||
FooRef.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Eight);
|
||||
DIEEntry FooEntry(&Foo);
|
||||
DIEEntry FooEntry(Foo);
|
||||
FooRef.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooEntry);
|
||||
|
||||
DIE FooRefConst(dwarf::DW_TAG_const_type);
|
||||
DIEEntry FooRefRef(&FooRef);
|
||||
DIEEntry FooRefRef(FooRef);
|
||||
FooRefConst.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooRefRef);
|
||||
|
||||
DIEEntry FooRefConstRef(&FooRefConst);
|
||||
DIEEntry FooRefConstRef(FooRefConst);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooRefConstRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -251,14 +251,14 @@ TEST(DIEHashTest, RValueReference) {
|
||||
|
||||
DIE FooRef(dwarf::DW_TAG_rvalue_reference_type);
|
||||
FooRef.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Eight);
|
||||
DIEEntry FooEntry(&Foo);
|
||||
DIEEntry FooEntry(Foo);
|
||||
FooRef.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooEntry);
|
||||
|
||||
DIE FooRefConst(dwarf::DW_TAG_const_type);
|
||||
DIEEntry FooRefRef(&FooRef);
|
||||
DIEEntry FooRefRef(FooRef);
|
||||
FooRefConst.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooRefRef);
|
||||
|
||||
DIEEntry FooRefConstRef(&FooRefConst);
|
||||
DIEEntry FooRefConstRef(FooRefConst);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooRefConstRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -283,12 +283,12 @@ TEST(DIEHashTest, PtrToMember) {
|
||||
Mem->addValue(dwarf::DW_AT_data_member_location, dwarf::DW_FORM_data1, &Zero);
|
||||
|
||||
DIE PtrToFooMem(dwarf::DW_TAG_ptr_to_member_type);
|
||||
DIEEntry FooEntry(&Foo);
|
||||
DIEEntry FooEntry(Foo);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FooEntry);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
||||
&FooEntry);
|
||||
|
||||
DIEEntry PtrToFooMemRef(&PtrToFooMem);
|
||||
DIEEntry PtrToFooMemRef(PtrToFooMem);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &PtrToFooMemRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -326,13 +326,13 @@ TEST(DIEHashTest, PtrToMemberDeclDefMatch) {
|
||||
&Zero);
|
||||
|
||||
DIE PtrToFooMem(dwarf::DW_TAG_ptr_to_member_type);
|
||||
DIEEntry BarEntry(&Bar);
|
||||
DIEEntry BarEntry(Bar);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &BarEntry);
|
||||
DIEEntry FooEntry(&Foo);
|
||||
DIEEntry FooEntry(Foo);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
||||
&FooEntry);
|
||||
|
||||
DIEEntry PtrToFooMemRef(&PtrToFooMem);
|
||||
DIEEntry PtrToFooMemRef(PtrToFooMem);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &PtrToFooMemRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -355,13 +355,13 @@ TEST(DIEHashTest, PtrToMemberDeclDefMatch) {
|
||||
&Zero);
|
||||
|
||||
DIE PtrToFooMem(dwarf::DW_TAG_ptr_to_member_type);
|
||||
DIEEntry BarEntry(&Bar);
|
||||
DIEEntry BarEntry(Bar);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &BarEntry);
|
||||
DIEEntry FooEntry(&Foo);
|
||||
DIEEntry FooEntry(Foo);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
||||
&FooEntry);
|
||||
|
||||
DIEEntry PtrToFooMemRef(&PtrToFooMem);
|
||||
DIEEntry PtrToFooMemRef(PtrToFooMem);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &PtrToFooMemRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -399,12 +399,12 @@ TEST(DIEHashTest, PtrToMemberDeclDefMisMatch) {
|
||||
&Zero);
|
||||
|
||||
DIE PtrToFooMem(dwarf::DW_TAG_ptr_to_member_type);
|
||||
DIEEntry BarEntry(&Bar);
|
||||
DIEEntry BarEntry(Bar);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &BarEntry);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
||||
&BarEntry);
|
||||
|
||||
DIEEntry PtrToFooMemRef(&PtrToFooMem);
|
||||
DIEEntry PtrToFooMemRef(PtrToFooMem);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &PtrToFooMemRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -427,12 +427,12 @@ TEST(DIEHashTest, PtrToMemberDeclDefMisMatch) {
|
||||
&Zero);
|
||||
|
||||
DIE PtrToFooMem(dwarf::DW_TAG_ptr_to_member_type);
|
||||
DIEEntry BarEntry(&Bar);
|
||||
DIEEntry BarEntry(Bar);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &BarEntry);
|
||||
PtrToFooMem.addValue(dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
|
||||
&BarEntry);
|
||||
|
||||
DIEEntry PtrToFooMemRef(&PtrToFooMem);
|
||||
DIEEntry PtrToFooMemRef(PtrToFooMem);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &PtrToFooMemRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -469,10 +469,10 @@ TEST(DIEHashTest, RefUnnamedType) {
|
||||
|
||||
DIE UnnamedPtr(dwarf::DW_TAG_pointer_type);
|
||||
UnnamedPtr.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Eight);
|
||||
DIEEntry UnnamedRef(&Unnamed);
|
||||
DIEEntry UnnamedRef(Unnamed);
|
||||
UnnamedPtr.addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &UnnamedRef);
|
||||
|
||||
DIEEntry UnnamedPtrRef(&UnnamedPtr);
|
||||
DIEEntry UnnamedPtrRef(UnnamedPtr);
|
||||
Mem->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &UnnamedPtrRef);
|
||||
|
||||
Foo.addChild(Mem);
|
||||
@ -572,11 +572,11 @@ TEST(DIEHashTest, MemberSdata) {
|
||||
IntTyDIE.addValue(dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, &Five);
|
||||
IntTyDIE.addValue(dwarf::DW_AT_name, dwarf::DW_FORM_strp, &FStr);
|
||||
|
||||
DIEEntry IntTy(&IntTyDIE);
|
||||
DIEEntry IntTy(IntTyDIE);
|
||||
DIE *PITyDIE = new DIE(dwarf::DW_TAG_const_type);
|
||||
PITyDIE->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &IntTy);
|
||||
|
||||
DIEEntry PITy(PITyDIE);
|
||||
DIEEntry PITy(*PITyDIE);
|
||||
DIE *PI = new DIE(dwarf::DW_TAG_member);
|
||||
DIEString PIStr(&One, "PI");
|
||||
DIEInteger Two(2);
|
||||
@ -616,11 +616,11 @@ TEST(DIEHashTest, MemberBlock) {
|
||||
FloatTyDIE->addValue(dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, &Four);
|
||||
FloatTyDIE->addValue(dwarf::DW_AT_name, dwarf::DW_FORM_strp, &FStr);
|
||||
|
||||
DIEEntry FloatTy(FloatTyDIE);
|
||||
DIEEntry FloatTy(*FloatTyDIE);
|
||||
DIE *PITyDIE = new DIE(dwarf::DW_TAG_const_type);
|
||||
PITyDIE->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &FloatTy);
|
||||
|
||||
DIEEntry PITy(PITyDIE);
|
||||
DIEEntry PITy(*PITyDIE);
|
||||
DIE *PI = new DIE(dwarf::DW_TAG_member);
|
||||
DIEString PIStr(&One, "PI");
|
||||
DIEInteger Two(2);
|
||||
|
Loading…
Reference in New Issue
Block a user