================ @@ -0,0 +1,86 @@ +//===-- CoreFileMemoryRanges.cpp --------------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "lldb/Target/CoreFileMemoryRanges.h" + +using namespace lldb; +using namespace lldb_private; + +using Entry = CoreFileMemoryRanges::Entry; + +static bool Overlaps(const Entry *region_one, const Entry *region_two) { + return !(region_one->GetRangeEnd() < region_two->GetRangeBase() || + region_two->GetRangeEnd() < region_one->GetRangeBase()); +} + +static bool IntersectHelper(const Entry *region_one, const Entry *region_two) { + return region_one->GetRangeBase() == region_two->GetRangeEnd() || + region_one->GetRangeEnd() == region_two->GetRangeBase(); +} + +static bool OnlyIntersects(const Entry *region_one, const Entry *region_two) { + return IntersectHelper(region_one, region_two) || + IntersectHelper(region_two, region_one); ---------------- mbucko wrote:
I believe `IntersectHelper(region_one, region_two)` is the same as `IntersectHelper(region_two, region_one)` no? https://github.com/llvm/llvm-project/pull/107937 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits