diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-11-12 10:04:32 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-11-12 10:04:32 +0100 |
| commit | 52f3a2faf92c4d8efd0e626d52d5f64b7c5d468f (patch) | |
| tree | aab0cd053518d6dab7704fd4e3d7d72469bf8710 /lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h | |
| parent | 6cc853b416a2b0d0b435d145988c5d3b6faaa712 (diff) | |
| download | bcm5719-llvm-52f3a2faf92c4d8efd0e626d52d5f64b7c5d468f.tar.gz bcm5719-llvm-52f3a2faf92c4d8efd0e626d52d5f64b7c5d468f.zip | |
[lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable
Summary:
swift-lldb currently has to patch the ExpressionKind enum to add support for Swift expressions. If we implement LLVM's RTTI
with a static ID variable instead of a centralised enum we can drop that patch.
Reviewers: labath, davide
Reviewed By: labath
Subscribers: JDevlieghere, lldb-commits
Tags: #upstreaming_lldb_s_downstream_patches, #lldb
Differential Revision: https://reviews.llvm.org/D70070
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h index 70ebb2f3ad8..9efaa0254c3 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h @@ -33,11 +33,14 @@ namespace lldb_private { /// simply provide a way to push a function into the target for the debugger /// to call later on. class ClangUtilityFunction : public UtilityFunction { + // LLVM RTTI support + static char ID; + public: - /// LLVM-style RTTI support. - static bool classof(const Expression *E) { - return E->getKind() == eKindClangUtilityFunction; + bool isA(const void *ClassID) const override { + return ClassID == &ID || UtilityFunction::isA(ClassID); } + static bool classof(const Expression *obj) { return obj->isA(&ID); } class ClangUtilityFunctionHelper : public ClangExpressionHelper { public: |

