mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -797,8 +797,8 @@ ASTProducerRef
|
||||
SwiftASTManager::Implementation::getASTProducer(SwiftInvocationRef InvokRef) {
|
||||
llvm::sys::ScopedLock L(CacheMtx);
|
||||
llvm::Optional<ASTProducerRef> OptProducer = ASTCache.get(InvokRef->Impl.Key);
|
||||
if (OptProducer.hasValue())
|
||||
return OptProducer.getValue();
|
||||
if (OptProducer.has_value())
|
||||
return OptProducer.value();
|
||||
ASTProducerRef Producer = std::make_shared<ASTProducer>(InvokRef);
|
||||
ASTCache.set(InvokRef->Impl.Key, Producer);
|
||||
return Producer;
|
||||
|
||||
Reference in New Issue
Block a user