aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/CBackend/Writer.cpp')
-rw-r--r--lib/Target/CBackend/Writer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 85229ad50c..bdc8b8d650 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -702,10 +702,11 @@ 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__) || "
- << "defined(__FreeBSD__)\n"
+ << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__)\n"
<< "extern void *__builtin_alloca(unsigned long);\n"
<< "#define alloca(x) __builtin_alloca(x)\n"
+ << "#elif defined(__FreeBSD__)\n"
+ << "#define alloca(x) __builtin_alloca(x)\n"
<< "#else\n"
<< "#include <alloca.h>\n"
<< "#endif\n\n";