aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-01-29 07:48:25 -0800
committerGitHub <noreply@github.com>2025-01-29 07:48:25 -0800
commit7ab8f286b8e43a98dc5c0404f80d719c49446875 (patch)
tree7ced3d278d9b606535b2f48d0a56c3d73d40a627
parentc583df46d404507f62c605b6f96cde22dcd9e948 (diff)
downloadllvm-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.cpp2
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);
}