assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/IA64/IA64InstrInfo.cpp b/lib/Target/IA64/IA64InstrInfo.cpp
index 5f89d4f..0537c3e 100644
--- a/lib/Target/IA64/IA64InstrInfo.cpp
+++ b/lib/Target/IA64/IA64InstrInfo.cpp
@@ -16,6 +16,7 @@
#include "IA64InstrBuilder.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/ErrorHandling.h"
#include "IA64GenInstrInfo.inc"
using namespace llvm;
@@ -111,8 +112,8 @@
BuildMI(MBB, MI, DL, get(IA64::ST8))
.addFrameIndex(FrameIdx)
.addReg(IA64::r2);
- } else assert(0 &&
- "sorry, I don't know how to store this sort of reg in the stack\n");
+ } else
+ LLVM_UNREACHABLE("sorry, I don't know how to store this sort of reg in the stack");
}
void IA64InstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
@@ -128,7 +129,7 @@
} else if (RC == IA64::PRRegisterClass) {
Opc = IA64::ST1;
} else {
- assert(0 &&
+ LLVM_UNREACHABLE(
"sorry, I don't know how to store this sort of reg\n");
}
@@ -163,7 +164,7 @@
.addReg(IA64::r2)
.addReg(IA64::r0);
} else {
- assert(0 &&
+ LLVM_UNREACHABLE(
"sorry, I don't know how to load this sort of reg from the stack\n");
}
}
@@ -180,7 +181,7 @@
} else if (RC == IA64::PRRegisterClass) {
Opc = IA64::LD1;
} else {
- assert(0 &&
+ LLVM_UNREACHABLE(
"sorry, I don't know how to load this sort of reg\n");
}