Move RangeMap.h into Utility
authorPavel Labath <pavel@labath.sk>
Wed, 6 Mar 2019 14:41:43 +0000 (14:41 +0000)
committerPavel Labath <pavel@labath.sk>
Wed, 6 Mar 2019 14:41:43 +0000 (14:41 +0000)
Summary:
This file implements some general purpose data structures, and so it
belongs to the Utility module.

Reviewers: zturner, jingham, JDevlieghere, clayborg, espindola

Subscribers: emaste, mgorny, javed.absar, arichardson, MaskRay, lldb-commits

Differential Revision: https://reviews.llvm.org/D58970

llvm-svn: 355509

24 files changed:
lldb/include/lldb/Core/dwarf.h
lldb/include/lldb/Symbol/ArmUnwindInfo.h
lldb/include/lldb/Symbol/Block.h
lldb/include/lldb/Symbol/CompactUnwindInfo.h
lldb/include/lldb/Symbol/DWARFCallFrameInfo.h
lldb/include/lldb/Symbol/LineTable.h
lldb/include/lldb/Symbol/Symtab.h
lldb/include/lldb/Symbol/Variable.h
lldb/include/lldb/Target/Memory.h
lldb/include/lldb/Target/MemoryRegionInfo.h
lldb/include/lldb/Utility/RangeMap.h [moved from lldb/include/lldb/Core/RangeMap.h with 99% similarity]
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
lldb/source/Target/Memory.cpp
lldb/unittests/Core/CMakeLists.txt
lldb/unittests/Utility/CMakeLists.txt
lldb/unittests/Utility/RangeMapTest.cpp [moved from lldb/unittests/Core/RangeMapTest.cpp with 98% similarity]
lldb/unittests/Utility/RangeTest.cpp [moved from lldb/unittests/Core/RangeTest.cpp with 99% similarity]

index 0303d38..3708fb7 100644 (file)
@@ -9,13 +9,12 @@
 #ifndef DebugBase_dwarf_h_
 #define DebugBase_dwarf_h_
 
+#include "lldb/Utility/RangeMap.h"
 #include <stdint.h>
 
 // Get the DWARF constant definitions from llvm
 #include "llvm/BinaryFormat/Dwarf.h"
 
-#include "lldb/Core/RangeMap.h"
-
 // and stuff them in our default namespace
 using namespace llvm::dwarf;
 
index 0973bd0..a74b444 100644 (file)
@@ -9,12 +9,11 @@
 #ifndef liblldb_ArmUnwindInfo_h_
 #define liblldb_ArmUnwindInfo_h_
 
