remove the intrinsiclowering hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26970 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index b920898..ebe0254 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -160,24 +160,22 @@
/// NULL is returned.
///
ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
- bool ForceInterpreter,
- IntrinsicLowering *IL) {
+ bool ForceInterpreter) {
ExecutionEngine *EE = 0;
// Unless the interpreter was explicitly selected, try making a JIT.
if (!ForceInterpreter && JITCtor)
- EE = JITCtor(MP, IL);
+ EE = JITCtor(MP);
// If we can't make a JIT, make an interpreter instead.
if (EE == 0 && InterpCtor)
- EE = InterpCtor(MP, IL);
+ EE = InterpCtor(MP);
- if (EE == 0)
- delete IL;
- else
+ if (EE) {
// Make sure we can resolve symbols in the program as well. The zero arg
// to the function tells DynamicLibrary to load the program, not a library.
sys::DynamicLibrary::LoadLibraryPermanently(0);
+ }
return EE;
}
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
index 0f73189..37f16f5 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.cpp
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
@@ -26,8 +26,7 @@
/// create - Create a new interpreter object. This can never fail.
///
-ExecutionEngine *Interpreter::create(ModuleProvider *MP,
- IntrinsicLowering *IL) {
+ExecutionEngine *Interpreter::create(ModuleProvider *MP) {
Module *M;
try {
M = MP->materializeModule();
@@ -55,17 +54,16 @@
break;
}
- return new Interpreter(M, isLittleEndian, isLongPointer, IL);
+ return new Interpreter(M, isLittleEndian, isLongPointer);
}
//===----------------------------------------------------------------------===//
// Interpreter ctor - Initialize stuff
//
-Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer,
- IntrinsicLowering *il)
+Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer)
: ExecutionEngine(M),
TD("lli", isLittleEndian, isLongPointer ? 8 : 4, isLongPointer ? 8 : 4,
- isLongPointer ? 8 : 4), IL(il) {
+ isLongPointer ? 8 : 4) {
memset(&ExitValue, 0, sizeof(ExitValue));
setTargetData(TD);
@@ -74,7 +72,7 @@
initializeExternalFunctions();
emitGlobals();
- if (IL == 0) IL = new DefaultIntrinsicLowering();
+ IL = new DefaultIntrinsicLowering();
}
Interpreter::~Interpreter() {
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h
index 1b547a6..e0669c9 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -25,6 +25,7 @@
namespace llvm {
+class IntrinsicLowering;
struct FunctionInfo;
template<typename T> class generic_gep_type_iterator;
class ConstantExpr;
@@ -93,8 +94,7 @@
std::vector<Function*> AtExitHandlers;
public:
- Interpreter(Module *M, bool isLittleEndian, bool isLongPointer,
- IntrinsicLowering *IL);
+ Interpreter(Module *M, bool isLittleEndian, bool isLongPointer);
~Interpreter();
/// runAtExitHandlers - Run any functions registered by the program's calls to
@@ -106,11 +106,9 @@
InterpCtor = create;
}
- /// create - Create an interpreter ExecutionEngine. This can never fail. The
- /// specified IntrinsicLowering implementation will be deleted when the
- /// Interpreter execution engine is destroyed.
+ /// create - Create an interpreter ExecutionEngine. This can never fail.
///
- static ExecutionEngine *create(ModuleProvider *M, IntrinsicLowering *IL);
+ static ExecutionEngine *create(ModuleProvider *M);
/// run - Start execution with the specified function and arguments.
///
diff --git a/lib/ExecutionEngine/JIT/JIT.h b/lib/ExecutionEngine/JIT/JIT.h
index 979cdc6..fbdcf2e 100644
--- a/lib/ExecutionEngine/JIT/JIT.h
+++ b/lib/ExecutionEngine/JIT/JIT.h
@@ -69,11 +69,9 @@
TargetJITInfo &getJITInfo() const { return TJI; }
/// create - Create an return a new JIT compiler if there is one available
- /// for the current target. Otherwise, return null. If the JIT is created
- /// successfully, it takes responsibility for deleting the specified
- /// IntrinsicLowering implementation.
+ /// for the current target. Otherwise, return null.
///
- static ExecutionEngine *create(ModuleProvider *MP, IntrinsicLowering *IL = 0);
+ static ExecutionEngine *create(ModuleProvider *MP);
/// run - Start execution with the specified function and arguments.
///
diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp
index 592020f..05e86e6 100644
--- a/lib/ExecutionEngine/JIT/TargetSelect.cpp
+++ b/lib/ExecutionEngine/JIT/TargetSelect.cpp
@@ -39,7 +39,7 @@
/// create - Create an return a new JIT compiler if there is one available
/// for the current target. Otherwise, return null.
///
-ExecutionEngine *JIT::create(ModuleProvider *MP, IntrinsicLowering *IL) {
+ExecutionEngine *JIT::create(ModuleProvider *MP) {
if (MArch == 0) {
std::string Error;
MArch = TargetMachineRegistry::getClosestTargetForJIT(Error);
@@ -61,7 +61,7 @@
}
// Allocate a target...
- TargetMachine *Target = MArch->CtorFn(*MP->getModule(), IL, FeaturesStr);
+ TargetMachine *Target = MArch->CtorFn(*MP->getModule(), 0, FeaturesStr);
assert(Target && "Could not allocate target machine!");
// If the target supports JIT code generation, return a new JIT now.