From c87722ce4beb2975e86d7225c9cba1f600c266e9 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 25 Apr 2014 21:30:03 +0000 Subject: [PATCH] [DWARF parser] Cleanup code in DWARFDebugAranges. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207276 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/DWARFContext.cpp | 2 ++ lib/DebugInfo/DWARFDebugAranges.cpp | 6 ++++++ lib/DebugInfo/DWARFDebugAranges.h | 16 +++++----------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index e74f1acdff5..08b7b916377 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -8,6 +8,8 @@ //===----------------------------------------------------------------------===// #include "DWARFContext.h" +#include "DWARFDebugArangeSet.h" + #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/Compression.h" diff --git a/lib/DebugInfo/DWARFDebugAranges.cpp b/lib/DebugInfo/DWARFDebugAranges.cpp index 08864a06021..4d7bf306f6c 100644 --- a/lib/DebugInfo/DWARFDebugAranges.cpp +++ b/lib/DebugInfo/DWARFDebugAranges.cpp @@ -10,6 +10,7 @@ #include "DWARFDebugAranges.h" #include "DWARFCompileUnit.h" #include "DWARFContext.h" +#include "DWARFDebugArangeSet.h" #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" #include @@ -70,6 +71,11 @@ void DWARFDebugAranges::generate(DWARFContext *CTX) { sortAndMinimize(); } +void DWARFDebugAranges::clear() { + Aranges.clear(); + ParsedCUOffsets.clear(); +} + void DWARFDebugAranges::appendRange(uint32_t CUOffset, uint64_t LowPC, uint64_t HighPC) { if (!Aranges.empty()) { diff --git a/lib/DebugInfo/DWARFDebugAranges.h b/lib/DebugInfo/DWARFDebugAranges.h index 35ad8e53d63..46b8bba6f4c 100644 --- a/lib/DebugInfo/DWARFDebugAranges.h +++ b/lib/DebugInfo/DWARFDebugAranges.h @@ -10,9 +10,8 @@ #ifndef LLVM_DEBUGINFO_DWARFDEBUGARANGES_H #define LLVM_DEBUGINFO_DWARFDEBUGARANGES_H -#include "DWARFDebugArangeSet.h" #include "llvm/ADT/DenseSet.h" -#include +#include "llvm/Support/DataExtractor.h" namespace llvm { @@ -20,20 +19,15 @@ class DWARFContext; class DWARFDebugAranges { public: - void clear() { - Aranges.clear(); - ParsedCUOffsets.clear(); - } - void generate(DWARFContext *CTX); - - // Use appendRange multiple times and then call sortAndMinimize. - void appendRange(uint32_t CUOffset, uint64_t LowPC, uint64_t HighPC); - uint32_t findAddress(uint64_t Address) const; private: + void clear(); void extract(DataExtractor DebugArangesData); + + // Use appendRange multiple times and then call sortAndMinimize. + void appendRange(uint32_t CUOffset, uint64_t LowPC, uint64_t HighPC); void sortAndMinimize(); struct Range {