diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-12-15 16:09:20 +0100 |
---|---|---|
committer | Raphael Isemann <risemann@apple.com> | 2019-12-15 18:11:01 +0100 |
commit | aa4558497ff6301881adf38960dd2f4d95aa8fc5 (patch) | |
tree | 29b444fb2a5b3d00c022bff968a7c0ff2cb52cc7 /clang/lib/Sema/Sema.cpp | |
parent | fd7dca98373cee7d379644d6d6e5c163d15107b7 (diff) | |
download | bcm5719-llvm-aa4558497ff6301881adf38960dd2f4d95aa8fc5.tar.gz bcm5719-llvm-aa4558497ff6301881adf38960dd2f4d95aa8fc5.zip |
[clang] Improve LLVM-style RTTI support in ExternalASTSource/ExternalSemaSource
Summary:
We currently have some very basic LLVM-style RTTI support in the ExternalASTSource class hierarchy
based on the `SemaSource` bool( to discriminate it form the ExternalSemaSource). As ExternalASTSource
is supposed to be subclassed we should have extendable LLVM-style RTTI in this class hierarchy to make life easier
for projects building on top of Clang.
Most notably the current RTTI implementation forces LLDB to implement RTTI for its
own ExternalASTSource class (ClangExternalASTSourceCommon) by keeping a global set of
ExternalASTSources that are known to be ClangExternalASTSourceCommon. Projects
using Clang currently have to dosimilar workarounds to get RTTI support for their subclasses.
This patch turns this into full-fledged LLVM-style RTTI based on a static `ID` variable similar to
other LLVM class hierarchies. Also removes the friend declaration from ExternalASTSource to
its child class that was only used to grant access to the `SemaSource` member.
Reviewers: aprantl, dblaikie, rjmccall
Reviewed By: aprantl
Subscribers: riccibruno, labath, lhames, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71397
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index c5bf6fea3f3..2cd158a8b43 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1917,6 +1917,7 @@ void Sema::ActOnComment(SourceRange Comment) { // Pin this vtable to this file. ExternalSemaSource::~ExternalSemaSource() {} +char ExternalSemaSource::ID; void ExternalSemaSource::ReadMethodPool(Selector Sel) { } void ExternalSemaSource::updateOutOfDateSelector(Selector Sel) { } |