xref: /freebsd-src/contrib/llvm-project/lldb/source/Core/ModuleChild.cpp (revision fe6060f10f634930ff71b7c50291ddc610da2475)
15ffd83dbSDimitry Andric //===-- ModuleChild.cpp ---------------------------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #include "lldb/Core/ModuleChild.h"
100b57cec5SDimitry Andric 
110b57cec5SDimitry Andric using namespace lldb_private;
120b57cec5SDimitry Andric 
ModuleChild(const lldb::ModuleSP & module_sp)130b57cec5SDimitry Andric ModuleChild::ModuleChild(const lldb::ModuleSP &module_sp)
140b57cec5SDimitry Andric     : m_module_wp(module_sp) {}
150b57cec5SDimitry Andric 
16*fe6060f1SDimitry Andric ModuleChild::~ModuleChild() = default;
170b57cec5SDimitry Andric 
operator =(const ModuleChild & rhs)180b57cec5SDimitry Andric const ModuleChild &ModuleChild::operator=(const ModuleChild &rhs) {
190b57cec5SDimitry Andric   if (this != &rhs)
200b57cec5SDimitry Andric     m_module_wp = rhs.m_module_wp;
210b57cec5SDimitry Andric   return *this;
220b57cec5SDimitry Andric }
230b57cec5SDimitry Andric 
GetModule() const240b57cec5SDimitry Andric lldb::ModuleSP ModuleChild::GetModule() const { return m_module_wp.lock(); }
250b57cec5SDimitry Andric 
SetModule(const lldb::ModuleSP & module_sp)260b57cec5SDimitry Andric void ModuleChild::SetModule(const lldb::ModuleSP &module_sp) {
270b57cec5SDimitry Andric   m_module_wp = module_sp;
280b57cec5SDimitry Andric }
29