aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-11-26 17:44:44 -0800
committerKazu Hirata <kazu@google.com>2022-11-26 17:44:44 -0800
commit12c80ef3f5c1ff7eacea23525829bbbdd86631de (patch)
tree7532cbfb83ce2c23717cb3b3d8bca63d3b91b963 /llvm/lib/Transforms/Utils/CloneFunction.cpp
parentd90a14f87d24119bde7b0cd18f2afa089c78b27e (diff)
downloadllvm-12c80ef3f5c1ff7eacea23525829bbbdd86631de.zip
llvm-12c80ef3f5c1ff7eacea23525829bbbdd86631de.tar.gz
llvm-12c80ef3f5c1ff7eacea23525829bbbdd86631de.tar.bz2
[Utils] Use std::optional in CloneFunction.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/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 78c27db..250528b 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -33,6 +33,7 @@
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#include <map>
+#include <optional>
using namespace llvm;
#define DEBUG_TYPE "clone-function"
@@ -136,7 +137,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
// duplicate instructions and then freeze them in the MD map. We also record
// information about dbg.value and dbg.declare to avoid duplicating the
// types.
- Optional<DebugInfoFinder> DIFinder;
+ std::optional<DebugInfoFinder> DIFinder;
// Track the subprogram attachment that needs to be cloned to fine-tune the
// mapping within the same module.