Skip to content

Commit 186d654

Browse files
[Index] Migrate away from PointerUnion::dyn_cast (NFC) (#124389)
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 DclInfo.DeclOrMacro to be nonnull.
1 parent c216081 commit 186d654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Index/FileIndexRecord.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void FileIndexRecord::removeHeaderGuardMacros() {
5555
void FileIndexRecord::print(llvm::raw_ostream &OS, SourceManager &SM) const {
5656
OS << "DECLS BEGIN ---\n";
5757
for (auto &DclInfo : Decls) {
58-
if (const auto *D = DclInfo.DeclOrMacro.dyn_cast<const Decl *>()) {
58+
if (const auto *D = dyn_cast<const Decl *>(DclInfo.DeclOrMacro)) {
5959
SourceLocation Loc = SM.getFileLoc(D->getLocation());
6060
PresumedLoc PLoc = SM.getPresumedLoc(Loc);
6161
OS << llvm::sys::path::filename(PLoc.getFilename()) << ':'

0 commit comments

Comments
 (0)