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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user