From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/Analysis/MemoryLocation.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'llvm/lib/Analysis/MemoryLocation.cpp') diff --git a/llvm/lib/Analysis/MemoryLocation.cpp b/llvm/lib/Analysis/MemoryLocation.cpp index 103cdea148e5..4c31d6786ed8 100644 --- a/llvm/lib/Analysis/MemoryLocation.cpp +++ b/llvm/lib/Analysis/MemoryLocation.cpp @@ -83,6 +83,23 @@ MemoryLocation MemoryLocation::get(const AtomicRMWInst *RMWI) { AATags); } +Optional MemoryLocation::getOrNone(const Instruction *Inst) { + switch (Inst->getOpcode()) { + case Instruction::Load: + return get(cast(Inst)); + case Instruction::Store: + return get(cast(Inst)); + case Instruction::VAArg: + return get(cast(Inst)); + case Instruction::AtomicCmpXchg: + return get(cast(Inst)); + case Instruction::AtomicRMW: + return get(cast(Inst)); + default: + return None; + } +} + MemoryLocation MemoryLocation::getForSource(const MemTransferInst *MTI) { return getForSource(cast(MTI)); } -- cgit v1.2.3