forked from OSchip/llvm-project
Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
llvm-svn: 19776
This commit is contained in:
parent
30226da5b3
commit
d5d45b8d1a
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue