File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -274,6 +274,33 @@ llvm::Value *irgen::emitArchetypeWitnessTableRef(IRGenFunction &IGF,
274
274
rootWTable = emitOpaqueTypeWitnessTableRef (IGF, opaqueRoot,
275
275
rootProtocol);
276
276
}
277
+ #ifndef NDEBUG
278
+ if (!rootWTable) {
279
+ llvm::errs ()
280
+ << " Root witness table not bound in function.\n "
281
+ << " The witness table could be missing entirely because it needs "
282
+ " to be passed to the function.\n "
283
+ << " Or the witness table is present and not bound in which case "
284
+ " setScopedLocalTypeData or similar must be called.\n " ;
285
+ llvm::errs () << " Root archetype for conformance: " << rootArchetype
286
+ << " \n " ;
287
+ rootArchetype->dump (llvm::errs ());
288
+ llvm::errs () << " Root protocol without wtable: " << rootProtocol << " \n " ;
289
+ rootProtocol->dump (llvm::errs ());
290
+ llvm::errs () << " Archetype for conformance: " << archetype << " \n " ;
291
+ archetype->dump (llvm::errs ());
292
+ llvm::errs () << " Protocol for conformance: " << protocol << " \n " ;
293
+ protocol->dump (llvm::errs ());
294
+ llvm::errs () << " Function:\n " ;
295
+ IGF.CurFn ->print (llvm::errs ());
296
+ if (auto localTypeData = IGF.getLocalTypeData ()) {
297
+ llvm::errs () << " LocalTypeData:\n " ;
298
+ localTypeData->dump ();
299
+ } else {
300
+ llvm::errs () << " No LocalTypeDataCache for this function!\n " ;
301
+ }
302
+ }
303
+ #endif
277
304
assert (rootWTable && " root witness table not bound in local context!" );
278
305
}
279
306
You can’t perform that action at this time.
0 commit comments