From 4655e9de38c1656636d9dbc2212a5b12fa7e3afb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Sep 2005 22:15:53 +0000 Subject: [PATCH] If the target prefers it, use _setjmp/_longjmp should be used instead of setjmp/longjmp for llvm.setjmp/llvm.longjmp. llvm-svn: 23481 --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ea2696786b5..ad7a8af4af5 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -736,8 +736,12 @@ void SelectionDAGLowering::visitCall(CallInst &I) { case Intrinsic::returnaddress: visitFrameReturnAddress(I, false); return; case Intrinsic::frameaddress: visitFrameReturnAddress(I, true); return; - case Intrinsic::setjmp: RenameFn = "setjmp"; break; - case Intrinsic::longjmp: RenameFn = "longjmp"; break; + case Intrinsic::setjmp: + RenameFn = "_setjmp"+!TLI.usesUnderscoreSetJmpLongJmp(); + break; + case Intrinsic::longjmp: + RenameFn = "_longjmp"+!TLI.usesUnderscoreSetJmpLongJmp(); + break; case Intrinsic::memcpy: visitMemIntrinsic(I, ISD::MEMCPY); return; case Intrinsic::memset: visitMemIntrinsic(I, ISD::MEMSET); return; case Intrinsic::memmove: visitMemIntrinsic(I, ISD::MEMMOVE); return;