summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-22 06:07:50 +0000
committerChris Lattner <sabre@nondot.org>2006-03-22 06:07:50 +0000
commit2d52c1b8b9cda559f86a29ba1c8967ce7f768700 (patch)
tree89fb8d119dfaebd2afdfab1d283bcc458399a7b1 /llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
parentd3a3365904fa73ceb1a48add7e168366a861c124 (diff)
downloadbcm5719-llvm-2d52c1b8b9cda559f86a29ba1c8967ce7f768700.tar.gz
bcm5719-llvm-2d52c1b8b9cda559f86a29ba1c8967ce7f768700.zip
Eliminate the dependency of ExecutionEngine on the JIT/Interpreter libraries.
Now you can build a tool with just the JIT or just the interpreter. llvm-svn: 26946
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
index af23bf11beb..0f73189a9e5 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
@@ -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;
OpenPOWER on IntegriCloud