Skip to content

Commit ce2161e

Browse files
committed
[Autodiff] Fixes build issues on Linux
1 parent 74166a4 commit ce2161e

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ClosureSpecialization.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -881,12 +881,9 @@ private extension FunctionConvention {
881881

882882
private extension ParameterInfo {
883883
func withSpecializedConvention(isArgTypeTrivial: Bool) -> Self {
884-
let specializedParamConvention =
885-
if self.convention.isAllowedIndirectConvForClosureSpec {
886-
self.convention
887-
} else {
888-
isArgTypeTrivial ? ArgumentConvention.directUnowned : ArgumentConvention.directOwned
889-
}
884+
let specializedParamConvention = self.convention.isAllowedIndirectConvForClosureSpec
885+
? self.convention
886+
: isArgTypeTrivial ? ArgumentConvention.directUnowned : ArgumentConvention.directOwned
890887

891888
return ParameterInfo(type: self.type, convention: specializedParamConvention, options: self.options,
892889
hasLoweredAddresses: self.hasLoweredAddresses)

SwiftCompilerSources/Sources/Optimizer/Utilities/SpecializationCloner.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ struct SpecializationCloner {
3030

3131
var entryBlock: BasicBlock {
3232
if cloned.blocks.isEmpty {
33-
cloned.appendNewBlock(context)
33+
return cloned.appendNewBlock(context)
3434
} else {
35-
cloned.entryBlock
35+
return cloned.entryBlock
3636
}
3737
}
3838

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ struct BridgedCloner {
184184
struct BridgedSpecializationCloner {
185185
swift::ClosureSpecializationCloner * _Nonnull closureSpecCloner;
186186

187-
BridgedSpecializationCloner(BridgedFunction emptySpecializedFunction);
188-
BridgedFunction getCloned() const;
189-
BridgedBasicBlock getClonedBasicBlock(BridgedBasicBlock originalBasicBlock) const;
187+
SWIFT_IMPORT_UNSAFE BridgedSpecializationCloner(BridgedFunction emptySpecializedFunction);
188+
SWIFT_IMPORT_UNSAFE BridgedFunction getCloned() const;
189+
SWIFT_IMPORT_UNSAFE BridgedBasicBlock getClonedBasicBlock(BridgedBasicBlock originalBasicBlock) const;
190190
void cloneFunctionBody(BridgedFunction originalFunction, BridgedBasicBlock clonedEntryBlock, BridgedValueArray clonedEntryBlockArgs) const;
191191
};
192192

@@ -334,7 +334,7 @@ struct BridgedPassContext {
334334
BRIDGED_INLINE void beginTransformFunction(BridgedFunction function) const;
335335
BRIDGED_INLINE void endTransformFunction() const;
336336
BRIDGED_INLINE bool continueWithNextSubpassRun(OptionalBridgedInstruction inst) const;
337-
BRIDGED_INLINE BridgedPassContext initializeNestedPassContext(BridgedFunction newFunction) const;
337+
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedPassContext initializeNestedPassContext(BridgedFunction newFunction) const;
338338
BRIDGED_INLINE void deinitializedNestedPassContext() const;
339339

340340
// SSAUpdater

0 commit comments

Comments
 (0)