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:
Erik Eckstein
2022-11-15 15:08:30 +01:00
parent 567b68aa6f
commit ab1b343dad
328 changed files with 1537 additions and 1536 deletions

View File

@@ -295,13 +295,13 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
llvm::raw_svector_ostream OS(Text);
AnnotatingPrinter Printer(Info, OS);
if (!Group && InterestedUSR) {
Group = findGroupNameForUSR(Mod, InterestedUSR.getValue());
Group = findGroupNameForUSR(Mod, InterestedUSR.value());
}
printModuleInterface(Mod, Group.hasValue()
? llvm::makeArrayRef(Group.getValue())
printModuleInterface(Mod, Group.has_value()
? llvm::makeArrayRef(Group.value())
: ArrayRef<StringRef>(),
TraversalOptions, Printer, Options,
Group.hasValue() && SynthesizedExtensions);
Group.has_value() && SynthesizedExtensions);
Info.Text = std::string(OS.str());
return false;
@@ -787,9 +787,9 @@ void SwiftLangSupport::editorOpenHeaderInterface(EditorConsumer &Consumer,
if (!swiftVersion.empty()) {
auto swiftVer =
VersionParser::parseVersionString(swiftVersion, SourceLoc(), nullptr);
if (swiftVer.hasValue())
if (swiftVer.has_value())
Invocation.getLangOptions().EffectiveLanguageVersion =
swiftVer.getValue();
swiftVer.value();
}
auto IFaceGenRef = SwiftInterfaceGenContext::create(Name,
/*IsModule=*/false,