mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
AsmPrinter: Stop exposing underlying DIE children list, NFC
Update `DIE` API to hide the implementation of `DIE::Children` so we can swap it out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -496,8 +496,12 @@ public:
|
|||||||
unsigned getOffset() const { return Offset; }
|
unsigned getOffset() const { return Offset; }
|
||||||
unsigned getSize() const { return Size; }
|
unsigned getSize() const { return Size; }
|
||||||
bool hasChildren() const { return !Children.empty(); }
|
bool hasChildren() const { return !Children.empty(); }
|
||||||
const std::vector<std::unique_ptr<DIE>> &getChildren() const {
|
|
||||||
return Children;
|
typedef std::vector<std::unique_ptr<DIE>>::const_iterator child_iterator;
|
||||||
|
typedef iterator_range<child_iterator> child_range;
|
||||||
|
|
||||||
|
child_range children() const {
|
||||||
|
return llvm::make_range(Children.begin(), Children.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef SmallVectorImpl<DIEValue>::const_iterator value_iterator;
|
typedef SmallVectorImpl<DIEValue>::const_iterator value_iterator;
|
||||||
|
@@ -281,7 +281,7 @@ void AsmPrinter::emitDwarfDIE(const DIE &Die) const {
|
|||||||
|
|
||||||
// Emit the DIE children if any.
|
// Emit the DIE children if any.
|
||||||
if (Die.hasChildren()) {
|
if (Die.hasChildren()) {
|
||||||
for (auto &Child : Die.getChildren())
|
for (auto &Child : Die.children())
|
||||||
emitDwarfDIE(*Child);
|
emitDwarfDIE(*Child);
|
||||||
|
|
||||||
OutStreamer->AddComment("End Of Children Mark");
|
OutStreamer->AddComment("End Of Children Mark");
|
||||||
|
@@ -451,7 +451,7 @@ void DIEHash::computeHash(const DIE &Die) {
|
|||||||
addAttributes(Die);
|
addAttributes(Die);
|
||||||
|
|
||||||
// Then hash each of the children of the DIE.
|
// Then hash each of the children of the DIE.
|
||||||
for (auto &C : Die.getChildren()) {
|
for (auto &C : Die.children()) {
|
||||||
// 7.27 Step 7
|
// 7.27 Step 7
|
||||||
// If C is a nested type entry or a member function entry, ...
|
// If C is a nested type entry or a member function entry, ...
|
||||||
if (isType(C->getTag()) || C->getTag() == dwarf::DW_TAG_subprogram) {
|
if (isType(C->getTag()) || C->getTag() == dwarf::DW_TAG_subprogram) {
|
||||||
|
@@ -105,15 +105,12 @@ unsigned DwarfFile::computeSizeAndOffset(DIE &Die, unsigned Offset) {
|
|||||||
// Size attribute value.
|
// Size attribute value.
|
||||||
Offset += V.SizeOf(Asm, V.getForm());
|
Offset += V.SizeOf(Asm, V.getForm());
|
||||||
|
|
||||||
// Get the children.
|
|
||||||
const auto &Children = Die.getChildren();
|
|
||||||
|
|
||||||
// Size the DIE children if any.
|
// Size the DIE children if any.
|
||||||
if (!Children.empty()) {
|
if (Die.hasChildren()) {
|
||||||
(void)Abbrev;
|
(void)Abbrev;
|
||||||
assert(Abbrev.hasChildren() && "Children flag not set");
|
assert(Abbrev.hasChildren() && "Children flag not set");
|
||||||
|
|
||||||
for (auto &Child : Children)
|
for (auto &Child : Die.children())
|
||||||
Offset = computeSizeAndOffset(*Child, Offset);
|
Offset = computeSizeAndOffset(*Child, Offset);
|
||||||
|
|
||||||
// End of children marker.
|
// End of children marker.
|
||||||
|
@@ -143,7 +143,7 @@ public:
|
|||||||
void setDebugInfoOffset(unsigned DbgInfoOff) { DebugInfoOffset = DbgInfoOff; }
|
void setDebugInfoOffset(unsigned DbgInfoOff) { DebugInfoOffset = DbgInfoOff; }
|
||||||
|
|
||||||
/// \brief Return true if this compile unit has something to write out.
|
/// \brief Return true if this compile unit has something to write out.
|
||||||
bool hasContent() const { return !UnitDie.getChildren().empty(); }
|
bool hasContent() const { return UnitDie.hasChildren(); }
|
||||||
|
|
||||||
/// \brief Get string containing language specific context for a global name.
|
/// \brief Get string containing language specific context for a global name.
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user