diff options
| author | John Criswell <criswell@uiuc.edu> | 2003-12-10 18:17:57 +0000 |
|---|---|---|
| committer | John Criswell <criswell@uiuc.edu> | 2003-12-10 18:17:57 +0000 |
| commit | 65b3acdd5bae797887596c8a3c9f98f70a106c0c (patch) | |
| tree | 250cf02f5ec7570815df07598a1d6a83346ce525 | |
| parent | ccd9f3c1f817f2ec38e1d25bd12a9f1a352eb30a (diff) | |
| download | bcm5719-llvm-65b3acdd5bae797887596c8a3c9f98f70a106c0c.tar.gz bcm5719-llvm-65b3acdd5bae797887596c8a3c9f98f70a106c0c.zip | |
Upon Chris's suggestion, moved the #ifdef's to the generated C code.
This makes LLVM and the generated C code more portable.
llvm-svn: 10377
| -rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index faa9b925dd1..63a5ec8bc34 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -1087,20 +1087,17 @@ void CWriter::visitInvokeInst(InvokeInst &II) { void CWriter::visitUnwindInst(UnwindInst &I) { - // Determine the return size of write() based on the data model. -#ifdef _LP64 - const char * writedecl = " extern signed long long write();\n"; -#else - const char * writedecl = " extern write();\n"; -#endif - // The unwind instructions causes a control flow transfer out of the current // function, unwinding the stack until a caller who used the invoke // instruction is found. In this context, we code generated the invoke // instruction to add an entry to the top of the jmpbuf_list. Thus, here we // just have to longjmp to the specified handler. Out << " if (__llvm_jmpbuf_list == 0) { /* unwind */\n" - << writedecl + << "#ifdef _LP64\n" + << " extern signed long long write();\n" + << "#else\n" + << " extern write();\n" + << "#endif\n" << " ((void (*)(int, void*, unsigned))write)(2,\n" << " \"throw found with no handler!\\n\", 31); abort();\n" << " }\n" |

