aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/CBackend/CBackend.cpp5
-rw-r--r--lib/Target/CBackend/Writer.cpp5
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelection.cpp2
-rw-r--r--lib/Target/X86/InstSelectSimple.cpp2
-rw-r--r--lib/Target/X86/X86ISelSimple.cpp2
5 files changed, 14 insertions, 2 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 0443c18475..4bc354bdee 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1139,6 +1139,7 @@ void CWriter::visitCallInst(CallInst &I) {
return;
case LLVMIntrinsic::setjmp:
+ case LLVMIntrinsic::sigsetjmp:
// This instrinsic should never exist in the program, but until we get
// setjmp/longjmp transformations going on, we should codegen it to
// something reasonable. This will allow code that never calls longjmp
@@ -1146,7 +1147,9 @@ void CWriter::visitCallInst(CallInst &I) {
Out << "0";
return;
case LLVMIntrinsic::longjmp:
- // Treat longjmp the same as setjmp
+ case LLVMIntrinsic::siglongjmp:
+ // Longjmp is not implemented, and never will be. It would cause an
+ // exception throw.
Out << "abort()";
return;
}
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 0443c18475..4bc354bdee 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -1139,6 +1139,7 @@ void CWriter::visitCallInst(CallInst &I) {
return;
case LLVMIntrinsic::setjmp:
+ case LLVMIntrinsic::sigsetjmp:
// This instrinsic should never exist in the program, but until we get
// setjmp/longjmp transformations going on, we should codegen it to
// something reasonable. This will allow code that never calls longjmp
@@ -1146,7 +1147,9 @@ void CWriter::visitCallInst(CallInst &I) {
Out << "0";
return;
case LLVMIntrinsic::longjmp:
- // Treat longjmp the same as setjmp
+ case LLVMIntrinsic::siglongjmp:
+ // Longjmp is not implemented, and never will be. It would cause an
+ // exception throw.
Out << "abort()";
return;
}
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index 970c5fdcf0..ee24333495 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -1433,6 +1433,7 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
addReg(callInstr.getOperand(1)));
return true;
+ case LLVMIntrinsic::sigsetjmp:
case LLVMIntrinsic::setjmp: {
// act as if we return 0
unsigned g0 = target.getRegInfo().getZeroRegNum();
@@ -1441,6 +1442,7 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
return true;
}
+ case LLVMIntrinsic::siglongjmp:
case LLVMIntrinsic::longjmp: {
// call abort()
Module* M = callInstr.getParent()->getParent()->getParent();
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index 2cc4e8367d..26e908ff04 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/lib/Target/X86/InstSelectSimple.cpp
@@ -978,10 +978,12 @@ void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
return;
case LLVMIntrinsic::longjmp:
+ case LLVMIntrinsic::siglongjmp:
BuildMI(X86::CALLpcrel32, 1).addExternalSymbol("abort", true);
return;
case LLVMIntrinsic::setjmp:
+ case LLVMIntrinsic::sigsetjmp:
// Setjmp always returns zero...
BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
return;
diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp
index 2cc4e8367d..26e908ff04 100644
--- a/lib/Target/X86/X86ISelSimple.cpp
+++ b/lib/Target/X86/X86ISelSimple.cpp
@@ -978,10 +978,12 @@ void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
return;
case LLVMIntrinsic::longjmp:
+ case LLVMIntrinsic::siglongjmp:
BuildMI(X86::CALLpcrel32, 1).addExternalSymbol("abort", true);
return;
case LLVMIntrinsic::setjmp:
+ case LLVMIntrinsic::sigsetjmp:
// Setjmp always returns zero...
BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
return;