-#include <vector>
-
-#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"
+#include <vector>
 
 /*
  * Unwind information reader and parser for the ARM exception handling ABI
index c4a8fdf..2159250 100644 (file)
@@ -9,17 +9,16 @@
 #ifndef liblldb_Block_h_
 #define liblldb_Block_h_
 
-#include <vector>
-
 #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"
+#include <vector>
 
 namespace lldb_private {
 
index 8ecb7c0..2646661 100644 (file)
@@ -9,14 +9,13 @@
 #ifndef liblldb_CompactUnwindInfo_h_
 #define liblldb_CompactUnwindInfo_h_
 
-#include <mutex>
-#include <vector>
-
-#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"
+#include <mutex>
+#include <vector>
 
 namespace lldb_private {
 
index 7f0f3db..80302e1 100644 (file)
 #include <mutex>
 
 #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/Flags.h"
+#include "lldb/Utility/RangeMap.h"
 #include "lldb/Utility/VMRange.h"
 #include "lldb/lldb-private.h"
 
index 383dc0d..2b803c1 100644 (file)
@@ -9,13 +9,12 @@
 #ifndef liblldb_LineTable_h_
 #define liblldb_LineTable_h_
 
-#include <vector>
-
 #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"
+#include <vector>
 
 namespace lldb_private {
 
index 3b1d488..7ed7d34 100644 (file)
@@ -9,13 +9,12 @@
 #ifndef liblldb_Symtab_h_
 #define liblldb_Symtab_h_
 
-#include <mutex>
-#include <vector>
-
-#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"
+#include <mutex>
+#include <vector>
 
 namespace lldb_private {
 
index 9c9a784..11c294e 100644 (file)
@@ -9,17 +9,16 @@
 #ifndef liblldb_Variable_h_
 #define liblldb_Variable_h_
 
-#include <memory>
-#include <vector>
-
 #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"
+#include <memory>
+#include <vector>
 
 namespace lldb_private {
 
index 05ff22a..4e3f737 100644 (file)
@@ -9,14 +9,12 @@
 #ifndef liblldb_Memory_h_
 #define liblldb_Memory_h_
 
+#include "lldb/Utility/RangeMap.h"
+#include "lldb/lldb-private.h"
 #include <map>
 #include <mutex>
 #include <vector>
 
-
-#include "lldb/Core/RangeMap.h"
-#include "lldb/lldb-private.h"
-
 namespace lldb_private {
 //----------------------------------------------------------------------
 // A class to track memory that was read from a live process between
index b16d8f5..94cabde 100644 (file)
@@ -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 {
similarity index 99%
rename from lldb/include/lldb/Core/RangeMap.h
rename to lldb/include/lldb/Utility/RangeMap.h
index b2a49f4..f55be02 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef liblldb_RangeMap_h_
-#define liblldb_RangeMap_h_
+#ifndef LLDB_UTILITY_RANGEMAP_H
+#define LLDB_UTILITY_RANGEMAP_H
 
 #include <algorithm>
 #include <vector>
@@ -53,10 +53,8 @@ template <typename B, typename S> struct Range {
 
   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<BaseType>(GetRangeEnd(), rhs.GetRangeEnd());
       base = std::min<BaseType>(base, rhs.base);
       size = new_end - base;
@@ -569,7 +567,6 @@ public:
   }
 
 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 @@ protected:
         m_entries.erase(pos);
       pos = prev;
     }
-    
+
     auto end = m_entries.end();
     if (pos != end) {
       auto next = pos + 1;
@@ -947,4 +944,4 @@ protected:
 
 } // namespace lldb_private
 
-#endif // liblldb_RangeMap_h_
+#endif // LLDB_UTILITY_RANGEMAP_H
index 0372655..7ea6030 100644 (file)
@@ -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 2c9fed2..6dd72a3 100644 (file)
@@ -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 035142a..64f39f4 100644 (file)
@@ -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 1ad89c0..83f382c 100644 (file)
 
 #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 622f106..f3fce92 100644 (file)
 #define SymbolFileDWARF_DWARFDebugAranges_h_
 
 #include "DWARFDebugArangeSet.h"
+#include "lldb/Utility/RangeMap.h"
 #include <list>
 
-#include "lldb/Core/RangeMap.h"
-
 class SymbolFileDWARF;
 
 class DWARFDebugAranges {
index a93129d..7ac344c 100644 (file)
@@ -19,9 +19,6 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Support/Threading.h"
 
-#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 +26,8 @@
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/Flags.h"
+#include "lldb/Utility/RangeMap.h"
 #include "lldb/lldb-private.h"
 
 #include "DWARFDataExtractor.h"
index 8bb41ad..b27dc49 100644 (file)
@@ -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 c44f034..aabea2c 100644 (file)
@@ -9,14 +9,13 @@
 #ifndef SymbolFileDWARF_SymbolFileDWARFDebugMap_h_
 #define SymbolFileDWARF_SymbolFileDWARFDebugMap_h_
 
+#include "lldb/Symbol/SymbolFile.h"
+#include "lldb/Utility/RangeMap.h"
+#include "llvm/Support/Chrono.h"
 #include <bitset>
 #include <map>
 #include <vector>
 
-#include "lldb/Core/RangeMap.h"
-#include "lldb/Symbol/SymbolFile.h"
-#include "llvm/Support/Chrono.h"
-
 #include "UniqueDWARFASTType.h"
 
 class SymbolFileDWARF;
index 979553f..fac5e43 100644 (file)
@@ -7,11 +7,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 <cinttypes>
index 374de8c..dcac714 100644 (file)
@@ -1,7 +1,5 @@
 add_lldb_unittest(LLDBCoreTests
   MangledTest.cpp
-  RangeMapTest.cpp
-  RangeTest.cpp
   RichManglingContextTest.cpp
   StreamCallbackTest.cpp
 
index 37bcb9f..ad73fdf 100644 (file)
@@ -19,6 +19,8 @@ add_lldb_unittest(UtilityTests
   NameMatchesTest.cpp
   PredicateTest.cpp
   ProcessInfoTest.cpp
+  RangeMapTest.cpp
+  RangeTest.cpp
   RegisterValueTest.cpp
   ReproducerTest.cpp
   ReproducerInstrumentationTest.cpp
similarity index 98%
rename from lldb/unittests/Core/RangeMapTest.cpp
rename to lldb/unittests/Utility/RangeMapTest.cpp
index 3018fac..ebb49cc 100644 (file)
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/RangeMap.h"
+#include "lldb/Utility/RangeMap.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
similarity index 99%
rename from lldb/unittests/Core/RangeTest.cpp
rename to lldb/unittests/Utility/RangeTest.cpp
index c36a85e..4066220 100644 (file)
@@ -6,8 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Core/RangeMap.h"
-
+#include "lldb/Utility/RangeMap.h"
 #include <cstdint>
 #include <type_traits>