diff options
author | Kazu Hirata <kazu@google.com> | 2025-01-29 07:48:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-29 07:48:25 -0800 |
commit | 7ab8f286b8e43a98dc5c0404f80d719c49446875 (patch) | |
tree | 7ced3d278d9b606535b2f48d0a56c3d73d40a627 | |
parent | c583df46d404507f62c605b6f96cde22dcd9e948 (diff) | |
download | llvm-7ab8f286b8e43a98dc5c0404f80d719c49446875.zip llvm-7ab8f286b8e43a98dc5c0404f80d719c49446875.tar.gz llvm-7ab8f286b8e43a98dc5c0404f80d719c49446875.tar.bz2 |
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#124883)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa<T>, cast<T> and the llvm::dyn_cast<T>
This patch migrates the use of PointerUnion::dyn_cast to
dyn_cast_if_present because ShadowMapEntry::Add starts with:
if (DeclOrVector.isNull()) {
implying that DeclOrVector is not guaranteed to be nonnull.
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index bc0f6a9..f10f7f4 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -137,7 +137,7 @@ private: ~ShadowMapEntry() { if (DeclIndexPairVector *Vec = - DeclOrVector.dyn_cast<DeclIndexPairVector *>()) { + dyn_cast_if_present<DeclIndexPairVector *>(DeclOrVector)) { delete Vec; DeclOrVector = ((NamedDecl *)nullptr); } |