xref: /src/contrib/llvm-project/lldb/source/Core/ModuleChild.cpp (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1cfca06d7SDimitry Andric //===-- ModuleChild.cpp ---------------------------------------------------===//
2f034231aSEd Maste //
35f29bb8aSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45f29bb8aSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
55f29bb8aSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6f034231aSEd Maste //
7f034231aSEd Maste //===----------------------------------------------------------------------===//
8f034231aSEd Maste 
9f034231aSEd Maste #include "lldb/Core/ModuleChild.h"
10f034231aSEd Maste 
11f034231aSEd Maste using namespace lldb_private;
12f034231aSEd Maste 
ModuleChild(const lldb::ModuleSP & module_sp)1314f1b3e8SDimitry Andric ModuleChild::ModuleChild(const lldb::ModuleSP &module_sp)
1414f1b3e8SDimitry Andric     : m_module_wp(module_sp) {}
15f034231aSEd Maste 
16344a3780SDimitry Andric ModuleChild::~ModuleChild() = default;
17f034231aSEd Maste 
operator =(const ModuleChild & rhs)1814f1b3e8SDimitry Andric const ModuleChild &ModuleChild::operator=(const ModuleChild &rhs) {
19f034231aSEd Maste   if (this != &rhs)
20f034231aSEd Maste     m_module_wp = rhs.m_module_wp;
21f034231aSEd Maste   return *this;
22f034231aSEd Maste }
23f034231aSEd Maste 
GetModule() const2414f1b3e8SDimitry Andric lldb::ModuleSP ModuleChild::GetModule() const { return m_module_wp.lock(); }
25f034231aSEd Maste 
SetModule(const lldb::ModuleSP & module_sp)2614f1b3e8SDimitry Andric void ModuleChild::SetModule(const lldb::ModuleSP &module_sp) {
27f034231aSEd Maste   m_module_wp = module_sp;
28f034231aSEd Maste }
29