mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Guard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is not guaranteed to be defined in all builds.
llvm-svn: 368790
This commit is contained in:
parent
5ad355756d
commit
5b6ef04ee6
@ -360,7 +360,9 @@ void coro::Shape::buildFrom(Function &F) {
|
||||
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");
|
||||
}
|
||||
|
||||
@ -392,7 +394,9 @@ void coro::Shape::buildFrom(Function &F) {
|
||||
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");
|
||||
}
|
||||
@ -402,15 +406,19 @@ void coro::Shape::buildFrom(Function &F) {
|
||||
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");
|
||||
}
|
||||
|
||||
@ -421,14 +429,18 @@ void coro::Shape::buildFrom(Function &F) {
|
||||
? 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");
|
||||
}
|
||||
@ -509,12 +521,14 @@ void coro::Shape::emitDealloc(IRBuilder<> &Builder, Value *Ptr,
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user