diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-06 03:15:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-06 03:15:44 +0000 |
commit | 523001f1bb8e9b38a68813c083daf1fa0ce22c5f (patch) | |
tree | cd5ec6968a4b0080773a080d0d7aa39b8db02ca6 /lib | |
parent | 37874058f440b9700578b7d27fb002cc9080c646 (diff) | |
download | external_llvm-523001f1bb8e9b38a68813c083daf1fa0ce22c5f.zip external_llvm-523001f1bb8e9b38a68813c083daf1fa0ce22c5f.tar.gz external_llvm-523001f1bb8e9b38a68813c083daf1fa0ce22c5f.tar.bz2 |
FreeBSD uses GCC. Patch contributed by Jeff Cohen!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 5 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 5b786d4..85229ad 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -702,13 +702,12 @@ void CWriter::writeOperand(Value *Operand) { static void generateCompilerSpecificCode(std::ostream& Out) { // Alloca is hard to get, and we don't want to include stdlib.h here... Out << "/* get a declaration for alloca */\n" - << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__)\n" + << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__) || " + << "defined(__FreeBSD__)\n" << "extern void *__builtin_alloca(unsigned long);\n" << "#define alloca(x) __builtin_alloca(x)\n" << "#else\n" - << "#ifndef __FreeBSD__\n" << "#include <alloca.h>\n" - << "#endif\n" << "#endif\n\n"; // We output GCC specific attributes to preserve 'linkonce'ness on globals. diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 5b786d4..85229ad 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -702,13 +702,12 @@ void CWriter::writeOperand(Value *Operand) { static void generateCompilerSpecificCode(std::ostream& Out) { // Alloca is hard to get, and we don't want to include stdlib.h here... Out << "/* get a declaration for alloca */\n" - << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__)\n" + << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__) || " + << "defined(__FreeBSD__)\n" << "extern void *__builtin_alloca(unsigned long);\n" << "#define alloca(x) __builtin_alloca(x)\n" << "#else\n" - << "#ifndef __FreeBSD__\n" << "#include <alloca.h>\n" - << "#endif\n" << "#endif\n\n"; // We output GCC specific attributes to preserve 'linkonce'ness on globals. |