aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-03 16:01:15 -0600
committerKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-04 11:52:02 -0600
commit0ca43d44888885d6caf7636db91fe810e822263c (patch)
tree1b8e5ee0f5ae8e0163d551a99fcfccd33aa27456 /llvm/lib/CodeGen/LiveDebugVariables.cpp
parentfcf4e360ba6b5f005d2c478ca79112be7a61dacb (diff)
downloadllvm-0ca43d44888885d6caf7636db91fe810e822263c.zip
llvm-0ca43d44888885d6caf7636db91fe810e822263c.tar.gz
llvm-0ca43d44888885d6caf7636db91fe810e822263c.tar.bz2
DebugInfoMetadata: convert Optional to std::optional
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugVariables.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp
index f514f40..4db941e 100644
--- a/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -59,6 +59,7 @@
#include <cassert>
#include <iterator>
#include <memory>
+#include <optional>
#include <utility>
using namespace llvm;
@@ -286,7 +287,7 @@ class LDVImpl;
class UserValue {
const DILocalVariable *Variable; ///< The debug info variable we are part of.
/// The part of the variable we describe.
- const Optional<DIExpression::FragmentInfo> Fragment;
+ const std::optional<DIExpression::FragmentInfo> Fragment;
DebugLoc dl; ///< The debug location for the variable. This is
///< used by dwarf writer to find lexical scope.
UserValue *leader; ///< Equivalence class leader.
@@ -319,7 +320,7 @@ class UserValue {
public:
/// Create a new UserValue.
UserValue(const DILocalVariable *var,
- Optional<DIExpression::FragmentInfo> Fragment, DebugLoc L,
+ std::optional<DIExpression::FragmentInfo> Fragment, DebugLoc L,
LocMap::Allocator &alloc)
: Variable(var), Fragment(Fragment), dl(std::move(L)), leader(this),
locInts(alloc) {}
@@ -582,7 +583,7 @@ class LDVImpl {
/// Find or create a UserValue.
UserValue *getUserValue(const DILocalVariable *Var,
- Optional<DIExpression::FragmentInfo> Fragment,
+ std::optional<DIExpression::FragmentInfo> Fragment,
const DebugLoc &DL);
/// Find the EC leader for VirtReg or null.
@@ -768,9 +769,10 @@ void UserValue::mapVirtRegs(LDVImpl *LDV) {
LDV->mapVirtReg(locations[i].getReg(), this);
}
-UserValue *LDVImpl::getUserValue(const DILocalVariable *Var,
- Optional<DIExpression::FragmentInfo> Fragment,
- const DebugLoc &DL) {
+UserValue *
+LDVImpl::getUserValue(const DILocalVariable *Var,
+ std::optional<DIExpression::FragmentInfo> Fragment,
+ const DebugLoc &DL) {
// FIXME: Handle partially overlapping fragments. See
// https://reviews.llvm.org/D70121#1849741.
DebugVariable ID(Var, Fragment, DL->getInlinedAt());