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 {
4444 }
4545 }
4646
47+ var currentModuleContext : ModuleDecl {
48+ _bridged. getCurrentModuleContext ( ) . getAs ( ModuleDecl . self)
49+ }
50+
4751 var moduleIsSerialized : Bool { _bridged. moduleIsSerialized ( ) }
4852
4953 /// Enable diagnostics requiring WMO (for @noLocks, @noAllocation
Original file line number Diff line number Diff line change @@ -382,6 +382,7 @@ struct BridgedPassContext {
382382 BRIDGED_INLINE bool enableMoveInoutStackProtection () const ;
383383 BRIDGED_INLINE AssertConfiguration getAssertConfiguration () const ;
384384 bool enableSimplificationFor (BridgedInstruction inst) const ;
385+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getCurrentModuleContext () const ;
385386 BRIDGED_INLINE bool enableWMORequiredDiagnostics () const ;
386387
387388 // Temporary for AddressableParameters Bootstrapping.
Original file line number Diff line number Diff line change @@ -578,6 +578,10 @@ bool BridgedPassContext::shouldExpand(BridgedType ty) const {
578578 return swift::shouldExpand (mod, ty.unbridged ());
579579}
580580
581+ BridgedDeclObj BridgedPassContext::getCurrentModuleContext () const {
582+ return {invocation->getPassManager ()->getModule ()->getSwiftModule ()};
583+ }
584+
581585bool BridgedPassContext::enableWMORequiredDiagnostics () const {
582586 swift::SILModule *mod = invocation->getPassManager ()->getModule ();
583587 return mod->getOptions ().EnableWMORequiredDiagnostics ;
You can’t perform that action at this time.
0 commit comments