//
//===----------------------------------------------------------------------===//
-#include "VM.h"
+#include "JIT.h"
#include "Support/DynamicLinker.h"
#include <iostream>
-
-namespace llvm {
+using namespace llvm;
// AtExitHandlers - List of functions to call when the program exits,
// registered with the atexit() library function.
/// calls to atexit(3), which we intercept and store in
/// AtExitHandlers.
///
-void VM::runAtExitHandlers() {
+static void runAtExitHandlers() {
while (!AtExitHandlers.empty()) {
void (*Fn)() = AtExitHandlers.back();
AtExitHandlers.pop_back();
// jit_exit - Used to intercept the "exit" library call.
static void jit_exit(int Status) {
- VM::runAtExitHandlers(); // Run atexit handlers...
+ runAtExitHandlers(); // Run atexit handlers...
exit(Status);
}
/// function by using the dynamic loader interface. As such it is only useful
/// for resolving library symbols, not code generated symbols.
///
-void *VM::getPointerToNamedFunction(const std::string &Name) {
+void *JIT::getPointerToNamedFunction(const std::string &Name) {
// Check to see if this is one of the functions we want to intercept...
if (Name == "exit") return (void*)&jit_exit;
if (Name == "atexit") return (void*)&jit_atexit;
return Ptr;
}
-
-} // End llvm namespace