mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't serialize derived function effects for function with @_semantics("optimize.no.crossmodule")
This commit is contained in:
@@ -488,9 +488,12 @@ void SILSerializer::writeSILFunction(const SILFunction &F, bool DeclOnly) {
|
|||||||
unsigned numAttrs = NoBody ? 0 : F.getSpecializeAttrs().size();
|
unsigned numAttrs = NoBody ? 0 : F.getSpecializeAttrs().size();
|
||||||
|
|
||||||
auto resilience = F.getModule().getSwiftModule()->getResilienceStrategy();
|
auto resilience = F.getModule().getSwiftModule()->getResilienceStrategy();
|
||||||
|
bool serializeDerivedEffects = (resilience != ResilienceStrategy::Resilient) &&
|
||||||
|
!F.hasSemanticsAttr("optimize.no.crossmodule");
|
||||||
|
|
||||||
F.visitArgEffects(
|
F.visitArgEffects(
|
||||||
[&](int effectIdx, int argumentIndex, bool isDerived) {
|
[&](int effectIdx, int argumentIndex, bool isDerived) {
|
||||||
if (isDerived && resilience == ResilienceStrategy::Resilient)
|
if (isDerived && !serializeDerivedEffects)
|
||||||
return;
|
return;
|
||||||
numAttrs++;
|
numAttrs++;
|
||||||
});
|
});
|
||||||
@@ -520,7 +523,7 @@ void SILSerializer::writeSILFunction(const SILFunction &F, bool DeclOnly) {
|
|||||||
|
|
||||||
F.visitArgEffects(
|
F.visitArgEffects(
|
||||||
[&](int effectIdx, int argumentIndex, bool isDerived) {
|
[&](int effectIdx, int argumentIndex, bool isDerived) {
|
||||||
if (isDerived && resilience == ResilienceStrategy::Resilient)
|
if (isDerived && !serializeDerivedEffects)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
llvm::SmallString<64> buffer;
|
llvm::SmallString<64> buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user