Remove ARI check for multiple calls to warning or error
[deliverable/binutils-gdb.git] / gdb / memrange.h
index 6dcb0d97b91e5c77c86638631358291069b3c452..4f84e20cd73061809095c74de113731d153397a7 100644 (file)
@@ -1,6 +1,6 @@
 /* The memory range data structure, and associated utilities.
 
-   Copyright (C) 2010-2015 Free Software Foundation, Inc.
+   Copyright (C) 2010-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #ifndef MEMRANGE_H
 #define MEMRANGE_H
 
-#include "vec.h"
-
 /* Defines a [START, START + LENGTH) memory range.  */
 
 struct mem_range
 {
+  mem_range () = default;
+
+  mem_range (CORE_ADDR start_, int length_)
+  : start (start_), length (length_)
+  {}
+
+  bool operator< (const mem_range &other) const
+  {
+    return this->start < other.start;
+  }
+
+  bool operator== (const mem_range &other) const
+  {
+    return (this->start == other.start
+           && this->length == other.length);
+  }
+
   /* Lowest address in the range.  */
   CORE_ADDR start;
 
@@ -33,10 +48,6 @@ struct mem_range
   int length;
 };
 
-typedef struct mem_range mem_range_s;
-
-DEF_VEC_O(mem_range_s);
-
 /* Returns true if the ranges defined by [start1, start1+len1) and
    [start2, start2+len2) overlap.  */
 
@@ -51,6 +62,6 @@ extern int address_in_mem_range (CORE_ADDR addr,
 /* Sort ranges by start address, then coalesce contiguous or
    overlapping ranges.  */
 
-extern void normalize_mem_ranges (VEC(mem_range_s) *memory);
+extern void normalize_mem_ranges (std::vector<mem_range> *memory);
 
 #endif
This page took 0.024399 seconds and 4 git commands to generate.