summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-28 09:44:37 +0000
committerChris Lattner <sabre@nondot.org>2003-12-28 09:44:37 +0000
commit7301178aac1baf1cc334e7c7a66bfe50a65fbf49 (patch)
treea336d1188122315a48ebcca0a11f2eeb207b9289 /lib/ExecutionEngine/Interpreter/Interpreter.cpp
parentf8742b3e033ff69649a3a76c12e28a1428858880 (diff)
downloadllvm-7301178aac1baf1cc334e7c7a66bfe50a65fbf49.tar.gz
llvm-7301178aac1baf1cc334e7c7a66bfe50a65fbf49.tar.bz2
llvm-7301178aac1baf1cc334e7c7a66bfe50a65fbf49.tar.xz
Pass around IntrinsicLowering instances as appropriate.
Reimplement the Interpreters implementation of va_* to be more direct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Interpreter.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Interpreter.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
index 77c008730f..46e5ef0b6a 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.cpp
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
@@ -14,13 +14,14 @@
//===----------------------------------------------------------------------===//
#include "Interpreter.h"
-#include "llvm/Module.h"
+#include "llvm/IntrinsicLowering.h"
#include "llvm/DerivedTypes.h"
+#include "llvm/Module.h"
using namespace llvm;
/// create - Create a new interpreter object. This can never fail.
///
-ExecutionEngine *Interpreter::create(Module *M){
+ExecutionEngine *Interpreter::create(Module *M, IntrinsicLowering *IL) {
bool isLittleEndian = false;
switch (M->getEndianness()) {
case Module::LittleEndian: isLittleEndian = true; break;
@@ -41,22 +42,29 @@ ExecutionEngine *Interpreter::create(Module *M){
break;
}
- return new Interpreter(M, isLittleEndian, isLongPointer);
+ return new Interpreter(M, isLittleEndian, isLongPointer, IL);
}
//===----------------------------------------------------------------------===//
// Interpreter ctor - Initialize stuff
//
-Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer)
- : ExecutionEngine(M), ExitCode(0),
+Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer,
+ IntrinsicLowering *il)
+ : ExecutionEngine(M), ExitCode(0),
TD("lli", isLittleEndian, isLongPointer ? 8 : 4, isLongPointer ? 8 : 4,
- isLongPointer ? 8 : 4) {
+ isLongPointer ? 8 : 4), IL(il) {
setTargetData(TD);
// Initialize the "backend"
initializeExecutionEngine();
initializeExternalFunctions();
emitGlobals();
+
+ if (IL == 0) IL = new DefaultIntrinsicLowering();
+}
+
+Interpreter::~Interpreter() {
+ delete IL;
}
void Interpreter::runAtExitHandlers () {