Skip to content

Commit 113e1fd

Browse files
[CodeGen] Migrate away from PointerUnion::dyn_cast (NFC) (#124076)
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> Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect Pos to be nonnull.
1 parent e622468 commit 113e1fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4079,7 +4079,7 @@ static void emitDependData(CodeGenFunction &CGF, QualType &KmpDependInfoTy,
40794079
Size = llvm::ConstantInt::get(CGF.SizeTy, 0);
40804080
}
40814081
LValue Base;
4082-
if (unsigned *P = Pos.dyn_cast<unsigned *>()) {
4082+
if (unsigned *P = dyn_cast<unsigned *>(Pos)) {
40834083
Base = CGF.MakeAddrLValue(
40844084
CGF.Builder.CreateConstGEP(DependenciesArray, *P), KmpDependInfoTy);
40854085
} else {
@@ -4109,7 +4109,7 @@ static void emitDependData(CodeGenFunction &CGF, QualType &KmpDependInfoTy,
41094109
CGF.EmitStoreOfScalar(
41104110
llvm::ConstantInt::get(LLVMFlagsTy, static_cast<unsigned int>(DepKind)),
41114111
FlagsLVal);
4112-
if (unsigned *P = Pos.dyn_cast<unsigned *>()) {
4112+
if (unsigned *P = dyn_cast<unsigned *>(Pos)) {
41134113
++(*P);
41144114
} else {
41154115
LValue &PosLVal = *cast<LValue *>(Pos);

0 commit comments

Comments
 (0)