diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-01 21:04:24 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-01 21:46:32 -0700 |
commit | 9c48aa68f455a63fc5e20e196d3c3e8822bfa6af (patch) | |
tree | 00e435408f19ee5db36ca242536247370f7f1d0e /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | 3b8bc83527910dc36c4d415256c43a84d213f322 (diff) | |
download | llvm-9c48aa68f455a63fc5e20e196d3c3e8822bfa6af.zip llvm-9c48aa68f455a63fc5e20e196d3c3e8822bfa6af.tar.gz llvm-9c48aa68f455a63fc5e20e196d3c3e8822bfa6af.tar.bz2 |
[lldb] Refactor OptionValueProperties to return a std::optional (NFC)
Similar to fdbe7c7faa54, refactor OptionValueProperties to return a
std::optional instead of taking a fail value. This allows the caller to
handle situations where there's no value, instead of being unable to
distinguish between the absence of a value and the value happening the
match the fail value. When a fail value is required,
std::optional::value_or() provides the same functionality.
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index bfea299..8ae1186 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -90,9 +90,9 @@ public: } llvm::Triple::EnvironmentType ABI() const { - return (llvm::Triple::EnvironmentType) - m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, ePropertyABI, llvm::Triple::UnknownEnvironment); + return (llvm::Triple::EnvironmentType)m_collection_sp + ->GetPropertyAtIndexAsEnumeration(nullptr, ePropertyABI) + .value_or(llvm::Triple::UnknownEnvironment); } OptionValueDictionary *ModuleABIMap() const { |