Hrm, a relic from the past. How cute :)
[oota-llvm.git] / lib / ExecutionEngine / JIT / JITEmitter.cpp
index 982eadd12fa6ad24cc650aa86f55fbde5c84ca30..6dd2d56f7f2044a490baca5c3c5f8e62213a3c62 100644 (file)
@@ -21,7 +21,7 @@
 #include "Config/sys/mman.h"
 
 namespace {
-  Statistic<> NumBytes("jello", "Number of bytes of machine code compiled");
+  Statistic<> NumBytes("jit", "Number of bytes of machine code compiled");
   VM *TheVM = 0;
 
   /// JITMemoryManager - Manage memory for the JIT code generation in a logical,
@@ -56,13 +56,18 @@ static void *getMemory(unsigned NumBytes) {
 #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
 # define MAP_ANONYMOUS MAP_ANON
 #endif /* defined(MAP_ANON) && !defined(MAP_ANONYMOUS) */
-#define fd  0
 #elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
-#define fd -1
+/* nothing */
 #else
   std::cerr << "This architecture is not supported by the JIT!\n";
   abort();
 #endif
+
+#if defined(__linux__)
+#define fd 0
+#else
+#define fd -1
+#endif
   
   unsigned mmapFlags = MAP_PRIVATE|MAP_ANONYMOUS;
 #ifdef MAP_NORESERVE
@@ -111,7 +116,7 @@ void JITMemoryManager::endFunctionBody(unsigned char *FunctionEnd) {
 
 
 namespace {
-  /// Emitter - The JIT implementation of the MachineCodeEmiter, which is used
+  /// Emitter - The JIT implementation of the MachineCodeEmitter, which is used
   /// to output functions to memory for execution.
   class Emitter : public MachineCodeEmitter {
     JITMemoryManager MemMgr;
@@ -210,7 +215,6 @@ void Emitter::emitWord(unsigned W) {
   CurByte += sizeof(unsigned);
 }
 
-
 uint64_t Emitter::getGlobalValueAddress(GlobalValue *V) {
   // Try looking up the function to see if it is already compiled, if not return
   // 0.