Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the

VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10544 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-12-20 01:46:27 +00:00
parent 61612df9cb
commit 4d326fa9be
7 changed files with 217 additions and 315 deletions

View File

@@ -15,7 +15,7 @@
//
//===----------------------------------------------------------------------===//
#include "VM.h"
#include "JIT.h"
#include "Support/DynamicLinker.h"
#include <iostream>
using namespace llvm;
@@ -28,7 +28,7 @@ static std::vector<void (*)()> AtExitHandlers;
/// calls to atexit(3), which we intercept and store in
/// AtExitHandlers.
///
void VM::runAtExitHandlers() {
void JIT::runAtExitHandlers() {
while (!AtExitHandlers.empty()) {
void (*Fn)() = AtExitHandlers.back();
AtExitHandlers.pop_back();
@@ -45,7 +45,7 @@ static void NoopFn() {}
// jit_exit - Used to intercept the "exit" library call.
static void jit_exit(int Status) {
VM::runAtExitHandlers(); // Run atexit handlers...
JIT::runAtExitHandlers(); // Run atexit handlers...
exit(Status);
}
@@ -61,7 +61,7 @@ static int jit_atexit(void (*Fn)(void)) {
/// 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;