summaryrefslogtreecommitdiff
path: root/lib/Target/CBackend
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2006-12-10 23:12:42 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2006-12-10 23:12:42 +0000
commitd27a258d2d7691db3731135a448b7654d260cc07 (patch)
tree404b4d4176b7fae51eaaada3ee510901e449952c /lib/Target/CBackend
parentca3aa26c202c8442eaa6725ace1a88dffd01b486 (diff)
downloadllvm-d27a258d2d7691db3731135a448b7654d260cc07.tar.gz
llvm-d27a258d2d7691db3731135a448b7654d260cc07.tar.bz2
llvm-d27a258d2d7691db3731135a448b7654d260cc07.tar.xz
Cleaned setjmp/longjmp lowering interfaces. Now we're producing right
code (both asm & cbe) for Mingw32 target. Removed autoconf checks for underscored versions of setjmp/longjmp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend')
-rw-r--r--lib/Target/CBackend/CBackend.cpp8
-rw-r--r--lib/Target/CBackend/Writer.cpp8
2 files changed, 4 insertions, 12 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 3cfd6d0386..250ffc1fb5 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1136,6 +1136,8 @@ static void generateCompilerSpecificCode(std::ostream& Out) {
<< "#elif defined(__APPLE__)\n"
<< "extern void *__builtin_alloca(unsigned long);\n"
<< "#define alloca(x) __builtin_alloca(x)\n"
+ << "#define longjmp _longjmp\n"
+ << "#define setjmp _setjmp\n"
<< "#elif defined(__sun__)\n"
<< "#if defined(__sparcv9)\n"
<< "extern void *__builtin_alloca(unsigned long);\n"
@@ -2141,17 +2143,11 @@ void CWriter::visitCallInst(CallInst &I) {
Out << ')';
return;
case Intrinsic::setjmp:
-#if defined(HAVE__SETJMP) && defined(HAVE__LONGJMP)
- Out << "_"; // Use _setjmp on systems that support it!
-#endif
Out << "setjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
Out << ')';
return;
case Intrinsic::longjmp:
-#if defined(HAVE__SETJMP) && defined(HAVE__LONGJMP)
- Out << "_"; // Use _longjmp on systems that support it!
-#endif
Out << "longjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
Out << ", ";
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 3cfd6d0386..250ffc1fb5 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -1136,6 +1136,8 @@ static void generateCompilerSpecificCode(std::ostream& Out) {
<< "#elif defined(__APPLE__)\n"
<< "extern void *__builtin_alloca(unsigned long);\n"
<< "#define alloca(x) __builtin_alloca(x)\n"
+ << "#define longjmp _longjmp\n"
+ << "#define setjmp _setjmp\n"
<< "#elif defined(__sun__)\n"
<< "#if defined(__sparcv9)\n"
<< "extern void *__builtin_alloca(unsigned long);\n"
@@ -2141,17 +2143,11 @@ void CWriter::visitCallInst(CallInst &I) {
Out << ')';
return;
case Intrinsic::setjmp:
-#if defined(HAVE__SETJMP) && defined(HAVE__LONGJMP)
- Out << "_"; // Use _setjmp on systems that support it!
-#endif
Out << "setjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
Out << ')';
return;
case Intrinsic::longjmp:
-#if defined(HAVE__SETJMP) && defined(HAVE__LONGJMP)
- Out << "_"; // Use _longjmp on systems that support it!
-#endif
Out << "longjmp(*(jmp_buf*)";
writeOperand(I.getOperand(1));
Out << ", ";