Skip to content

Commit fc43308

Browse files
[Serialization] Migrate away from PointerUnion::dyn_cast (NFC) (llvm#124884) (llvm#125024)
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 Subject to be nonnull.
1 parent 16e61df commit fc43308

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5359,7 +5359,7 @@ ASTWriter::WriteAST(llvm::PointerUnion<Sema *, Preprocessor *> Subject,
53595359
llvm::TimeTraceScope scope("WriteAST", OutputFile);
53605360
WritingAST = true;
53615361

5362-
Sema *SemaPtr = Subject.dyn_cast<Sema *>();
5362+
Sema *SemaPtr = dyn_cast<Sema *>(Subject);
53635363
Preprocessor &PPRef =
53645364
SemaPtr ? SemaPtr->getPreprocessor() : *cast<Preprocessor *>(Subject);
53655365

0 commit comments

Comments
 (0)