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

@@ -533,8 +533,8 @@ bool COWArrayOpt::checkSafeArrayValueUses(UserList &ArrayValueUsers) {
/// instruction is safe only if all of its users are safe. Check this
/// recursively.
auto results = isTransitiveSafeUser(UseInst);
if (results.hasValue()) {
for (auto result : results.getValue()) {
if (results.has_value()) {
for (auto result : results.value()) {
if (!std::all_of(result->use_begin(), result->use_end(),
[this](Operand *Op) -> bool {
return checkSafeArrayElementUse(Op->getUser(),
@@ -641,8 +641,8 @@ bool COWArrayOpt::checkSafeArrayElementUse(SILInstruction *UseInst,
// and return false if any of them are not transitive escape array element
// uses.
auto results = isTransitiveSafeUser(UseInst);
if (results.hasValue()) {
for (auto result : results.getValue()) {
if (results.has_value()) {
for (auto result : results.value()) {
if (!std::all_of(result->use_begin(), result->use_end(),
[this](Operand *Op) -> bool {
return checkSafeArrayElementUse(Op->getUser(),