[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
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user