diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-11-27 10:27:25 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-11-27 10:28:02 +0100 |
| commit | 92d5ea5d1674c38e03d130c6b04afa118e94ef4a (patch) | |
| tree | 6485be1cd71dfba5f34ba7c2b4820bcd2ee4467f /lldb/include | |
| parent | e20a1e486e144c88188bc7b420885d5326b39088 (diff) | |
| download | bcm5719-llvm-92d5ea5d1674c38e03d130c6b04afa118e94ef4a.tar.gz bcm5719-llvm-92d5ea5d1674c38e03d130c6b04afa118e94ef4a.zip | |
[lldb][NFC] Move TypeSystem RTTI to static variable to remove swift reference
Diffstat (limited to 'lldb/include')
| -rw-r--r-- | lldb/include/lldb/Symbol/ClangASTContext.h | 8 | ||||
| -rw-r--r-- | lldb/include/lldb/Symbol/TypeSystem.h | 43 |
2 files changed, 8 insertions, 43 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index f4428c68218..20421bca305 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -41,15 +41,17 @@ namespace lldb_private { class Declaration; class ClangASTContext : public TypeSystem { + // LLVM RTTI support + static char ID; + public: typedef void (*CompleteTagDeclCallback)(void *baton, clang::TagDecl *); typedef void (*CompleteObjCInterfaceDeclCallback)(void *baton, clang::ObjCInterfaceDecl *); // llvm casting support - static bool classof(const TypeSystem *ts) { - return ts->getKind() == TypeSystem::eKindClang; - } + bool isA(const void *ClassID) const override { return ClassID == &ID; } + static bool classof(const TypeSystem *ts) { return ts->isA(&ID); } // Constructors and Destructors explicit ClangASTContext(llvm::StringRef triple = ""); diff --git a/lldb/include/lldb/Symbol/TypeSystem.h b/lldb/include/lldb/Symbol/TypeSystem.h index 6283d67baba..ea860647fdb 100644 --- a/lldb/include/lldb/Symbol/TypeSystem.h +++ b/lldb/include/lldb/Symbol/TypeSystem.h @@ -52,47 +52,11 @@ struct LanguageSet { /// Interface for representing the Type Systems in different languages. class TypeSystem : public PluginInterface { public: - // Intrusive type system that allows us to use llvm casting. - // - // To add a new type system: - // - // 1 - Add a new enumeration for llvm casting below for your TypeSystem - // subclass, here we will use eKindFoo - // - // 2 - Your TypeSystem subclass will inherit from TypeSystem and needs - // to implement a static classof() function that returns your - // enumeration: - // - // class Foo : public lldb_private::TypeSystem - // { - // static bool classof(const TypeSystem *ts) - // { - // return ts->getKind() == TypeSystem::eKindFoo; - // } - // }; - // - // 3 - Contruct your TypeSystem subclass with the enumeration from below - // - // Foo() : - // TypeSystem(TypeSystem::eKindFoo), - // ... - // { - // } - // - // Then you can use the llvm casting on any "TypeSystem *" to get an instance - // of your subclass. - enum LLVMCastKind { - eKindClang, - eKindSwift, - kNumKinds - }; - // Constructors and Destructors - TypeSystem(LLVMCastKind kind); - ~TypeSystem() override; - LLVMCastKind getKind() const { return m_kind; } + // LLVM RTTI support + virtual bool isA(const void *ClassID) const = 0; static lldb::TypeSystemSP CreateInstance(lldb::LanguageType language, Module *module); @@ -493,8 +457,7 @@ public: virtual bool IsMeaninglessWithoutDynamicResolution(void *type); protected: - const LLVMCastKind m_kind; // Support for llvm casting - SymbolFile *m_sym_file; + SymbolFile *m_sym_file = nullptr; }; class TypeSystemMap { |

