From d01c11df04ae45a3d5b08e69bb683c760bbddd54 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 12 Dec 2024 16:03:20 -0800 Subject: [clang] Migrate away from PointerUnion::{is,get} (NFC) (#119724) Note that PointerUnion::{is,get} have been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa, cast and the llvm::dyn_cast 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. --- clang/lib/Basic/FileManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/Basic/FileManager.cpp') diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index f44b5e4..f0b6f7b 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/lib/Basic/FileManager.cpp @@ -324,9 +324,9 @@ llvm::Expected FileManager::getFileRef(StringRef Filename, *SeenFileEntries .insert({Status.getName(), FileEntryRef::MapValue(*UFE, DirInfo)}) .first; - assert(Redirection.second->V.is() && + assert(isa(Redirection.second->V) && "filename redirected to a non-canonical filename?"); - assert(Redirection.second->V.get() == UFE && + assert(cast(Redirection.second->V) == UFE && "filename from getStatValue() refers to wrong file"); // Cache the redirection in the previously-inserted entry, still available @@ -400,7 +400,7 @@ FileEntryRef FileManager::getVirtualFileRef(StringRef Filename, off_t Size, FileEntryRef::MapValue Value = *NamedFileEnt.second; if (LLVM_LIKELY(isa(Value.V))) return FileEntryRef(NamedFileEnt); - return FileEntryRef(*Value.V.get()); + return FileEntryRef(*cast(Value.V)); } // We've not seen this before, or the file is cached as non-existent. @@ -620,7 +620,7 @@ void FileManager::GetUniqueIDMapping( for (const auto &Entry : SeenFileEntries) { // Only return files that exist and are not redirected. - if (!Entry.getValue() || !Entry.getValue()->V.is()) + if (!Entry.getValue() || !isa(Entry.getValue()->V)) continue; FileEntryRef FE(Entry); // Add this file if it's the first one with the UID, or if its name is -- cgit v1.1