From 6de6d3e4ec54944475e1daaaddcf86e50c8323ad Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 16 Jan 2012 20:38:31 +0000 Subject: [PATCH] Give better scavenger errors by invoking the verifier. llvm-svn: 148251 --- llvm/lib/CodeGen/RegisterScavenging.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp index 07cf02769124..16c5898e1683 100644 --- a/llvm/lib/CodeGen/RegisterScavenging.cpp +++ b/llvm/lib/CodeGen/RegisterScavenging.cpp @@ -205,7 +205,12 @@ void RegScavenger::forward() { SubUsed = true; break; } - assert(SubUsed && "Using an undefined register!"); +#ifndef NDEBUG + if (!SubUsed) { + MBB->getParent()->verify(NULL, "In Register Scavenger"); + llvm_unreachable("Using an undefined register!"); + } +#endif (void)SubUsed; } assert((!EarlyClobberRegs.test(Reg) || MI->isRegTiedToDefOperand(i)) &&