diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/CallingConvLower.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/CallingConvLower.cpp | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/lib/CodeGen/SelectionDAG/CallingConvLower.cpp b/lib/CodeGen/SelectionDAG/CallingConvLower.cpp index 8b8f0e5f84..9289711e6e 100644 --- a/lib/CodeGen/SelectionDAG/CallingConvLower.cpp +++ b/lib/CodeGen/SelectionDAG/CallingConvLower.cpp @@ -13,6 +13,8 @@ //===----------------------------------------------------------------------===// #include "llvm/CodeGen/CallingConvLower.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" @@ -65,9 +67,11 @@ void CCState::AnalyzeFormalArguments(SDNode *TheArgs, CCAssignFn Fn) { ISD::ArgFlagsTy ArgFlags = cast<ARG_FLAGSSDNode>(TheArgs->getOperand(3+i))->getArgFlags(); if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { - cerr << "Formal argument #" << i << " has unhandled type " - << ArgVT.getMVTString() << "\n"; - abort(); + std::string msg; + raw_string_ostream Msg(msg); + Msg << "Formal argument #" << i << " has unhandled type " + << ArgVT.getMVTString(); + llvm_report_error(Msg.str()); } } } @@ -81,9 +85,11 @@ void CCState::AnalyzeReturn(SDNode *TheRet, CCAssignFn Fn) { ISD::ArgFlagsTy ArgFlags = cast<ARG_FLAGSSDNode>(TheRet->getOperand(i*2+2))->getArgFlags(); if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)){ - cerr << "Return operand #" << i << " has unhandled type " - << VT.getMVTString() << "\n"; - abort(); + std::string msg; + raw_string_ostream Msg(msg); + Msg << "Return operand #" << i << " has unhandled type " + << VT.getMVTString(); + llvm_report_error(Msg.str()); } } } @@ -97,9 +103,11 @@ void CCState::AnalyzeCallOperands(CallSDNode *TheCall, CCAssignFn Fn) { MVT ArgVT = TheCall->getArg(i).getValueType(); ISD::ArgFlagsTy ArgFlags = TheCall->getArgFlags(i); if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { - cerr << "Call operand #" << i << " has unhandled type " - << ArgVT.getMVTString() << "\n"; - abort(); + std::string msg; + raw_string_ostream Msg(msg); + Msg << "Call operand #" << i << " has unhandled type " + << ArgVT.getMVTString(); + llvm_report_error(Msg.str()); } } } @@ -114,9 +122,11 @@ void CCState::AnalyzeCallOperands(SmallVectorImpl<MVT> &ArgVTs, MVT ArgVT = ArgVTs[i]; ISD::ArgFlagsTy ArgFlags = Flags[i]; if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) { - cerr << "Call operand #" << i << " has unhandled type " - << ArgVT.getMVTString() << "\n"; - abort(); + std::string msg; + raw_string_ostream Msg(msg); + Msg << "Call operand #" << i << " has unhandled type " + << ArgVT.getMVTString(); + llvm_report_error(Msg.str()); } } } @@ -130,9 +140,11 @@ void CCState::AnalyzeCallResult(CallSDNode *TheCall, CCAssignFn Fn) { if (TheCall->isInreg()) Flags.setInReg(); if (Fn(i, VT, VT, CCValAssign::Full, Flags, *this)) { - cerr << "Call result #" << i << " has unhandled type " - << VT.getMVTString() << "\n"; - abort(); + std::string msg; + raw_string_ostream Msg(msg); + Msg << "Call result #" << i << " has unhandled type " + << VT.getMVTString(); + llvm_report_error(Msg.str()); } } } @@ -141,8 +153,10 @@ void CCState::AnalyzeCallResult(CallSDNode *TheCall, CCAssignFn Fn) { /// produce a single value. void CCState::AnalyzeCallResult(MVT VT, CCAssignFn Fn) { if (Fn(0, VT, VT, CCValAssign::Full, ISD::ArgFlagsTy(), *this)) { - cerr << "Call result has unhandled type " - << VT.getMVTString() << "\n"; - abort(); + std::string msg; + raw_string_ostream Msg(msg); + Msg << "Call result has unhandled type " + << VT.getMVTString(); + llvm_report_error(Msg.str()); } } |