[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Oct 5 21:22:03 PDT 2004



Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.199 -> 1.200
---
Log message:

Really fix FreeBSD, which apparently doesn't tolerate the extern.
Thanks to Jeff Cohen for pointing out my goof.


---
Diffs of the changes:  (+3 -2)

Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.199 llvm/lib/Target/CBackend/Writer.cpp:1.200
--- llvm/lib/Target/CBackend/Writer.cpp:1.199	Tue Oct  5 22:15:44 2004
+++ llvm/lib/Target/CBackend/Writer.cpp	Tue Oct  5 23:21:52 2004
@@ -702,10 +702,11 @@
 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__) || "
-      << "defined(__FreeBSD__)\n"
+      << "#if defined(sun) || defined(__CYGWIN__) || defined(__APPLE__)\n"
       << "extern void *__builtin_alloca(unsigned long);\n"
       << "#define alloca(x) __builtin_alloca(x)\n"
+      << "#elif defined(__FreeBSD__)\n"
+      << "#define alloca(x) __builtin_alloca(x)\n"
       << "#else\n"
       << "#include <alloca.h>\n"
       << "#endif\n\n";






More information about the llvm-commits mailing list