diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-07 14:18:35 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-07 14:18:35 -0800 |
commit | 2fe8327406050d2585d2ced910a678e28caefcf5 (patch) | |
tree | da95c78fa33c17cf7829bbe6f5e0bfa62e0579ae /lldb/source/Expression/Materializer.cpp | |
parent | f190ce625ab0dc5a5e2b2515e6d26debb34843ab (diff) | |
download | llvm-2fe8327406050d2585d2ced910a678e28caefcf5.zip llvm-2fe8327406050d2585d2ced910a678e28caefcf5.tar.gz llvm-2fe8327406050d2585d2ced910a678e28caefcf5.tar.bz2 |
[lldb] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.
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 'lldb/source/Expression/Materializer.cpp')
-rw-r--r-- | lldb/source/Expression/Materializer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index 13296cd..0932dc6 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -544,7 +544,7 @@ public: return; } - llvm::Optional<size_t> opt_bit_align = GetTypeBitAlign(scope); + std::optional<size_t> opt_bit_align = GetTypeBitAlign(scope); if (!opt_bit_align) { err.SetErrorStringWithFormat("can't get the type alignment for %s", GetName().AsCString()); @@ -775,7 +775,7 @@ private: /// /// \returns On success, returns byte size of the type associated /// with this variable. Returns std::nullopt otherwise. - virtual llvm::Optional<uint64_t> + virtual std::optional<uint64_t> GetByteSize(ExecutionContextScope *scope) const = 0; /// Returns 'true' if the location expression associated with this variable @@ -786,7 +786,7 @@ private: /// /// \returns On success, returns alignment in bits for the type associated /// with this variable. Returns std::nullopt otherwise. - virtual llvm::Optional<size_t> + virtual std::optional<size_t> GetTypeBitAlign(ExecutionContextScope *scope) const = 0; protected: @@ -816,7 +816,7 @@ public: return ValueObjectVariable::Create(scope, m_variable_sp); } - llvm::Optional<uint64_t> + std::optional<uint64_t> GetByteSize(ExecutionContextScope *scope) const override { return m_variable_sp->GetType()->GetByteSize(scope); } @@ -825,7 +825,7 @@ public: return m_variable_sp->LocationExpressionList().IsValid(); } - llvm::Optional<size_t> + std::optional<size_t> GetTypeBitAlign(ExecutionContextScope *scope) const override { return m_variable_sp->GetType()->GetLayoutCompilerType().GetTypeBitAlign( scope); @@ -859,7 +859,7 @@ public: return m_valobj_sp; } - llvm::Optional<uint64_t> + std::optional<uint64_t> GetByteSize(ExecutionContextScope *scope) const override { if (m_valobj_sp) return m_valobj_sp->GetCompilerType().GetByteSize(scope); @@ -874,7 +874,7 @@ public: return false; } - llvm::Optional<size_t> + std::optional<size_t> GetTypeBitAlign(ExecutionContextScope *scope) const override { if (m_valobj_sp) return m_valobj_sp->GetCompilerType().GetTypeBitAlign(scope); @@ -935,14 +935,14 @@ public: if (!exe_scope) exe_scope = map.GetBestExecutionContextScope(); - llvm::Optional<uint64_t> byte_size = m_type.GetByteSize(exe_scope); + std::optional<uint64_t> byte_size = m_type.GetByteSize(exe_scope); if (!byte_size) { err.SetErrorStringWithFormat("can't get size of type \"%s\"", m_type.GetTypeName().AsCString()); return; } - llvm::Optional<size_t> opt_bit_align = m_type.GetTypeBitAlign(exe_scope); + std::optional<size_t> opt_bit_align = m_type.GetTypeBitAlign(exe_scope); if (!opt_bit_align) { err.SetErrorStringWithFormat("can't get the alignment of type \"%s\"", m_type.GetTypeName().AsCString()); |