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.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 0b7ad64d23..3dfd8f9cd0 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -528,7 +528,9 @@ static void generateAllocaDecl(std::ostream& Out) {
<< "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";
}