diff options
author | Kazu Hirata <kazu@google.com> | 2024-11-27 09:13:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-27 09:13:28 -0800 |
commit | 1e3e199ed9f214594e358eb0c7892cdedc703f7a (patch) | |
tree | 0f163d441f0132da378e14074f1f2383762b23ba /clang/lib/Sema/SemaDecl.cpp | |
parent | 2f02b5af6ecb973d3a7faad9b0daff22646e724d (diff) | |
download | llvm-1e3e199ed9f214594e358eb0c7892cdedc703f7a.zip llvm-1e3e199ed9f214594e358eb0c7892cdedc703f7a.tar.gz llvm-1e3e199ed9f214594e358eb0c7892cdedc703f7a.tar.bz2 |
[Sema] Migrate away from PointerUnion::{is,get} (NFC) (#117498)
Note that PointerUnion::{is,get} have 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>
I'm not touching PointerUnion::dyn_cast for now because it's a bit
complicated; we could blindly migrate it to dyn_cast_if_present, but
we should probably use dyn_cast when the operand is known to be
non-null.
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 74b0e5a..63897dd 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -17276,7 +17276,7 @@ Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, if (TypeSourceInfo *TI = EnumUnderlying.dyn_cast<TypeSourceInfo *>()) ED->setIntegerTypeSourceInfo(TI); else - ED->setIntegerType(QualType(EnumUnderlying.get<const Type *>(), 0)); + ED->setIntegerType(QualType(cast<const Type *>(EnumUnderlying), 0)); QualType EnumTy = ED->getIntegerType(); ED->setPromotionType(Context.isPromotableIntegerType(EnumTy) ? Context.getPromotedIntegerType(EnumTy) @@ -17909,7 +17909,7 @@ CreateNewDecl: if (TypeSourceInfo *TI = EnumUnderlying.dyn_cast<TypeSourceInfo*>()) ED->setIntegerTypeSourceInfo(TI); else - ED->setIntegerType(QualType(EnumUnderlying.get<const Type *>(), 0)); + ED->setIntegerType(QualType(cast<const Type *>(EnumUnderlying), 0)); QualType EnumTy = ED->getIntegerType(); ED->setPromotionType(Context.isPromotableIntegerType(EnumTy) ? Context.getPromotedIntegerType(EnumTy) @@ -19925,7 +19925,7 @@ static void CheckForDuplicateEnumValues(Sema &S, ArrayRef<Decl *> Elements, continue; } - ECDVector *Vec = Entry.get<ECDVector*>(); + ECDVector *Vec = cast<ECDVector *>(Entry); // Make sure constants are not added more than once. if (*Vec->begin() == ECD) continue; |