Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca

llvm-svn: 19776
This commit is contained in:
Reid Spencer 2005-01-23 04:32:47 +00:00
parent 30226da5b3
commit d5d45b8d1a
1 changed files with 4 additions and 1 deletions

View File

@ -723,7 +723,10 @@ 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(__CYGWIN__) || defined(__APPLE__)\n"
<< "#if defined(__CYGWIN__)\n"
<< "extern void *_alloca(unsigned long);\n"
<< "#define alloca(x) _alloca(x)\n"
<< "#elif defined(__APPLE__)\n"
<< "extern void *__builtin_alloca(unsigned long);\n"
<< "#define alloca(x) __builtin_alloca(x)\n"
<< "#elif defined(__sun__)\n"