mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
use new llvm::Optional API
`getValue` -> `value` `getValueOr` -> `value_or` `hasValue` -> `has_value` `map` -> `transform` The old API will be deprecated in the rebranch. To avoid merge conflicts, use the new API already in the main branch. rdar://102362022
This commit is contained in:
@@ -398,8 +398,8 @@ class InheritedProtocolCollector {
|
||||
/// Helper to extract the `@available` attributes on a decl.
|
||||
static AvailableAttrList
|
||||
getAvailabilityAttrs(const Decl *D, Optional<AvailableAttrList> &cache) {
|
||||
if (cache.hasValue())
|
||||
return cache.getValue();
|
||||
if (cache.has_value())
|
||||
return cache.value();
|
||||
|
||||
cache.emplace();
|
||||
while (D) {
|
||||
@@ -417,7 +417,7 @@ class InheritedProtocolCollector {
|
||||
D = D->getDeclContext()->getAsDecl();
|
||||
}
|
||||
|
||||
return cache.getValue();
|
||||
return cache.value();
|
||||
}
|
||||
|
||||
static OriginallyDefinedInAttrList
|
||||
|
||||
Reference in New Issue
Block a user