Skip to content

Commit a3252d1

Browse files
committed
[lldb][NFC] Move various constructor definitions from .h to .cpp
I ran into issues with linking downstream language plugin to liblldb in debug builds, hitting link time errors of form: ``` undefined reference to `vtable for lldb_private::<Insert LLDB class here>' ``` Anchoring the vtable to the .cpp files resolved those issues. Differential Revision: https://reviews.llvm.org/D147252
1 parent a755e80 commit a3252d1

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

lldb/include/lldb/Expression/ExpressionVariable.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ class ExpressionVariable
2929

3030
LLVMCastKind getKind() const { return m_kind; }
3131

32-
ExpressionVariable(LLVMCastKind kind) : m_flags(0), m_kind(kind) {}
33-
32+
ExpressionVariable(LLVMCastKind kind);
3433
virtual ~ExpressionVariable();
3534

3635
std::optional<uint64_t> GetByteSize() { return m_frozen_sp->GetByteSize(); }
@@ -208,8 +207,7 @@ class PersistentExpressionState : public ExpressionVariableList {
208207

209208
LLVMCastKind getKind() const { return m_kind; }
210209

211-
PersistentExpressionState(LLVMCastKind kind) : m_kind(kind) {}
212-
210+
PersistentExpressionState(LLVMCastKind kind);
213211
virtual ~PersistentExpressionState();
214212

215213
virtual lldb::ExpressionVariableSP

lldb/include/lldb/Expression/Materializer.h

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class Materializer {
6969

7070
class PersistentVariableDelegate {
7171
public:
72+
PersistentVariableDelegate();
7273
virtual ~PersistentVariableDelegate();
7374
virtual ConstString GetName() = 0;
7475
virtual void DidDematerialize(lldb::ExpressionVariableSP &variable) = 0;

lldb/include/lldb/Symbol/TypeSystem.h

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class TypeSystem : public PluginInterface,
7777
public std::enable_shared_from_this<TypeSystem> {
7878
public:
7979
// Constructors and Destructors
80+
TypeSystem();
8081
~TypeSystem() override;
8182

8283
// LLVM RTTI support

lldb/source/Expression/ExpressionVariable.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
using namespace lldb_private;
1717

18+
ExpressionVariable::ExpressionVariable(LLVMCastKind kind)
19+
: m_flags(0), m_kind(kind) {}
1820
ExpressionVariable::~ExpressionVariable() = default;
1921

2022
uint8_t *ExpressionVariable::GetValueBytes() {
@@ -30,6 +32,8 @@ uint8_t *ExpressionVariable::GetValueBytes() {
3032
return nullptr;
3133
}
3234

35+
PersistentExpressionState::PersistentExpressionState(LLVMCastKind kind)
36+
: m_kind(kind) {}
3337
PersistentExpressionState::~PersistentExpressionState() = default;
3438

3539
lldb::addr_t PersistentExpressionState::LookupSymbol(ConstString name) {

lldb/source/Expression/Materializer.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1598,5 +1598,7 @@ void Materializer::Dematerializer::Wipe() {
15981598
m_process_address = LLDB_INVALID_ADDRESS;
15991599
}
16001600

1601+
Materializer::PersistentVariableDelegate::PersistentVariableDelegate() =
1602+
default;
16011603
Materializer::PersistentVariableDelegate::~PersistentVariableDelegate() =
16021604
default;

lldb/source/Symbol/TypeSystem.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ size_t LanguageSet::Size() const { return bitvector.count(); }
3636
bool LanguageSet::Empty() const { return bitvector.none(); }
3737
bool LanguageSet::operator[](unsigned i) const { return bitvector[i]; }
3838

39+
TypeSystem::TypeSystem() = default;
3940
TypeSystem::~TypeSystem() = default;
4041

4142
static TypeSystemSP CreateInstanceHelper(lldb::LanguageType language,

0 commit comments

Comments
 (0)