File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
SwiftCompilerSources/Sources/Optimizer/PassManager
include/swift/SILOptimizer
lib/SILOptimizer/PassManager Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ extension Context {
45
45
46
46
var moduleIsSerialized : Bool { _bridged. moduleIsSerialized ( ) }
47
47
48
+ func canMakeStaticObjectReadOnly( objectType: Type ) -> Bool {
49
+ _bridged. canMakeStaticObjectReadOnly ( objectType. bridged)
50
+ }
51
+
48
52
func lookupDeinit( ofNominal: NominalTypeDecl ) -> Function ? {
49
53
_bridged. lookUpNominalDeinitFunction ( ofNominal. bridged) . function
50
54
}
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ struct BridgedPassContext {
265
265
SwiftInt getStaticSize (BridgedType type) const ;
266
266
SwiftInt getStaticAlignment (BridgedType type) const ;
267
267
SwiftInt getStaticStride (BridgedType type) const ;
268
+ bool canMakeStaticObjectReadOnly (BridgedType type) const ;
268
269
269
270
// Sets
270
271
Original file line number Diff line number Diff line change @@ -1729,6 +1729,13 @@ SwiftInt BridgedPassContext::getStaticStride(BridgedType type) const {
1729
1729
return integerValueFromConstant (c);
1730
1730
}
1731
1731
1732
+ bool BridgedPassContext::canMakeStaticObjectReadOnly (BridgedType type) const {
1733
+ if (irgen::IRGenModule *IGM = invocation->getIRGenModule ()) {
1734
+ return IGM->canMakeStaticObjectReadOnly (type.unbridged ());
1735
+ }
1736
+ return false ;
1737
+ }
1738
+
1732
1739
swift::SILVTable * BridgedPassContext::specializeVTableForType (BridgedType type, BridgedFunction function) const {
1733
1740
return ::specializeVTableForType (type.unbridged (),
1734
1741
function.getFunction ()->getModule (),
You can’t perform that action at this time.
0 commit comments