Skip to content

Commit 655dae8

Browse files
committed
Optimizer: add Options.noAllocations
1 parent cab6232 commit 655dae8

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/PassManager/Options.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ struct Options {
3636
_bridged.enableAddressDependencies()
3737
}
3838

39+
var noAllocations: Bool {
40+
_bridged.noAllocations()
41+
}
42+
3943
var enableEmbeddedSwift: Bool {
40-
_bridged.hasFeature(.Embedded)
44+
hasFeature(.Embedded)
4145
}
4246

4347
var enableMergeableTraps: Bool {

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ struct BridgedPassContext {
385385
bool enableSimplificationFor(BridgedInstruction inst) const;
386386
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getCurrentModuleContext() const;
387387
BRIDGED_INLINE bool enableWMORequiredDiagnostics() const;
388+
BRIDGED_INLINE bool noAllocations() const;
388389

389390
// Temporary for AddressableParameters Bootstrapping.
390391
BRIDGED_INLINE bool enableAddressDependencies() const;

include/swift/SILOptimizer/OptimizerBridgingImpl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ bool BridgedPassContext::enableWMORequiredDiagnostics() const {
591591
return mod->getOptions().EnableWMORequiredDiagnostics;
592592
}
593593

594+
bool BridgedPassContext::noAllocations() const {
595+
swift::SILModule *mod = invocation->getPassManager()->getModule();
596+
return mod->getOptions().NoAllocations;
597+
}
598+
594599
bool BridgedPassContext::enableAddressDependencies() const {
595600
swift::SILModule *mod = invocation->getPassManager()->getModule();
596601
return mod->getOptions().EnableAddressDependencies;

0 commit comments

Comments
 (0)