File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
SwiftCompilerSources/Sources/Optimizer/PassManager
include/swift/SILOptimizer Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ extension Context {
44
44
}
45
45
}
46
46
47
+ var currentModuleContext : ModuleDecl {
48
+ _bridged. getCurrentModuleContext ( ) . getAs ( ModuleDecl . self)
49
+ }
50
+
47
51
var moduleIsSerialized : Bool { _bridged. moduleIsSerialized ( ) }
48
52
49
53
/// Enable diagnostics requiring WMO (for @noLocks, @noAllocation
Original file line number Diff line number Diff line change @@ -382,6 +382,7 @@ struct BridgedPassContext {
382
382
BRIDGED_INLINE bool enableMoveInoutStackProtection () const ;
383
383
BRIDGED_INLINE AssertConfiguration getAssertConfiguration () const ;
384
384
bool enableSimplificationFor (BridgedInstruction inst) const ;
385
+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getCurrentModuleContext () const ;
385
386
BRIDGED_INLINE bool enableWMORequiredDiagnostics () const ;
386
387
387
388
// Temporary for AddressableParameters Bootstrapping.
Original file line number Diff line number Diff line change @@ -578,6 +578,10 @@ bool BridgedPassContext::shouldExpand(BridgedType ty) const {
578
578
return swift::shouldExpand (mod, ty.unbridged ());
579
579
}
580
580
581
+ BridgedDeclObj BridgedPassContext::getCurrentModuleContext () const {
582
+ return {invocation->getPassManager ()->getModule ()->getSwiftModule ()};
583
+ }
584
+
581
585
bool BridgedPassContext::enableWMORequiredDiagnostics () const {
582
586
swift::SILModule *mod = invocation->getPassManager ()->getModule ();
583
587
return mod->getOptions ().EnableWMORequiredDiagnostics ;
You can’t perform that action at this time.
0 commit comments