diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-16 16:34:23 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-16 16:34:23 +0000 |
commit | a3fcefb66e8ed3dc45ab05b8e7983e9232606ac0 (patch) | |
tree | 4bf2eecbb623e76049d4355c47c35ee29b4c867d /llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | |
parent | f14af1621942f084a05a772f1e7d06636c0293f3 (diff) | |
download | bcm5719-llvm-a3fcefb66e8ed3dc45ab05b8e7983e9232606ac0.tar.gz bcm5719-llvm-a3fcefb66e8ed3dc45ab05b8e7983e9232606ac0.zip |
Make ExecutionEngine owning a DataLayout
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
The ExecutionEngine will act as an exception and will be unsafe to
be reused across context. We don't enforce this rule but undefined
behavior can occurs if the user tries to do it.
Reviewers: lhames
Subscribers: echristo, llvm-commits, rafael, yaron.keren
Differential Revision: http://reviews.llvm.org/D11110
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 242414
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp index f103c09659a..8cb9d45bb68 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp @@ -49,16 +49,15 @@ ExecutionEngine *Interpreter::create(std::unique_ptr<Module> M, // Interpreter ctor - Initialize stuff // Interpreter::Interpreter(std::unique_ptr<Module> M) - : ExecutionEngine(std::move(M)), TD(Modules.back().get()) { + : ExecutionEngine(std::move(M)) { memset(&ExitValue.Untyped, 0, sizeof(ExitValue.Untyped)); - setDataLayout(&TD); // Initialize the "backend" initializeExecutionEngine(); initializeExternalFunctions(); emitGlobals(); - IL = new IntrinsicLowering(TD); + IL = new IntrinsicLowering(getDataLayout()); } Interpreter::~Interpreter() { |