FreeBSD uses GCC. Patch contributed by Jeff Cohen!

llvm-svn: 16756
This commit is contained in:
Chris Lattner 2004-10-06 03:15:44 +00:00
parent 18b88f71ad
commit 32ed828f46
1 changed files with 2 additions and 3 deletions

View File

@ -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.