mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/master' into master-next
This commit is contained in:
@@ -1907,6 +1907,17 @@ public:
|
||||
SILValue getSource() const {
|
||||
return getOperand();
|
||||
}
|
||||
|
||||
private:
|
||||
/// Predicate used to filter EndAccessRange.
|
||||
struct UseToEndAccess;
|
||||
|
||||
public:
|
||||
using EndAccessRange =
|
||||
OptionalTransformRange<use_range, UseToEndAccess, use_iterator>;
|
||||
|
||||
/// Find all the associated end_access instructions for this begin_access.
|
||||
EndAccessRange getEndAccesses() const;
|
||||
};
|
||||
|
||||
/// Represents the end of an access scope.
|
||||
@@ -1944,6 +1955,20 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct BeginAccessInst::UseToEndAccess {
|
||||
Optional<EndAccessInst *> operator()(Operand *use) const {
|
||||
if (auto access = dyn_cast<EndAccessInst>(use->getUser())) {
|
||||
return access;
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
inline auto BeginAccessInst::getEndAccesses() const -> EndAccessRange {
|
||||
return EndAccessRange(getUses(), UseToEndAccess());
|
||||
}
|
||||
|
||||
/// AssignInst - Represents an abstract assignment to a memory location, which
|
||||
/// may either be an initialization or a store sequence. This is only valid in
|
||||
/// Raw SIL.
|
||||
|
||||
@@ -54,6 +54,8 @@ PASS(AADumper, "aa-dump",
|
||||
"Dump Alias Analysis over all Pairs")
|
||||
PASS(ABCOpt, "abcopts",
|
||||
"Array Bounds Check Optimization")
|
||||
PASS(AccessEnforcementSelection, "access-enforcement-selection",
|
||||
"Access Enforcement Selection")
|
||||
PASS(AccessMarkerElimination, "access-marker-elim",
|
||||
"Access Marker Elimination.")
|
||||
PASS(AddressLowering, "address-lowering",
|
||||
|
||||
Reference in New Issue
Block a user