aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-30 19:35:54 +0000
committerChris Lattner <sabre@nondot.org>2003-06-30 19:35:54 +0000
commiteb093fbf6fd2878c842f2f215362597475ef1817 (patch)
tree627231ed08cfe387ff67732fa33a49ec582dc245
parent02c26b681ec70538fba8b273326e696e6a3dc4d2 (diff)
downloadexternal_llvm-eb093fbf6fd2878c842f2f215362597475ef1817.zip
external_llvm-eb093fbf6fd2878c842f2f215362597475ef1817.tar.gz
external_llvm-eb093fbf6fd2878c842f2f215362597475ef1817.tar.bz2
Setjmp should always return zero if we don't implement longjmp. This avoids
leaving trash in the register, fixing anagram git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7013 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/InstSelectSimple.cpp2
-rw-r--r--lib/Target/X86/X86ISelSimple.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index e57a6ab..b2e11ba 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/lib/Target/X86/InstSelectSimple.cpp
@@ -981,6 +981,8 @@ void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
case LLVMIntrinsic::longjmp:
BuildMI(X86::CALLpcrel32, 1).addExternalSymbol("abort", true);
case LLVMIntrinsic::setjmp:
+ // Setjmp always returns zero...
+ BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
return;
default: assert(0 && "Unknown intrinsic for X86!");
}
diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp
index e57a6ab..b2e11ba 100644
--- a/lib/Target/X86/X86ISelSimple.cpp
+++ b/lib/Target/X86/X86ISelSimple.cpp
@@ -981,6 +981,8 @@ void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
case LLVMIntrinsic::longjmp:
BuildMI(X86::CALLpcrel32, 1).addExternalSymbol("abort", true);
case LLVMIntrinsic::setjmp:
+ // Setjmp always returns zero...
+ BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
return;
default: assert(0 && "Unknown intrinsic for X86!");
}