[llvm-commits] CVS: llvm/tools/lli/JIT/Intercept.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed May 14 08:28:01 PDT 2003


Changes in directory llvm/tools/lli/JIT:

Intercept.cpp updated: 1.1 -> 1.2

---
Log message:

Fix compilation problems with previous checking *blush*


---
Diffs of the changes:

Index: llvm/tools/lli/JIT/Intercept.cpp
diff -u llvm/tools/lli/JIT/Intercept.cpp:1.1 llvm/tools/lli/JIT/Intercept.cpp:1.2
--- llvm/tools/lli/JIT/Intercept.cpp:1.1	Wed May 14 08:26:47 2003
+++ llvm/tools/lli/JIT/Intercept.cpp	Wed May 14 08:27:36 2003
@@ -10,6 +10,7 @@
 
 #include "VM.h"
 #include <dlfcn.h>    // dlsym access
+#include <iostream>
 
 //===----------------------------------------------------------------------===//
 // Function stubs that are invoked instead of raw system calls
@@ -25,7 +26,7 @@
 
 // jit_atexit - Used to intercept the "at_exit" system call.
 static int jit_atexit(void (*Fn)(void)) {
-  atexit(Fn);    // Do nothing for now.
+  return atexit(Fn);    // Do nothing for now.
 }
 
 //===----------------------------------------------------------------------===//
@@ -36,8 +37,8 @@
 ///
 void *VM::getPointerToNamedFunction(const std::string &Name) {
   // Check to see if this is one of the functions we want to intercept...
-  if (Name == "exit") return jit_exit;
-  if (Name == "at_exit") return jit_atexit;
+  if (Name == "exit") return (void*)&jit_exit;
+  if (Name == "at_exit") return (void*)&jit_atexit;
 
   // If it's an external function, look it up in the process image...
   void *Ptr = dlsym(0, Name.c_str());





More information about the llvm-commits mailing list