diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp | 18 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 29 | ||||
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp | 28 |
9 files changed, 83 insertions, 46 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp index 08bc74a81e9..fbea2964d3a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp @@ -1,4 +1,4 @@ -//===-- DWARFAbbreviationDeclaration.cpp ----------------------------------===// +//===- DWARFAbbreviationDeclaration.cpp -----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,12 +7,18 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/None.h" +#include "llvm/ADT/Optional.h" #include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" #include "llvm/DebugInfo/DWARF/DWARFUnit.h" +#include "llvm/Support/DataExtractor.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" +#include <cstddef> +#include <cstdint> + using namespace llvm; using namespace dwarf; diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp index 2eac2cd50b8..85e1eaedfc6 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp @@ -1,4 +1,4 @@ -//===--- DWARFAcceleratorTable.cpp ----------------------------------------===// +//===- DWARFAcceleratorTable.cpp ------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,12 +7,19 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/SmallVector.h" #include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h" +#include "llvm/DebugInfo/DWARF/DWARFFormValue.h" +#include "llvm/DebugInfo/DWARF/DWARFRelocMap.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" +#include <cstddef> +#include <cstdint> +#include <utility> -namespace llvm { +using namespace llvm; bool DWARFAcceleratorTable::extract() { uint32_t Offset = 0; @@ -131,4 +138,3 @@ LLVM_DUMP_METHOD void DWARFAcceleratorTable::dump(raw_ostream &OS) const { } } } -} diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp index e63e28997ed..76dd2e4c21b 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp @@ -1,4 +1,4 @@ -//===-- DWARFDebugAbbrev.cpp ----------------------------------------------===// +//===- DWARFDebugAbbrev.cpp -----------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -10,6 +10,10 @@ #include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" +#include <algorithm> +#include <cinttypes> +#include <cstdint> + using namespace llvm; DWARFAbbreviationDeclarationSet::DWARFAbbreviationDeclarationSet() { diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp index 67589cd01e5..ed5d726ae4e 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp @@ -1,4 +1,4 @@ -//===-- DWARFDebugArangeSet.cpp -------------------------------------------===// +//===- DWARFDebugArangeSet.cpp --------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -10,8 +10,11 @@ #include "llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" -#include <algorithm> #include <cassert> +#include <cinttypes> +#include <cstdint> +#include <cstring> + using namespace llvm; void DWARFDebugArangeSet::clear() { diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp index 27a02c4c50d..0cf71f53044 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp @@ -1,4 +1,4 @@ -//===-- DWARFDebugAranges.cpp -----------------------------------*- C++ -*-===// +//===- DWARFDebugAranges.cpp ----------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -11,11 +11,13 @@ #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h" -#include "llvm/Support/Format.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/Support/DataExtractor.h" #include <algorithm> #include <cassert> +#include <cstdint> #include <set> +#include <vector> + using namespace llvm; void DWARFDebugAranges::extract(DataExtractor DebugArangesData) { @@ -81,7 +83,7 @@ void DWARFDebugAranges::construct() { std::sort(Endpoints.begin(), Endpoints.end()); uint64_t PrevAddress = -1ULL; for (const auto &E : Endpoints) { - if (PrevAddress < E.Address && ValidCUs.size() > 0) { + if (PrevAddress < E.Address && !ValidCUs.empty()) { // If the address range between two endpoints is described by some // CU, first try to extend the last range in Aranges. If we can't // do it, start a new range. diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp index c487e1dca7c..35f673c7acc 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp @@ -1,4 +1,4 @@ -//===-- DWARFDebugInfoEntry.cpp -------------------------------------------===// +//===- DWARFDebugInfoEntry.cpp --------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,20 +7,17 @@ // //===----------------------------------------------------------------------===// -#include "SyntaxHighlighting.h" -#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" -#include "llvm/DebugInfo/DWARF/DWARFContext.h" +#include "llvm/ADT/Optional.h" #include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h" #include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Dwarf.h" -#include "llvm/Support/Format.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/DebugInfo/DWARF/DWARFUnit.h" +#include "llvm/Support/DataExtractor.h" +#include <cstddef> +#include <cstdint> + using namespace llvm; using namespace dwarf; -using namespace syntax; bool DWARFDebugInfoEntry::extractFast(const DWARFUnit &U, uint32_t *OffsetPtr) { @@ -28,6 +25,7 @@ bool DWARFDebugInfoEntry::extractFast(const DWARFUnit &U, const uint32_t UEndOffset = U.getNextUnitOffset(); return extractFast(U, OffsetPtr, DebugInfoData, UEndOffset, 0); } + bool DWARFDebugInfoEntry::extractFast(const DWARFUnit &U, uint32_t *OffsetPtr, const DataExtractor &DebugInfoData, uint32_t UEndOffset, uint32_t D) { diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index 494059461fd..e4670519b79 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -1,4 +1,4 @@ -//===-- DWARFDebugLine.cpp ------------------------------------------------===// +//===- DWARFDebugLine.cpp -------------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,14 +7,23 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/SmallString.h" #include "llvm/DebugInfo/DWARF/DWARFDebugLine.h" +#include "llvm/DebugInfo/DWARF/DWARFRelocMap.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/Format.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> +#include <cassert> +#include <cinttypes> +#include <cstdint> +#include <cstdio> +#include <utility> + using namespace llvm; using namespace dwarf; + typedef DILineInfoSpecifier::FileLineInfoKind FileLineInfoKind; DWARFDebugLine::Prologue::Prologue() { clear(); } diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index bdeff7bd3af..fc49fdeaad5 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -1,4 +1,4 @@ -//===-- DWARFDie.cpp ------------------------------------------------------===// +//===- DWARFDie.cpp -------------------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -7,25 +7,33 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/DWARF/DWARFDie.h" #include "SyntaxHighlighting.h" -#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" +#include "llvm/ADT/None.h" +#include "llvm/ADT/Optional.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" -#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h" -#include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h" +#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h" +#include "llvm/DebugInfo/DWARF/DWARFDie.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/Debug.h" +#include "llvm/DebugInfo/DWARF/DWARFUnit.h" +#include "llvm/Support/DataExtractor.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/Format.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" +#include <algorithm> +#include <cassert> +#include <cinttypes> +#include <cstdint> +#include <string> +#include <utility> using namespace llvm; using namespace dwarf; using namespace syntax; -namespace { - static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val) { +static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val) { OS << " ("; do { uint64_t Shift = countTrailingZeros(Val); @@ -122,8 +130,6 @@ static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die, OS << ")\n"; } -} // end anonymous namespace - bool DWARFDie::isSubprogramDIE() const { return getTag() == DW_TAG_subprogram; } @@ -356,7 +362,6 @@ void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth, } } - void DWARFDie::getInlinedChainForAddress( const uint64_t Address, SmallVectorImpl<DWARFDie> &InlinedChain) const { if (isNULL()) diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp index 0bed1a1e99c..e60a5dc313c 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp @@ -1,4 +1,4 @@ -//===-- DWARFFormValue.cpp ------------------------------------------------===// +//===- DWARFFormValue.cpp -------------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -9,16 +9,21 @@ #include "SyntaxHighlighting.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/None.h" +#include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" -#include "llvm/Support/Debug.h" +#include "llvm/DebugInfo/DWARF/DWARFRelocMap.h" +#include "llvm/DebugInfo/DWARF/DWARFUnit.h" #include "llvm/Support/Dwarf.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" -#include <cassert> +#include <cinttypes> +#include <cstdint> #include <limits> + using namespace llvm; using namespace dwarf; using namespace syntax; @@ -66,13 +71,16 @@ class FormSizeHelper { public: FormSizeHelper(uint16_t V, uint8_t A, llvm::dwarf::DwarfFormat F) - : Version(V), AddrSize(A), Format(F) {} + : Version(V), AddrSize(A), Format(F) {} + uint8_t getAddressByteSize() const { return AddrSize; } + uint8_t getRefAddrByteSize() const { if (Version == 2) return AddrSize; return getDwarfOffsetByteSize(); } + uint8_t getDwarfOffsetByteSize() const { switch (Format) { case dwarf::DwarfFormat::DWARF32: @@ -497,21 +505,18 @@ DWARFFormValue::dump(raw_ostream &OS) const { case DW_FORM_sdata: OS << Value.sval; break; case DW_FORM_udata: OS << Value.uval; break; - case DW_FORM_strp: { + case DW_FORM_strp: OS << format(" .debug_str[0x%8.8x] = ", (uint32_t)uvalue); dumpString(OS); break; - } - case DW_FORM_GNU_str_index: { + case DW_FORM_GNU_str_index: OS << format(" indexed (%8.8x) string = ", (uint32_t)uvalue); dumpString(OS); break; - } - case DW_FORM_GNU_strp_alt: { + case DW_FORM_GNU_strp_alt: OS << format("alt indirect string, offset: 0x%" PRIx64 "", uvalue); dumpString(OS); break; - } case DW_FORM_ref_addr: OS << format("0x%016" PRIx64, uvalue); break; @@ -676,4 +681,3 @@ Optional<uint64_t> DWARFFormValue::getAsReferenceUVal() const { return None; return Value.uval; } - |