aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryLocation.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-11-25 10:32:21 -0800
committerKazu Hirata <kazu@google.com>2022-11-25 10:32:21 -0800
commit2a324cb261a86a1de4a16a392ac46783ab933e2f (patch)
tree0ecd9ce206aa921ae9f5c8f868bbb8f840824cf9 /llvm/lib/Analysis/MemoryLocation.cpp
parent68db72714f533676410e121ad87ecb15ace81a76 (diff)
downloadllvm-2a324cb261a86a1de4a16a392ac46783ab933e2f.zip
llvm-2a324cb261a86a1de4a16a392ac46783ab933e2f.tar.gz
llvm-2a324cb261a86a1de4a16a392ac46783ab933e2f.tar.bz2
[Analysis] Use std::optional in MemoryLocation.cpp (NFC)
This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'llvm/lib/Analysis/MemoryLocation.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryLocation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemoryLocation.cpp b/llvm/lib/Analysis/MemoryLocation.cpp
index 252eedb..fb23f0b 100644
--- a/llvm/lib/Analysis/MemoryLocation.cpp
+++ b/llvm/lib/Analysis/MemoryLocation.cpp
@@ -14,6 +14,7 @@
#include "llvm/IR/IntrinsicsARM.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
+#include <optional>
using namespace llvm;
void LocationSize::print(raw_ostream &OS) const {
@@ -126,7 +127,7 @@ MemoryLocation::getForDest(const CallBase *CB, const TargetLibraryInfo &TLI) {
return None;
Value *UsedV = nullptr;
- Optional<unsigned> UsedIdx;
+ std::optional<unsigned> UsedIdx;
for (unsigned i = 0; i < CB->arg_size(); i++) {
if (!CB->getArgOperand(i)->getType()->isPointerTy())
continue;