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:
@@ -142,18 +142,18 @@ public:
|
||||
}
|
||||
|
||||
bool shouldContinuePre(const Decl *D, Optional<BracketOptions> Bracket) {
|
||||
assert(Bracket.hasValue());
|
||||
if (!Bracket.getValue().shouldOpenExtension(D) &&
|
||||
assert(Bracket.has_value());
|
||||
if (!Bracket.value().shouldOpenExtension(D) &&
|
||||
isa<ExtensionDecl>(D))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool shouldContinuePost(const Decl *D, Optional<BracketOptions> Bracket) {
|
||||
assert(Bracket.hasValue());
|
||||
if (!Bracket.getValue().shouldCloseNominal(D) && isa<NominalTypeDecl>(D))
|
||||
assert(Bracket.has_value());
|
||||
if (!Bracket.value().shouldCloseNominal(D) && isa<NominalTypeDecl>(D))
|
||||
return false;
|
||||
if (!Bracket.getValue().shouldCloseExtension(D) &&
|
||||
if (!Bracket.value().shouldCloseExtension(D) &&
|
||||
isa<ExtensionDecl>(D))
|
||||
return false;
|
||||
return true;
|
||||
@@ -1492,7 +1492,7 @@ SourceFile *SwiftLangSupport::getSyntacticSourceFile(
|
||||
unsigned BufferID = ParseCI.getInputBufferIDs().back();
|
||||
for (auto Unit : ParseCI.getMainModule()->getFiles()) {
|
||||
if (auto Current = dyn_cast<SourceFile>(Unit)) {
|
||||
if (Current->getBufferID().getValue() == BufferID) {
|
||||
if (Current->getBufferID().value() == BufferID) {
|
||||
SF = Current;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user