for (auto AnySuspend : CoroSuspends) {
auto Suspend = dyn_cast<CoroSuspendInst>(AnySuspend);
if (!Suspend) {
+#ifndef NDEBUG
AnySuspend->dump();
+#endif
report_fatal_error("coro.id must be paired with coro.suspend");
}
for (auto AnySuspend : CoroSuspends) {
auto Suspend = dyn_cast<CoroSuspendRetconInst>(AnySuspend);
if (!Suspend) {
+#ifndef NDEBUG
AnySuspend->dump();
+#endif
report_fatal_error("coro.id.retcon.* must be paired with "
"coro.suspend.retcon");
}
auto RI = ResultTys.begin(), RE = ResultTys.end();
for (; SI != SE && RI != RE; ++SI, ++RI) {
if ((*SI)->getType() != *RI) {
+#ifndef NDEBUG
Suspend->dump();
Prototype->getFunctionType()->dump();
+#endif
report_fatal_error("argument to coro.suspend.retcon does not "
"match corresponding prototype function result");
}
}
if (SI != SE || RI != RE) {
+#ifndef NDEBUG
Suspend->dump();
Prototype->getFunctionType()->dump();
+#endif
report_fatal_error("wrong number of arguments to coro.suspend.retcon");
}
? cast<StructType>(SResultTy)->elements()
: SResultTy); // forms an ArrayRef using SResultTy, be careful
if (SuspendResultTys.size() != ResumeTys.size()) {
+#ifndef NDEBUG
Suspend->dump();
Prototype->getFunctionType()->dump();
+#endif
report_fatal_error("wrong number of results from coro.suspend.retcon");
}
for (size_t I = 0, E = ResumeTys.size(); I != E; ++I) {
if (SuspendResultTys[I] != ResumeTys[I]) {
+#ifndef NDEBUG
Suspend->dump();
Prototype->getFunctionType()->dump();
+#endif
report_fatal_error("result from coro.suspend.retcon does not "
"match corresponding prototype function param");
}
LLVM_ATTRIBUTE_NORETURN
static void fail(const Instruction *I, const char *Reason, Value *V) {
+#ifndef NDEBUG
I->dump();
if (V) {
errs() << " Value: ";
V->printAsOperand(llvm::errs());
errs() << '\n';
}
+#endif
report_fatal_error(Reason);
}