[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
This commit is contained in:
Alexey Samsonov 2014-04-25 21:30:03 +00:00
parent bfd66f57da
commit c87722ce4b
3 changed files with 13 additions and 11 deletions

View File

@ -8,6 +8,8 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "DWARFContext.h" #include "DWARFContext.h"
#include "DWARFDebugArangeSet.h"
#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Compression.h" #include "llvm/Support/Compression.h"

View File

@ -10,6 +10,7 @@
#include "DWARFDebugAranges.h" #include "DWARFDebugAranges.h"
#include "DWARFCompileUnit.h" #include "DWARFCompileUnit.h"
#include "DWARFContext.h" #include "DWARFContext.h"
#include "DWARFDebugArangeSet.h"
#include "llvm/Support/Format.h" #include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include <algorithm> #include <algorithm>
@ -70,6 +71,11 @@ void DWARFDebugAranges::generate(DWARFContext *CTX) {
sortAndMinimize(); sortAndMinimize();
} }
void DWARFDebugAranges::clear() {
Aranges.clear();
ParsedCUOffsets.clear();
}
void DWARFDebugAranges::appendRange(uint32_t CUOffset, uint64_t LowPC, void DWARFDebugAranges::appendRange(uint32_t CUOffset, uint64_t LowPC,
uint64_t HighPC) { uint64_t HighPC) {
if (!Aranges.empty()) { if (!Aranges.empty()) {

View File

@ -10,9 +10,8 @@
#ifndef LLVM_DEBUGINFO_DWARFDEBUGARANGES_H #ifndef LLVM_DEBUGINFO_DWARFDEBUGARANGES_H
#define LLVM_DEBUGINFO_DWARFDEBUGARANGES_H #define LLVM_DEBUGINFO_DWARFDEBUGARANGES_H
#include "DWARFDebugArangeSet.h"
#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseSet.h"
#include <list> #include "llvm/Support/DataExtractor.h"
namespace llvm { namespace llvm {
@ -20,20 +19,15 @@ class DWARFContext;
class DWARFDebugAranges { class DWARFDebugAranges {
public: public:
void clear() {
Aranges.clear();
ParsedCUOffsets.clear();
}
void generate(DWARFContext *CTX); 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; uint32_t findAddress(uint64_t Address) const;
private: private:
void clear();
void extract(DataExtractor DebugArangesData); 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(); void sortAndMinimize();
struct Range { struct Range {