mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Cleanup and document SIL memory behavior APIs.
This is code that I am fairly familiar with but it still took a day of investigation to figure out how it is supposed to be used now in the presence of bridging. This primarily involved ruling out the possibity that the mid-level Swift APIs could at some point call into the lower-level C++ APIs. The biggest problem was that AliasAnalysis::getMemoryBehaviorOfInst() was declared as a public interface, and it's name indicates that it computes the memory behavior. But it is just a wrapper around a Swift API and never actually calls into any of the C++ logic that is responsible for computing memory behavior!
This commit is contained in:
@@ -711,7 +711,7 @@ void BridgedAliasAnalysis::registerAnalysis(GetMemEffectFn getMemEffectsFn,
|
||||
canReferenceSameFieldFunction = canReferenceSameFieldFn;
|
||||
}
|
||||
|
||||
MemoryBehavior AliasAnalysis::getMemoryBehaviorOfInst(
|
||||
MemoryBehavior AliasAnalysis::getMemoryEffectOnEscapedAddress(
|
||||
SILValue addr, SILInstruction *toInst) {
|
||||
if (getMemEffectsFunction) {
|
||||
return (MemoryBehavior)getMemEffectsFunction({PM->getSwiftPassInvocation()}, {addr},
|
||||
|
||||
Reference in New Issue
Block a user