diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-04 09:26:58 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2023-05-04 16:42:46 -0700 |
commit | 6f8b33f6dfd0a0f8d2522b6c832bd6298ae2f3f3 (patch) | |
tree | e0c6024fb6ebf5acf5617f1256ecaea28052e774 /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | 04aa943be8ed5c03092e2a90112ac638360ec253 (diff) | |
download | llvm-6f8b33f6dfd0a0f8d2522b6c832bd6298ae2f3f3.zip llvm-6f8b33f6dfd0a0f8d2522b6c832bd6298ae2f3f3.tar.gz llvm-6f8b33f6dfd0a0f8d2522b6c832bd6298ae2f3f3.tar.bz2 |
[lldb] Use templates to simplify {Get,Set}PropertyAtIndex (NFC)
Use templates to simplify {Get,Set}PropertyAtIndex. It has always
bothered me how cumbersome those calls are when adding new properties.
After this patch, SetPropertyAtIndex infers the type from its arguments
and GetPropertyAtIndex required a single template argument for the
return value. As an added benefit, this enables us to remove a bunch of
wrappers from UserSettingsController and OptionValueProperties.
Differential revision: https://reviews.llvm.org/D149774
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 97f40ae..1c166c03 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -90,9 +90,8 @@ public: } llvm::Triple::EnvironmentType ABI() const { - return (llvm::Triple::EnvironmentType)m_collection_sp - ->GetPropertyAtIndexAsEnumeration(ePropertyABI) - .value_or(llvm::Triple::UnknownEnvironment); + return GetPropertyAtIndexAs<llvm::Triple::EnvironmentType>( + ePropertyABI, llvm::Triple::UnknownEnvironment); } OptionValueDictionary *ModuleABIMap() const { |