[PATCH] D133158: [NFC] Make MultiplexExternalSemaSource own sources
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 2 09:09:58 PDT 2022
aaron.ballman accepted this revision.
aaron.ballman added a comment.
LGTM aside from some minor nits (also, please run clang-format over the patch before landing).
================
Comment at: clang/lib/Sema/MultiplexExternalSemaSource.cpp:32
+MultiplexExternalSemaSource::~MultiplexExternalSemaSource() {
+ for (auto &S : Sources)
+ S->Release();
----------------
================
Comment at: clang/lib/Sema/Sema.cpp:548
- if (isMultiplexExternalSource)
- static_cast<MultiplexExternalSemaSource*>(ExternalSource)->addSource(*E);
- else {
- ExternalSource = new MultiplexExternalSemaSource(*ExternalSource, *E);
- isMultiplexExternalSource = true;
- }
+ if (auto Ex = dyn_cast<MultiplexExternalSemaSource>(ExternalSource))
+ Ex->AddSource(E);
----------------
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133158/new/
https://reviews.llvm.org/D133158
More information about the cfe-commits
mailing list