mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-03 15:26:18 +00:00
Add concrete type overloads to PDBSymbol::findChildren().
Frequently you only want to iterate over children of a specific type (e.g. functions). Previously you would get back a generic interface that allowed iteration over the base symbol type, which you would have to dyn_cast<> each one of. With this patch, we allow the user to specify the concrete type as a template parameter, and it will return an iterator which returns instances of the concrete type directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,35 +27,21 @@ void PDBSymbolFunc::dump(raw_ostream &OS, int Indent,
|
||||
if (Level == PDB_DumpLevel::Compact) {
|
||||
uint32_t FuncStart = getRelativeVirtualAddress();
|
||||
uint32_t FuncEnd = FuncStart + getLength();
|
||||
auto DebugEndSymbol = findChildren(PDB_SymType::FuncDebugEnd);
|
||||
OS << stream_indent(Indent);
|
||||
OS << "[" << format_hex(FuncStart, 8);
|
||||
if (auto DebugStartEnum = findChildren(PDB_SymType::FuncDebugStart)) {
|
||||
if (auto StartSym = DebugStartEnum->getNext()) {
|
||||
auto DebugStart = dyn_cast<PDBSymbolFuncDebugStart>(StartSym.get());
|
||||
OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart;
|
||||
}
|
||||
}
|
||||
if (auto DebugStart = findOneChild<PDBSymbolFuncDebugStart>())
|
||||
OS << "+" << DebugStart->getRelativeVirtualAddress() - FuncStart;
|
||||
OS << " - " << format_hex(FuncEnd, 8);
|
||||
if (auto DebugEndEnum = findChildren(PDB_SymType::FuncDebugEnd)) {
|
||||
if (auto DebugEndSym = DebugEndEnum->getNext()) {
|
||||
auto DebugEnd = dyn_cast<PDBSymbolFuncDebugEnd>(DebugEndSym.get());
|
||||
if (auto DebugEnd = findOneChild<PDBSymbolFuncDebugEnd>())
|
||||
OS << "-" << FuncEnd - DebugEnd->getRelativeVirtualAddress();
|
||||
}
|
||||
}
|
||||
OS << "] ";
|
||||
PDB_RegisterId Reg = getLocalBasePointerRegisterId();
|
||||
if (Reg == PDB_RegisterId::VFrame)
|
||||
OS << "(VFrame)";
|
||||
else if (hasFramePointer()) {
|
||||
if (Reg == PDB_RegisterId::EBP)
|
||||
OS << "(EBP)";
|
||||
else
|
||||
OS << "(" << (int)Reg << ")";
|
||||
} else {
|
||||
else if (hasFramePointer())
|
||||
OS << "(" << Reg << ")";
|
||||
else
|
||||
OS << "(FPO)";
|
||||
}
|
||||
OS << " " << getName() << "\n";
|
||||
}
|
||||
OS.flush();
|
||||
}
|
||||
|
Reference in New Issue
Block a user