Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
authorMisha Brukman <brukman+llvm@gmail.com>
Mon, 12 Jul 2004 23:37:18 +0000 (23:37 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Mon, 12 Jul 2004 23:37:18 +0000 (23:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14781 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index cbdca3cb5ca796e96b54938f3dd08ee196258c1f..a7c2bd5fc21db1605d2f11366e43bc3ea4c74126 100644 (file)
@@ -664,7 +664,7 @@ 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__)\n"
+      << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__)\n"
       << "extern void *__builtin_alloca(unsigned long);\n"
       << "#define alloca(x) __builtin_alloca(x)\n"
       << "#else\n"
index cbdca3cb5ca796e96b54938f3dd08ee196258c1f..a7c2bd5fc21db1605d2f11366e43bc3ea4c74126 100644 (file)
@@ -664,7 +664,7 @@ 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__)\n"
+      << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__)\n"
       << "extern void *__builtin_alloca(unsigned long);\n"
       << "#define alloca(x) __builtin_alloca(x)\n"
       << "#else\n"