[mlir][py] Enable loading only specified dialects during creation. (#121421)
[llvm-project.git] / lldb / source / Core / AddressRangeListImpl.cpp
blob257824a0551e1b5f17638ab8b66c0c8c846f449d
1 //===-- AddressRangeListImpl.cpp ------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Core/AddressRangeListImpl.h"
11 using namespace lldb;
12 using namespace lldb_private;
14 AddressRangeListImpl::AddressRangeListImpl() : m_ranges() {}
16 size_t AddressRangeListImpl::GetSize() const { return m_ranges.size(); }
18 void AddressRangeListImpl::Reserve(size_t capacity) {
19 m_ranges.reserve(capacity);
22 void AddressRangeListImpl::Append(const AddressRange &sb_region) {
23 m_ranges.emplace_back(sb_region);
26 void AddressRangeListImpl::Append(const AddressRangeListImpl &list) {
27 Reserve(GetSize() + list.GetSize());
29 for (const auto &range : list.m_ranges)
30 Append(range);
33 void AddressRangeListImpl::Clear() { m_ranges.clear(); }
35 lldb_private::AddressRange
36 AddressRangeListImpl::GetAddressRangeAtIndex(size_t index) {
37 if (index >= GetSize())
38 return AddressRange();
39 return m_ranges[index];
42 AddressRanges &AddressRangeListImpl::ref() { return m_ranges; }