[Lldb-commits] [lldb] f237513 - [LLDB] Add some declarations related to REPL support for mojo

walter erquinigo via lldb-commits lldb-commits at lists.llvm.org
Tue May 23 11:39:51 PDT 2023


Author: walter erquinigo
Date: 2023-05-23T13:39:43-05:00
New Revision: f237513cda8e6ec32579ff047b008e22422db2ff

URL: https://github.com/llvm/llvm-project/commit/f237513cda8e6ec32579ff047b008e22422db2ff
DIFF: https://github.com/llvm/llvm-project/commit/f237513cda8e6ec32579ff047b008e22422db2ff.diff

LOG: [LLDB] Add some declarations related to REPL support for mojo

This simple diff declares some enum values needed to create a REPL for the mojo language.

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

Added: 
    lldb/source/Expression/ExpressionTypeSystemHelper.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.cpp

Modified: 
    lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h
    lldb/include/lldb/Expression/ExpressionVariable.h
    lldb/include/lldb/Expression/REPL.h
    lldb/source/Expression/CMakeLists.txt
    lldb/source/Expression/ExpressionVariable.cpp
    lldb/source/Expression/REPL.cpp
    lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
    lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
    lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
    lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
    lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
    lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
    lldb/source/Plugins/REPL/Clang/ClangREPL.cpp
    lldb/source/Plugins/REPL/Clang/ClangREPL.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h b/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h
