Skip to content

Commit c9df8da

Browse files
[Serialization] Migrate away from PointerUnion::get (NFC) (#120844)
Note that PointerUnion::get 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> 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.
1 parent 40acaa3 commit c9df8da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Serialization/MultiOnDiskHashTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ template<typename Info> class MultiOnDiskHashTable {
9393
using result_type = OnDiskTable *;
9494

9595
result_type operator()(void *P) const {
96-
return Table::getFromOpaqueValue(P).template get<OnDiskTable *>();
96+
return llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(P));
9797
}
9898
};
9999

@@ -130,7 +130,7 @@ template<typename Info> class MultiOnDiskHashTable {
130130
Files.insert(PendingOverrides.begin(), PendingOverrides.end());
131131
// Explicitly capture Files to work around an MSVC 2015 rejects-valid bug.
132132
auto ShouldRemove = [&Files](void *T) -> bool {
133-
auto *ODT = Table::getFromOpaqueValue(T).template get<OnDiskTable *>();
133+
auto *ODT = llvm::cast<OnDiskTable *>(Table::getFromOpaqueValue(T));
134134
bool Remove = Files.count(ODT->File);
135135
if (Remove)
136136
delete ODT;

0 commit comments

Comments
 (0)