Index: include/lldb/Core/dwarf.h =================================================================== --- include/lldb/Core/dwarf.h +++ include/lldb/Core/dwarf.h @@ -14,7 +14,7 @@ // Get the DWARF constant definitions from llvm #include "llvm/BinaryFormat/Dwarf.h" -#include "lldb/Core/RangeMap.h" +#include "lldb/Utility/RangeMap.h" // and stuff them in our default namespace using namespace llvm::dwarf; Index: include/lldb/Symbol/ArmUnwindInfo.h =================================================================== --- include/lldb/Symbol/ArmUnwindInfo.h +++ include/lldb/Symbol/ArmUnwindInfo.h @@ -11,9 +11,9 @@ #include -#include "lldb/Core/RangeMap.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/DataExtractor.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/lldb-private.h" /* Index: include/lldb/Symbol/Block.h =================================================================== --- include/lldb/Symbol/Block.h +++ include/lldb/Symbol/Block.h @@ -12,11 +12,11 @@ #include #include "lldb/Core/AddressRange.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Symbol/LineEntry.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/SymbolContextScope.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/Stream.h" #include "lldb/Utility/UserID.h" #include "lldb/lldb-private.h" Index: include/lldb/Symbol/CompactUnwindInfo.h =================================================================== --- include/lldb/Symbol/CompactUnwindInfo.h +++ include/lldb/Symbol/CompactUnwindInfo.h @@ -12,10 +12,10 @@ #include #include -#include "lldb/Core/RangeMap.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Utility/DataExtractor.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: include/lldb/Symbol/DWARFCallFrameInfo.h =================================================================== --- include/lldb/Symbol/DWARFCallFrameInfo.h +++ include/lldb/Symbol/DWARFCallFrameInfo.h @@ -15,10 +15,10 @@ #include "lldb/Core/AddressRange.h" #include "lldb/Utility/Flags.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/dwarf.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/VMRange.h" #include "lldb/lldb-private.h" Index: include/lldb/Symbol/LineTable.h =================================================================== --- include/lldb/Symbol/LineTable.h +++ include/lldb/Symbol/LineTable.h @@ -12,9 +12,9 @@ #include #include "lldb/Core/ModuleChild.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Symbol/LineEntry.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: include/lldb/Symbol/Symtab.h =================================================================== --- include/lldb/Symbol/Symtab.h +++ include/lldb/Symbol/Symtab.h @@ -12,9 +12,9 @@ #include #include -#include "lldb/Core/RangeMap.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Symbol/Symbol.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: include/lldb/Symbol/Variable.h =================================================================== --- include/lldb/Symbol/Variable.h +++ include/lldb/Symbol/Variable.h @@ -13,10 +13,10 @@ #include #include "lldb/Core/Mangled.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Expression/DWARFExpression.h" #include "lldb/Symbol/Declaration.h" #include "lldb/Utility/CompletionRequest.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/UserID.h" #include "lldb/lldb-enumerations.h" #include "lldb/lldb-private.h" Index: include/lldb/Target/Memory.h =================================================================== --- include/lldb/Target/Memory.h +++ include/lldb/Target/Memory.h @@ -13,8 +13,7 @@ #include #include - -#include "lldb/Core/RangeMap.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/lldb-private.h" namespace lldb_private { Index: include/lldb/Target/MemoryRegionInfo.h =================================================================== --- include/lldb/Target/MemoryRegionInfo.h +++ include/lldb/Target/MemoryRegionInfo.h @@ -10,9 +10,9 @@ #ifndef lldb_MemoryRegionInfo_h #define lldb_MemoryRegionInfo_h -#include "lldb/Core/RangeMap.h" -#include "llvm/Support/FormatProviders.h" #include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RangeMap.h" +#include "llvm/Support/FormatProviders.h" namespace lldb_private { class MemoryRegionInfo { Index: include/lldb/Utility/RangeMap.h =================================================================== --- include/lldb/Utility/RangeMap.h +++ include/lldb/Utility/RangeMap.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef liblldb_RangeMap_h_ -#define liblldb_RangeMap_h_ +#ifndef LLDB_UTILITY_RANGEMAP_H +#define LLDB_UTILITY_RANGEMAP_H #include #include @@ -53,10 +53,8 @@ void Slide(BaseType slide) { base += slide; } - bool Union(const Range &rhs) - { - if (DoesAdjoinOrIntersect(rhs)) - { + bool Union(const Range &rhs) { + if (DoesAdjoinOrIntersect(rhs)) { auto new_end = std::max(GetRangeEnd(), rhs.GetRangeEnd()); base = std::min(base, rhs.base); size = new_end - base; @@ -569,7 +567,6 @@ } protected: - void CombinePrevAndNext(typename Collection::iterator pos) { // Check if the prev or next entries in case they need to be unioned with // the entry pointed to by "pos". @@ -579,7 +576,7 @@ m_entries.erase(pos); pos = prev; } - + auto end = m_entries.end(); if (pos != end) { auto next = pos + 1; @@ -947,4 +944,4 @@ } // namespace lldb_private -#endif // liblldb_RangeMap_h_ +#endif // LLDB_UTILITY_RANGEMAP_H Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp =================================================================== --- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -16,7 +16,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Host/FileSystem.h" #include "lldb/Symbol/DWARFCallFrameInfo.h" @@ -26,6 +25,7 @@ #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/Stream.h" #include "lldb/Utility/Timer.h" Index: source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp =================================================================== --- source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -14,7 +14,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamFile.h" #include "lldb/Host/Host.h" @@ -28,6 +27,7 @@ #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/StreamString.h" #include "lldb/Utility/Timer.h" #include "lldb/Utility/UUID.h" Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h =================================================================== --- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -11,10 +11,10 @@ #include "lldb/Core/Address.h" #include "lldb/Core/FileSpecList.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Host/SafeMachO.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/FileSpec.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/UUID.h" //---------------------------------------------------------------------- Index: source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -17,7 +17,6 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamFile.h" #include "lldb/Host/Host.h" @@ -35,6 +34,7 @@ #include "lldb/Utility/DataBuffer.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/RegisterValue.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" Index: source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h +++ source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h @@ -12,7 +12,7 @@ #include "DWARFDebugArangeSet.h" #include -#include "lldb/Core/RangeMap.h" +#include "lldb/Utility/RangeMap.h" class SymbolFileDWARF; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -21,7 +21,6 @@ #include "lldb/Utility/Flags.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/UniqueCStringMap.h" #include "lldb/Core/dwarf.h" #include "lldb/Expression/DWARFExpression.h" @@ -29,6 +28,7 @@ #include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/SymbolFile.h" #include "lldb/Utility/ConstString.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/lldb-private.h" #include "DWARFDataExtractor.h" Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -13,8 +13,8 @@ #include #include -#include "lldb/Core/RangeMap.h" #include "lldb/Symbol/SymbolFile.h" +#include "lldb/Utility/RangeMap.h" #include "llvm/Support/Chrono.h" #include "UniqueDWARFASTType.h" Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -12,9 +12,9 @@ #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Core/Section.h" #include "lldb/Host/FileSystem.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/Timer.h" Index: source/Target/Memory.cpp =================================================================== --- source/Target/Memory.cpp +++ source/Target/Memory.cpp @@ -8,10 +8,10 @@ #include "lldb/Target/Memory.h" -#include "lldb/Core/RangeMap.h" #include "lldb/Target/Process.h" #include "lldb/Utility/DataBufferHeap.h" #include "lldb/Utility/Log.h" +#include "lldb/Utility/RangeMap.h" #include "lldb/Utility/State.h" #include Index: unittests/Core/CMakeLists.txt =================================================================== --- unittests/Core/CMakeLists.txt +++ unittests/Core/CMakeLists.txt @@ -1,7 +1,5 @@ add_lldb_unittest(LLDBCoreTests MangledTest.cpp - RangeMapTest.cpp - RangeTest.cpp RichManglingContextTest.cpp StreamCallbackTest.cpp Index: unittests/Utility/CMakeLists.txt =================================================================== --- unittests/Utility/CMakeLists.txt +++ unittests/Utility/CMakeLists.txt @@ -19,6 +19,8 @@ NameMatchesTest.cpp PredicateTest.cpp ProcessInfoTest.cpp + RangeMapTest.cpp + RangeTest.cpp RegisterValueTest.cpp ReproducerTest.cpp ReproducerInstrumentationTest.cpp Index: unittests/Utility/RangeMapTest.cpp =================================================================== --- unittests/Utility/RangeMapTest.cpp +++ unittests/Utility/RangeMapTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/RangeMap.h" +#include "lldb/Utility/RangeMap.h" #include "gmock/gmock.h" #include "gtest/gtest.h" Index: unittests/Utility/RangeTest.cpp =================================================================== --- unittests/Utility/RangeTest.cpp +++ unittests/Utility/RangeTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Core/RangeMap.h" +#include "lldb/Utility/RangeMap.h" #include #include