Eliminate the dependency of ExecutionEngine on the JIT/Interpreter libraries.

Now you can build a tool with just the JIT or just the interpreter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26946 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-03-22 06:07:50 +00:00
parent 765c93cefd
commit 2fe4bb06c6
5 changed files with 35 additions and 21 deletions

View File

@ -17,11 +17,24 @@
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
using namespace llvm;
static struct RegisterInterp {
RegisterInterp() { Interpreter::Register(); }
} InterpRegistrator;
/// create - Create a new interpreter object. This can never fail.
///
ExecutionEngine *Interpreter::create(Module *M, IntrinsicLowering *IL) {
ExecutionEngine *Interpreter::create(ModuleProvider *MP,
IntrinsicLowering *IL) {
Module *M;
try {
M = MP->materializeModule();
} catch (...) {
return 0; // error materializing the module.
}
bool isLittleEndian = false;
switch (M->getEndianness()) {
case Module::LittleEndian: isLittleEndian = true; break;