File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2148,12 +2148,18 @@ class SILBuilder {
2148
2148
}
2149
2149
2150
2150
bool isLoadableOrOpaque (SILType Ty) {
2151
- if (!F) {
2152
- // We are inserting into the static initializer of a SILGlobalVariable.
2153
- // All types used there are loadable by definition.
2151
+ auto &M = C. Module ;
2152
+
2153
+ if (! SILModuleConventions (M). useLoweredAddresses ())
2154
2154
return true ;
2155
- }
2156
- return Ty.isLoadableOrOpaque (F);
2155
+
2156
+ auto expansion = ResilienceExpansion::Maximal;
2157
+ // If there's no current SILFunction, we're inserting into a global
2158
+ // variable initializer.
2159
+ if (F)
2160
+ expansion = F->getResilienceExpansion ();
2161
+
2162
+ return M.getTypeLowering (Ty, expansion).isLoadable ();
2157
2163
}
2158
2164
2159
2165
void appendOperandTypeName (SILType OpdTy, llvm::SmallString<16 > &Name) {
You can’t perform that action at this time.
0 commit comments