diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp index b74ecac681..788ea89400 100644 --- a/contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp +++ b/contrib/libs/llvm12/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp @@ -12,7 +12,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/BinaryFormat/Dwarf.h" -#include "llvm/MC/MCRegisterInfo.h" +#include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/DataExtractor.h" @@ -30,18 +30,18 @@ using namespace llvm; using namespace dwarf; -static void printRegister(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH, - unsigned RegNum) { - if (MRI) { - if (Optional<unsigned> LLVMRegNum = MRI->getLLVMRegNum(RegNum, IsEH)) { - if (const char *RegName = MRI->getName(*LLVMRegNum)) { - OS << RegName; - return; - } - } - } - OS << "reg" << RegNum; -} +static void printRegister(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH, + unsigned RegNum) { + if (MRI) { + if (Optional<unsigned> LLVMRegNum = MRI->getLLVMRegNum(RegNum, IsEH)) { + if (const char *RegName = MRI->getName(*LLVMRegNum)) { + OS << RegName; + return; + } + } + } + OS << "reg" << RegNum; +} // See DWARF standard v3, section 7.23 const uint8_t DWARF_CFI_PRIMARY_OPCODE_MASK = 0xc0; @@ -234,10 +234,10 @@ ArrayRef<CFIProgram::OperandType[2]> CFIProgram::getOperandTypes() { } /// Print \p Opcode's operand number \p OperandIdx which has value \p Operand. -void CFIProgram::printOperand(raw_ostream &OS, DIDumpOptions DumpOpts, - const MCRegisterInfo *MRI, bool IsEH, - const Instruction &Instr, unsigned OperandIdx, - uint64_t Operand) const { +void CFIProgram::printOperand(raw_ostream &OS, DIDumpOptions DumpOpts, + const MCRegisterInfo *MRI, bool IsEH, + const Instruction &Instr, unsigned OperandIdx, + uint64_t Operand) const { assert(OperandIdx < 2); uint8_t Opcode = Instr.Opcode; OperandType Type = getOperandTypes()[Opcode][OperandIdx]; @@ -282,19 +282,19 @@ void CFIProgram::printOperand(raw_ostream &OS, DIDumpOptions DumpOpts, OS << format(" %" PRId64 "*data_alignment_factor" , Operand); break; case OT_Register: - OS << ' '; - printRegister(OS, MRI, IsEH, Operand); + OS << ' '; + printRegister(OS, MRI, IsEH, Operand); break; case OT_Expression: assert(Instr.Expression && "missing DWARFExpression object"); OS << " "; - Instr.Expression->print(OS, DumpOpts, MRI, nullptr, IsEH); + Instr.Expression->print(OS, DumpOpts, MRI, nullptr, IsEH); break; } } -void CFIProgram::dump(raw_ostream &OS, DIDumpOptions DumpOpts, - const MCRegisterInfo *MRI, bool IsEH, +void CFIProgram::dump(raw_ostream &OS, DIDumpOptions DumpOpts, + const MCRegisterInfo *MRI, bool IsEH, unsigned IndentLevel) const { for (const auto &Instr : Instructions) { uint8_t Opcode = Instr.Opcode; @@ -303,7 +303,7 @@ void CFIProgram::dump(raw_ostream &OS, DIDumpOptions DumpOpts, OS.indent(2 * IndentLevel); OS << CallFrameString(Opcode, Arch) << ":"; for (unsigned i = 0; i < Instr.Ops.size(); ++i) - printOperand(OS, DumpOpts, MRI, IsEH, Instr, i, Instr.Ops[i]); + printOperand(OS, DumpOpts, MRI, IsEH, Instr, i, Instr.Ops[i]); OS << '\n'; } } @@ -320,8 +320,8 @@ constexpr uint64_t getCIEId(bool IsDWARF64, bool IsEH) { return DW_CIE_ID; } -void CIE::dump(raw_ostream &OS, DIDumpOptions DumpOpts, - const MCRegisterInfo *MRI, bool IsEH) const { +void CIE::dump(raw_ostream &OS, DIDumpOptions DumpOpts, + const MCRegisterInfo *MRI, bool IsEH) const { // A CIE with a zero length is a terminator entry in the .eh_frame section. if (IsEH && Length == 0) { OS << format("%08" PRIx64, Offset) << " ZERO terminator\n"; @@ -353,12 +353,12 @@ void CIE::dump(raw_ostream &OS, DIDumpOptions DumpOpts, OS << "\n"; } OS << "\n"; - CFIs.dump(OS, DumpOpts, MRI, IsEH); + CFIs.dump(OS, DumpOpts, MRI, IsEH); OS << "\n"; } -void FDE::dump(raw_ostream &OS, DIDumpOptions DumpOpts, - const MCRegisterInfo *MRI, bool IsEH) const { +void FDE::dump(raw_ostream &OS, DIDumpOptions DumpOpts, + const MCRegisterInfo *MRI, bool IsEH) const { OS << format("%08" PRIx64, Offset) << format(" %0*" PRIx64, IsDWARF64 ? 16 : 8, Length) << format(" %0*" PRIx64, IsDWARF64 && !IsEH ? 16 : 8, CIEPointer) @@ -372,7 +372,7 @@ void FDE::dump(raw_ostream &OS, DIDumpOptions DumpOpts, OS << " Format: " << FormatString(IsDWARF64) << "\n"; if (LSDAAddress) OS << format(" LSDA Address: %016" PRIx64 "\n", *LSDAAddress); - CFIs.dump(OS, DumpOpts, MRI, IsEH); + CFIs.dump(OS, DumpOpts, MRI, IsEH); OS << "\n"; } @@ -539,9 +539,9 @@ Error DWARFDebugFrame::parse(DWARFDataExtractor Data) { "parsing FDE data at 0x%" PRIx64 " failed due to missing CIE", StartOffset); - if (auto Val = - Data.getEncodedPointer(&Offset, Cie->getFDEPointerEncoding(), - EHFrameAddress + Offset)) { + if (auto Val = + Data.getEncodedPointer(&Offset, Cie->getFDEPointerEncoding(), + EHFrameAddress + Offset)) { InitialLocation = *Val; } if (auto Val = Data.getEncodedPointer( @@ -601,16 +601,16 @@ FrameEntry *DWARFDebugFrame::getEntryAtOffset(uint64_t Offset) const { return nullptr; } -void DWARFDebugFrame::dump(raw_ostream &OS, DIDumpOptions DumpOpts, - const MCRegisterInfo *MRI, +void DWARFDebugFrame::dump(raw_ostream &OS, DIDumpOptions DumpOpts, + const MCRegisterInfo *MRI, Optional<uint64_t> Offset) const { if (Offset) { if (auto *Entry = getEntryAtOffset(*Offset)) - Entry->dump(OS, DumpOpts, MRI, IsEH); + Entry->dump(OS, DumpOpts, MRI, IsEH); return; } OS << "\n"; for (const auto &Entry : Entries) - Entry->dump(OS, DumpOpts, MRI, IsEH); + Entry->dump(OS, DumpOpts, MRI, IsEH); } |