@@ -2244,9 +2244,11 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
2244
2244
2245
2245
void checkClassMethodInst (ClassMethodInst *CMI) {
2246
2246
auto overrideTy = TC.getConstantOverrideType (CMI->getMember ());
2247
- requireSameType (CMI->getType (),
2248
- SILType::getPrimitiveObjectType (overrideTy),
2249
- " result type of class_method must match abstracted type of method" );
2247
+ if (CMI->getModule ().getStage () != SILStage::Lowered) {
2248
+ requireSameType (
2249
+ CMI->getType (), SILType::getPrimitiveObjectType (overrideTy),
2250
+ " result type of class_method must match abstracted type of method" );
2251
+ }
2250
2252
auto methodType = requireObjectType (SILFunctionType, CMI,
2251
2253
" result of class_method" );
2252
2254
require (!methodType->getExtInfo ().hasContext (),
@@ -2280,8 +2282,11 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
2280
2282
2281
2283
void checkSuperMethodInst (SuperMethodInst *CMI) {
2282
2284
auto overrideTy = TC.getConstantOverrideType (CMI->getMember ());
2283
- requireSameType (CMI->getType (), SILType::getPrimitiveObjectType (overrideTy),
2284
- " result type of super_method must match abstracted type of method" );
2285
+ if (CMI->getModule ().getStage () != SILStage::Lowered) {
2286
+ requireSameType (
2287
+ CMI->getType (), SILType::getPrimitiveObjectType (overrideTy),
2288
+ " result type of super_method must match abstracted type of method" );
2289
+ }
2285
2290
auto methodType = requireObjectType (SILFunctionType, CMI,
2286
2291
" result of super_method" );
2287
2292
require (!methodType->getExtInfo ().hasContext (),
@@ -4226,12 +4231,14 @@ void SILVTable::verify(const SILModule &M) const {
4226
4231
llvm::raw_svector_ostream os (baseName);
4227
4232
entry.Method .print (os);
4228
4233
}
4229
-
4230
- SILVerifier (*entry.Implementation )
4231
- .requireABICompatibleFunctionTypes (
4232
- baseInfo.getSILType ().castTo <SILFunctionType>(),
4233
- entry.Implementation ->getLoweredFunctionType (),
4234
- " vtable entry for " + baseName + " must be ABI-compatible" );
4234
+
4235
+ if (M.getStage () != SILStage::Lowered) {
4236
+ SILVerifier (*entry.Implementation )
4237
+ .requireABICompatibleFunctionTypes (
4238
+ baseInfo.getSILType ().castTo <SILFunctionType>(),
4239
+ entry.Implementation ->getLoweredFunctionType (),
4240
+ " vtable entry for " + baseName + " must be ABI-compatible" );
4241
+ }
4235
4242
}
4236
4243
#endif
4237
4244
}
0 commit comments