llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/CallingConvLower.cpp b/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
index 9289711..2f4db28 100644
--- a/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
+++ b/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
@@ -67,11 +67,11 @@
ISD::ArgFlagsTy ArgFlags =
cast<ARG_FLAGSSDNode>(TheArgs->getOperand(3+i))->getArgFlags();
if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
- std::string msg;
- raw_string_ostream Msg(msg);
- Msg << "Formal argument #" << i << " has unhandled type "
+#ifndef NDEBUG
+ cerr << "Formal argument #" << i << " has unhandled type "
<< ArgVT.getMVTString();
- llvm_report_error(Msg.str());
+#endif
+ llvm_unreachable(0);
}
}
}
@@ -84,12 +84,12 @@
MVT VT = TheRet->getOperand(i*2+1).getValueType();
ISD::ArgFlagsTy ArgFlags =
cast<ARG_FLAGSSDNode>(TheRet->getOperand(i*2+2))->getArgFlags();
- if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)){
- std::string msg;
- raw_string_ostream Msg(msg);
- Msg << "Return operand #" << i << " has unhandled type "
+ if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) {
+#ifndef NDEBUG
+ cerr << "Return operand #" << i << " has unhandled type "
<< VT.getMVTString();
- llvm_report_error(Msg.str());
+#endif
+ llvm_unreachable(0);
}
}
}
@@ -103,11 +103,11 @@
MVT ArgVT = TheCall->getArg(i).getValueType();
ISD::ArgFlagsTy ArgFlags = TheCall->getArgFlags(i);
if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
- std::string msg;
- raw_string_ostream Msg(msg);
- Msg << "Call operand #" << i << " has unhandled type "
+#ifndef NDEBUG
+ cerr << "Call operand #" << i << " has unhandled type "
<< ArgVT.getMVTString();
- llvm_report_error(Msg.str());
+#endif
+ llvm_unreachable(0);
}
}
}
@@ -122,11 +122,11 @@
MVT ArgVT = ArgVTs[i];
ISD::ArgFlagsTy ArgFlags = Flags[i];
if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
- std::string msg;
- raw_string_ostream Msg(msg);
- Msg << "Call operand #" << i << " has unhandled type "
+#ifndef NDEBUG
+ cerr << "Call operand #" << i << " has unhandled type "
<< ArgVT.getMVTString();
- llvm_report_error(Msg.str());
+#endif
+ llvm_unreachable(0);
}
}
}
@@ -140,11 +140,11 @@
if (TheCall->isInreg())
Flags.setInReg();
if (Fn(i, VT, VT, CCValAssign::Full, Flags, *this)) {
- std::string msg;
- raw_string_ostream Msg(msg);
- Msg << "Call result #" << i << " has unhandled type "
+#ifndef NDEBUG
+ cerr << "Call result #" << i << " has unhandled type "
<< VT.getMVTString();
- llvm_report_error(Msg.str());
+#endif
+ llvm_unreachable(0);
}
}
}
@@ -153,10 +153,10 @@
/// produce a single value.
void CCState::AnalyzeCallResult(MVT VT, CCAssignFn Fn) {
if (Fn(0, VT, VT, CCValAssign::Full, ISD::ArgFlagsTy(), *this)) {
- std::string msg;
- raw_string_ostream Msg(msg);
- Msg << "Call result has unhandled type "
+#ifndef NDEBUG
+ cerr << "Call result has unhandled type "
<< VT.getMVTString();
- llvm_report_error(Msg.str());
+#endif
+ llvm_unreachable(0);
}
}