diff options
author | Shraiysh Vaishay <shraiysh@gmail.com> | 2023-04-15 21:16:16 -0500 |
---|---|---|
committer | Shraiysh Vaishay <shraiysh@gmail.com> | 2023-04-17 13:40:51 -0500 |
commit | 7021182d6b43de9488ab70de626192ce70b3a4a6 (patch) | |
tree | 193d14c63ce01bf680f9919b5cbb4b11a944de8b /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | 63395cb0b69dee69ec5d5d0d552482c607861178 (diff) | |
download | llvm-7021182d6b43de9488ab70de626192ce70b3a4a6.zip llvm-7021182d6b43de9488ab70de626192ce70b3a4a6.tar.gz llvm-7021182d6b43de9488ab70de626192ce70b3a4a6.tar.bz2 |
[nfc][llvm] Replace pointer cast functions in PointerUnion by llvm casting functions.
This patch replaces the uses of PointerUnion.is function by llvm::isa,
PointerUnion.get function by llvm::cast, and PointerUnion.dyn_cast by
llvm::dyn_cast_if_present. This is according to the FIXME in
the definition of the class PointerUnion.
This patch does not remove them as they are being used in other
subprojects.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D148449
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineOperand.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp index 5a43f69..63c5eb4 100644 --- a/llvm/lib/CodeGen/MachineOperand.cpp +++ b/llvm/lib/CodeGen/MachineOperand.cpp @@ -1027,10 +1027,10 @@ unsigned MachinePointerInfo::getAddrSpace() const { return AddrSpace; } /// Offset + Size byte. bool MachinePointerInfo::isDereferenceable(unsigned Size, LLVMContext &C, const DataLayout &DL) const { - if (!V.is<const Value *>()) + if (!isa<const Value *>(V)) return false; - const Value *BasePtr = V.get<const Value *>(); + const Value *BasePtr = cast<const Value *>(V); if (BasePtr == nullptr) return false; @@ -1075,8 +1075,8 @@ MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, Flags f, AtomicOrdering FailureOrdering) : PtrInfo(ptrinfo), MemoryType(type), FlagVals(f), BaseAlign(a), AAInfo(AAInfo), Ranges(Ranges) { - assert((PtrInfo.V.isNull() || PtrInfo.V.is<const PseudoSourceValue *>() || - isa<PointerType>(PtrInfo.V.get<const Value *>()->getType())) && + assert((PtrInfo.V.isNull() || isa<const PseudoSourceValue *>(PtrInfo.V) || + isa<PointerType>(cast<const Value *>(PtrInfo.V)->getType())) && "invalid pointer value"); assert((isLoad() || isStore()) && "Not a load/store!"); |