[LLDB] Explicitly declare constructor in `PersistentExpressionState`
authorLaszlo Kindrat <laszlo@modular.com>
Thu, 25 May 2023 21:13:28 +0000 (17:13 -0400)
committerLaszlo Kindrat <laszlo@modular.com>
Fri, 26 May 2023 13:25:44 +0000 (09:25 -0400)
It seems that when trying to link the lldb library explicitly, the inlined default constructor cannot find the vtable for the class. This patch fixes this by explicitly declaring a default constructor in `PersistentExpressionState`, and providing the definition in the source file.

Differential Revision: https://reviews.llvm.org/D151501

lldb/include/lldb/Expression/ExpressionVariable.h
lldb/source/Expression/ExpressionVariable.cpp

index ad85a21..277b00a 100644 (file)
@@ -207,6 +207,8 @@ public:
   /// LLVM RTTI support
   static char ID;
 
+  PersistentExpressionState();
+
   virtual ~PersistentExpressionState();
 
   virtual lldb::ExpressionVariableSP
index 44ab1c2..f0a2898 100644 (file)
@@ -34,6 +34,8 @@ uint8_t *ExpressionVariable::GetValueBytes() {
 
 char PersistentExpressionState::ID;
 
+PersistentExpressionState::PersistentExpressionState() = default;
+
 PersistentExpressionState::~PersistentExpressionState() = default;
 
 lldb::addr_t PersistentExpressionState::LookupSymbol(ConstString name) {