index 2ba675db86623..72b9ccbf7dd0c 100644
--- a/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h
+++ b/lldb/include/lldb/Expression/ExpressionTypeSystemHelper.h
@@ -11,35 +11,25 @@
 #define LLDB_EXPRESSION_EXPRESSIONTYPESYSTEMHELPER_H
 
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/ExtensibleRTTI.h"
 
 namespace lldb_private {
 
 /// \class ExpressionTypeSystemHelper ExpressionTypeSystemHelper.h
 /// "lldb/Expression/ExpressionTypeSystemHelper.h"
 /// A helper object that the Expression can pass to its ExpressionParser
-/// to provide generic information that
-/// any type of expression will need to supply.  It's only job is to support
-/// dyn_cast so that the expression parser can cast it back to the requisite
-/// specific type.
+/// to provide generic information that any type of expression will need to
+/// supply.  It's only job is to support dyn_cast so that the expression parser
+/// can cast it back to the requisite specific type.
 ///
 
-class ExpressionTypeSystemHelper {
+class ExpressionTypeSystemHelper
+    : public llvm::RTTIExtends<ExpressionTypeSystemHelper, llvm::RTTIRoot> {
 public:
-  enum LLVMCastKind {
-    eKindClangHelper,
-    eKindSwiftHelper,
-    eKindGoHelper,
-    kNumKinds
-  };
+  /// LLVM RTTI support
+  static char ID;
 
-  LLVMCastKind getKind() const { return m_kind; }
-
-  ExpressionTypeSystemHelper(LLVMCastKind kind) : m_kind(kind) {}
-
-  ~ExpressionTypeSystemHelper() = default;
-
-protected:
-  LLVMCastKind m_kind;
+  virtual ~ExpressionTypeSystemHelper() = default;
 };
 
 } // namespace lldb_private

diff  --git a/lldb/include/lldb/Expression/ExpressionVariable.h b/lldb/include/lldb/Expression/ExpressionVariable.h
index ec18acb94417c..ad85a21df5115 100644
--- a/lldb/include/lldb/Expression/ExpressionVariable.h
+++ b/lldb/include/lldb/Expression/ExpressionVariable.h
@@ -18,19 +18,20 @@
 #include "lldb/Core/ValueObject.h"
 #include "lldb/Utility/ConstString.h"
 #include "lldb/lldb-public.h"
+#include "llvm/Support/ExtensibleRTTI.h"
 
 namespace lldb_private {
 
 class ExpressionVariable
-    : public std::enable_shared_from_this<ExpressionVariable> {
+    : public std::enable_shared_from_this<ExpressionVariable>,
+      public llvm::RTTIExtends<ExpressionVariable, llvm::RTTIRoot> {
 public:
-  // See TypeSystem.h for how to add subclasses to this.
-  enum LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds };
+  /// LLVM RTTI support
+  static char ID;
 
-  LLVMCastKind getKind() const { return m_kind; }
+  ExpressionVariable();
 
-  ExpressionVariable(LLVMCastKind kind);
-  virtual ~ExpressionVariable();
+  virtual ~ExpressionVariable() = default;
 
   std::optional<uint64_t> GetByteSize() { return m_frozen_sp->GetByteSize(); }
 
@@ -109,7 +110,6 @@ class ExpressionVariable
   // these should be private
   lldb::ValueObjectSP m_frozen_sp;
   lldb::ValueObjectSP m_live_sp;
-  LLVMCastKind m_kind;
 };
 
 /// \class ExpressionVariableList ExpressionVariable.h
@@ -200,14 +200,13 @@ class ExpressionVariableList {
   std::vector<lldb::ExpressionVariableSP> m_variables;
 };
 
-class PersistentExpressionState : public ExpressionVariableList {
+class PersistentExpressionState
+    : public ExpressionVariableList,
+      public llvm::RTTIExtends<PersistentExpressionState, llvm::RTTIRoot> {
 public:
-  // See TypeSystem.h for how to add subclasses to this.
-  enum LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds };
+  /// LLVM RTTI support
+  static char ID;
 
-  LLVMCastKind getKind() const { return m_kind; }
-
-  PersistentExpressionState(LLVMCastKind kind);
   virtual ~PersistentExpressionState();
 
   virtual lldb::ExpressionVariableSP
@@ -237,8 +236,6 @@ class PersistentExpressionState : public ExpressionVariableList {
   GetPersistentVariablePrefix(bool is_error = false) const = 0;
 
 private:
-  LLVMCastKind m_kind;
-
   typedef std::set<lldb::IRExecutionUnitSP> ExecutionUnitSet;
   ExecutionUnitSet
       m_execution_units; ///< The execution units that contain valuable symbols.

diff  --git a/lldb/include/lldb/Expression/REPL.h b/lldb/include/lldb/Expression/REPL.h
index edfe7c0b341da..1438afdf872bf 100644
--- a/lldb/include/lldb/Expression/REPL.h
+++ b/lldb/include/lldb/Expression/REPL.h
@@ -15,17 +15,17 @@
 #include "lldb/Interpreter/OptionGroupFormat.h"
 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
 #include "lldb/Target/Target.h"
+#include "llvm/Support/ExtensibleRTTI.h"
 
 namespace lldb_private {
 
-class REPL : public IOHandlerDelegate {
+class REPL : public IOHandlerDelegate,
+             public llvm::RTTIExtends<REPL, llvm::RTTIRoot> {
 public:
-  // See TypeSystem.h for how to add subclasses to this.
-  enum LLVMCastKind { eKindClang, eKindSwift, eKindGo, kNumKinds };
+  /// LLVM RTTI support
+  static char ID;
 
-  LLVMCastKind getKind() const { return m_kind; }
-
-  REPL(LLVMCastKind kind, Target &target);
+  REPL(Target &target);
 
   ~REPL() override;
 
@@ -168,7 +168,6 @@ class REPL : public IOHandlerDelegate {
 
   Target &m_target;
   lldb::IOHandlerSP m_io_handler_sp;
-  LLVMCastKind m_kind;
 
 private:
   std::string GetSourcePath();

diff  --git a/lldb/source/Expression/CMakeLists.txt b/lldb/source/Expression/CMakeLists.txt
index edf67627374ca..9ba5fefc09b6a 100644
--- a/lldb/source/Expression/CMakeLists.txt
+++ b/lldb/source/Expression/CMakeLists.txt
@@ -3,6 +3,7 @@ add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES
   DWARFExpression.cpp
   DWARFExpressionList.cpp
   Expression.cpp
+  ExpressionTypeSystemHelper.cpp
   ExpressionVariable.cpp
   FunctionCaller.cpp
   IRExecutionUnit.cpp

diff  --git a/lldb/source/Expression/ExpressionTypeSystemHelper.cpp b/lldb/source/Expression/ExpressionTypeSystemHelper.cpp
new file mode 100644
index 0000000000000..dbac376f5f1c0
--- /dev/null
+++ b/lldb/source/Expression/ExpressionTypeSystemHelper.cpp
@@ -0,0 +1,13 @@
+//===-- ExpressionTypeSystemHelper.cpp ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Expression/ExpressionTypeSystemHelper.h"
+
+using namespace lldb_private;
+
+char ExpressionTypeSystemHelper::ID;

diff  --git a/lldb/source/Expression/ExpressionVariable.cpp b/lldb/source/Expression/ExpressionVariable.cpp
index 325dd5bc8a2ad..44ab1c2d0b436 100644
--- a/lldb/source/Expression/ExpressionVariable.cpp
+++ b/lldb/source/Expression/ExpressionVariable.cpp
@@ -15,9 +15,9 @@
 
 using namespace lldb_private;
 
-ExpressionVariable::ExpressionVariable(LLVMCastKind kind)
-    : m_flags(0), m_kind(kind) {}
-ExpressionVariable::~ExpressionVariable() = default;
+char ExpressionVariable::ID;
+
+ExpressionVariable::ExpressionVariable() : m_flags(0) {}
 
 uint8_t *ExpressionVariable::GetValueBytes() {
   std::optional<uint64_t> byte_size = m_frozen_sp->GetByteSize();
@@ -32,8 +32,8 @@ uint8_t *ExpressionVariable::GetValueBytes() {
   return nullptr;
 }
 
-PersistentExpressionState::PersistentExpressionState(LLVMCastKind kind)
-    : m_kind(kind) {}
+char PersistentExpressionState::ID;
+
 PersistentExpressionState::~PersistentExpressionState() = default;
 
 lldb::addr_t PersistentExpressionState::LookupSymbol(ConstString name) {

diff  --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp
index 31c9978b24226..e98ab1e575032 100644
--- a/lldb/source/Expression/REPL.cpp
+++ b/lldb/source/Expression/REPL.cpp
@@ -22,7 +22,9 @@
 
 using namespace lldb_private;
 
-REPL::REPL(LLVMCastKind kind, Target &target) : m_target(target), m_kind(kind) {
+char REPL::ID;
+
+REPL::REPL(Target &target) : m_target(target) {
   // Make sure all option values have sane defaults
   Debugger &debugger = m_target.GetDebugger();
   debugger.SetShowProgress(false);

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
index 73a8c8ba07fa5..e0ae3922788eb 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -7,6 +7,7 @@ add_lldb_library(lldbPluginExpressionParserClang
   ClangASTSource.cpp
   ClangDeclVendor.cpp
   ClangExpressionDeclMap.cpp
+  ClangExpressionHelper.cpp
   ClangExpressionParser.cpp
   ClangExpressionSourceCode.cpp
   ClangExpressionUtil.cpp

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.cpp
new file mode 100644
index 0000000000000..97f9d17958fa6
--- /dev/null
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.cpp
@@ -0,0 +1,13 @@
+//===-- ClangExpressionHelper.cpp -----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "ClangExpressionHelper.h"
+
+using namespace lldb_private;
+
+char ClangExpressionHelper::ID;

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h
index 37bcaf000cfcd..41e62ae72f6ca 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h
@@ -27,18 +27,12 @@ class ClangExpressionDeclMap;
 class RecordingMemoryManager;
 
 // ClangExpressionHelper
-class ClangExpressionHelper : public ExpressionTypeSystemHelper {
+class ClangExpressionHelper
+    : public llvm::RTTIExtends<ClangExpressionHelper,
+                               ExpressionTypeSystemHelper> {
 public:
-  static bool classof(const ExpressionTypeSystemHelper *ts) {
-    return ts->getKind() == eKindClangHelper;
-  }
-
-  ClangExpressionHelper()
-      : ExpressionTypeSystemHelper(
-            ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper) {}
-
-  /// Destructor
-  virtual ~ClangExpressionHelper() = default;
+  // LLVM RTTI support
+  static char ID;
 
   /// Return the object that the parser should use when resolving external
   /// values.  May be NULL if everything should be self-contained.
@@ -54,8 +48,6 @@ class ClangExpressionHelper : public ExpressionTypeSystemHelper {
   ASTTransformer(clang::ASTConsumer *passthrough) = 0;
 
   virtual void CommitPersistentDecls() {}
-
-protected:
 };
 
 } // namespace lldb_private

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
index 9af92e194da99..ac3cb0b1bdf31 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
@@ -20,11 +20,12 @@
 using namespace lldb_private;
 using namespace clang;
 
+char ClangExpressionVariable::ID;
+
 ClangExpressionVariable::ClangExpressionVariable(
     ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order,
     uint32_t addr_byte_size)
-    : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
-      m_jit_vars() {
+    : m_parser_vars(), m_jit_vars() {
   m_flags = EVNone;
   m_frozen_sp =
       ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);
@@ -33,16 +34,14 @@ ClangExpressionVariable::ClangExpressionVariable(
 ClangExpressionVariable::ClangExpressionVariable(
     ExecutionContextScope *exe_scope, Value &value, ConstString name,
     uint16_t flags)
-    : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
-      m_jit_vars() {
+    : m_parser_vars(), m_jit_vars() {
   m_flags = flags;
   m_frozen_sp = ValueObjectConstResult::Create(exe_scope, value, name);
 }
 
 ClangExpressionVariable::ClangExpressionVariable(
     const lldb::ValueObjectSP &valobj_sp)
-    : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
-      m_jit_vars() {
+    : m_parser_vars(), m_jit_vars() {
   m_flags = EVNone;
   m_frozen_sp = valobj_sp;
 }
@@ -51,8 +50,7 @@ ClangExpressionVariable::ClangExpressionVariable(
     ExecutionContextScope *exe_scope, ConstString name,
     const TypeFromUser &user_type, lldb::ByteOrder byte_order,
     uint32_t addr_byte_size)
-    : ExpressionVariable(LLVMCastKind::eKindClang), m_parser_vars(),
-      m_jit_vars() {
+    : m_parser_vars(), m_jit_vars() {
   m_flags = EVNone;
   m_frozen_sp =
       ValueObjectConstResult::Create(exe_scope, byte_order, addr_byte_size);

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
index c7d9e05269fa3..193ada018fa48 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
@@ -57,8 +57,12 @@ class ValueObjectConstResult;
 ///
 /// This class supports all of these use cases using simple type polymorphism,
 /// and provides necessary support methods.  Its interface is RTTI-neutral.
-class ClangExpressionVariable : public ExpressionVariable {
+class ClangExpressionVariable
+    : public llvm::RTTIExtends<ClangExpressionVariable, ExpressionVariable> {
 public:
+  // LLVM RTTI support
+  static char ID;
+
   ClangExpressionVariable(ExecutionContextScope *exe_scope,
                           lldb::ByteOrder byte_order, uint32_t addr_byte_size);
 
@@ -197,11 +201,6 @@ class ClangExpressionVariable : public ExpressionVariable {
 
   TypeFromUser GetTypeFromUser();
 
-  // llvm casting support
-  static bool classof(const ExpressionVariable *ev) {
-    return ev->getKind() == ExpressionVariable::eKindClang;
-  }
-
   /// Members
   ClangExpressionVariable(const ClangExpressionVariable &) = delete;
   const ClangExpressionVariable &

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
index 0b1eeb1fdb680..5235cd2a14617 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
@@ -207,6 +207,8 @@ ClangFunctionCaller::CompileFunction(lldb::ThreadSP thread_to_use_sp,
   return num_errors;
 }
 
+char ClangFunctionCaller::ClangFunctionCallerHelper::ID;
+
 clang::ASTConsumer *
 ClangFunctionCaller::ClangFunctionCallerHelper::ASTTransformer(
     clang::ASTConsumer *passthrough) {

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
index 151935b0ce68f..2a5c863b51a2f 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
@@ -57,11 +57,14 @@ class ASTStructExtractor;
 class ClangFunctionCaller : public FunctionCaller {
   friend class ASTStructExtractor;
 
-  class ClangFunctionCallerHelper : public ClangExpressionHelper {
+  class ClangFunctionCallerHelper
+      : public llvm::RTTIExtends<ClangFunctionCallerHelper,
+                                 ClangExpressionHelper> {
   public:
-    ClangFunctionCallerHelper(ClangFunctionCaller &owner) : m_owner(owner) {}
+    // LLVM RTTI support
+    static char ID;
 
-    ~ClangFunctionCallerHelper() override = default;
+    ClangFunctionCallerHelper(ClangFunctionCaller &owner) : m_owner(owner) {}
 
     /// Return the object that the parser should use when resolving external
     /// values.  May be NULL if everything should be self-contained.

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index a7b20a5b6853b..aa0e6e37d63e0 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -26,10 +26,11 @@
 using namespace lldb;
 using namespace lldb_private;
 
+char ClangPersistentVariables::ID;
+
 ClangPersistentVariables::ClangPersistentVariables(
     std::shared_ptr<Target> target_sp)
-    : lldb_private::PersistentExpressionState(LLVMCastKind::eKindClang),
-      m_target_sp(target_sp) {}
+    : m_target_sp(target_sp) {}
 
 ExpressionVariableSP ClangPersistentVariables::CreatePersistentVariable(
     const lldb::ValueObjectSP &valobj_sp) {

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
index 1ea4125077fa0..abeb431ccc08b 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
@@ -31,17 +31,17 @@ class TypeSystemClang;
 /// A list of variables that can be accessed and updated by any expression.  See
 /// ClangPersistentVariable for more discussion.  Also provides an increasing,
 /// 0-based counter for naming result variables.
-class ClangPersistentVariables : public PersistentExpressionState {
+class ClangPersistentVariables
+    : public llvm::RTTIExtends<ClangPersistentVariables,
+                               PersistentExpressionState> {
 public:
+  // LLVM RTTI support
+  static char ID;
+
   ClangPersistentVariables(std::shared_ptr<Target> target_sp);
 
   ~ClangPersistentVariables() override = default;
 
-  // llvm casting support
-  static bool classof(const PersistentExpressionState *pv) {
-    return pv->getKind() == PersistentExpressionState::eKindClang;
-  }
-
   std::shared_ptr<ClangASTImporter> GetClangASTImporter();
   std::shared_ptr<ClangModulesDeclVendor> GetClangModulesDeclVendor();
 

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 3399f423f8fc0..812a5d7392232 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -981,6 +981,8 @@ lldb::ExpressionVariableSP ClangUserExpression::GetResultAfterDematerialization(
   return m_result_delegate.GetVariable();
 }
 
+char ClangUserExpression::ClangUserExpressionHelper::ID;
+
 void ClangUserExpression::ClangUserExpressionHelper::ResetDeclMap(
     ExecutionContext &exe_ctx,
     Materializer::PersistentVariableDelegate &delegate,

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
index f05624c6119bf..0fbeff7f61431 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -51,13 +51,16 @@ class ClangUserExpression : public LLVMUserExpression {
 
   enum { kDefaultTimeout = 500000u };
 
-  class ClangUserExpressionHelper : public ClangExpressionHelper {
+  class ClangUserExpressionHelper
+      : public llvm::RTTIExtends<ClangUserExpressionHelper,
+                                 ClangExpressionHelper> {
   public:
+    // LLVM RTTI support
+    static char ID;
+
     ClangUserExpressionHelper(Target &target, bool top_level)
         : m_target(target), m_top_level(top_level) {}
 
-    ~ClangUserExpressionHelper() override = default;
-
     /// Return the object that the parser should use when resolving external
     /// values.  May be NULL if everything should be self-contained.
     ClangExpressionDeclMap *DeclMap() override {

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
index 66493aa3e5921..371605d427ad0 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -176,6 +176,8 @@ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager,
   }
 }
 
+char ClangUtilityFunction::ClangUtilityFunctionHelper::ID;
+
 void ClangUtilityFunction::ClangUtilityFunctionHelper::ResetDeclMap(
     ExecutionContext &exe_ctx, bool keep_result_in_memory) {
   std::shared_ptr<ClangASTImporter> ast_importer;

diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
index b8a154b3baed8..72ff84f3ceaf7 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
@@ -72,11 +72,12 @@ class ClangUtilityFunction : public UtilityFunction {
                ExecutionContext &exe_ctx) override;
 
 private:
-  class ClangUtilityFunctionHelper : public ClangExpressionHelper {
+  class ClangUtilityFunctionHelper
+      : public llvm::RTTIExtends<ClangUtilityFunctionHelper,
+                                 ClangExpressionHelper> {
   public:
-    ClangUtilityFunctionHelper() = default;
-
-    ~ClangUtilityFunctionHelper() override = default;
+    // LLVM RTTI support
+    static char ID;
 
     /// Return the object that the parser should use when resolving external
     /// values.  May be NULL if everything should be self-contained.

diff  --git a/lldb/source/Plugins/REPL/Clang/ClangREPL.cpp b/lldb/source/Plugins/REPL/Clang/ClangREPL.cpp
index 2bd38f81786bb..36d8ffe74f7c5 100644
--- a/lldb/source/Plugins/REPL/Clang/ClangREPL.cpp
+++ b/lldb/source/Plugins/REPL/Clang/ClangREPL.cpp
@@ -15,8 +15,10 @@ using namespace lldb_private;
 
 LLDB_PLUGIN_DEFINE(ClangREPL)
 
+char ClangREPL::ID;
+
 ClangREPL::ClangREPL(lldb::LanguageType language, Target &target)
-    : REPL(eKindClang, target), m_language(language),
+    : llvm::RTTIExtends<ClangREPL, REPL>(target), m_language(language),
       m_implicit_expr_result_regex("\\$[0-9]+") {}
 
 ClangREPL::~ClangREPL() = default;

diff  --git a/lldb/source/Plugins/REPL/Clang/ClangREPL.h b/lldb/source/Plugins/REPL/Clang/ClangREPL.h
index 07b7f73b1fafb..46dcd676ef7ee 100644
--- a/lldb/source/Plugins/REPL/Clang/ClangREPL.h
+++ b/lldb/source/Plugins/REPL/Clang/ClangREPL.h
@@ -14,8 +14,11 @@
 namespace lldb_private {
 /// Implements a Clang-based REPL for C languages on top of LLDB's REPL
 /// framework.
-class ClangREPL : public REPL {
+class ClangREPL : public llvm::RTTIExtends<ClangREPL, REPL> {
 public:
+  // LLVM RTTI support
+  static char ID;
+
   ClangREPL(lldb::LanguageType language, Target &target);
 
   ~ClangREPL() override;


        


More information about the lldb-commits mailing list