diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-19 04:04:25 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-19 04:04:25 +0000 |
| commit | 2a8a2795ee8edb8120d10c3c2af397f429b13c57 (patch) | |
| tree | f77e8ceaf358640f215dc0207854cb9d00975e08 /llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp | |
| parent | 687744d0114c46529def899ee6c67428cbdf3d92 (diff) | |
| download | llvm-2a8a2795ee8edb8120d10c3c2af397f429b13c57.zip llvm-2a8a2795ee8edb8120d10c3c2af397f429b13c57.tar.gz llvm-2a8a2795ee8edb8120d10c3c2af397f429b13c57.tar.bz2 | |
Make it explicit that ExecutionEngine takes ownership of the modules.
llvm-svn: 215967
Diffstat (limited to 'llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp')
| -rw-r--r-- | llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp b/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp index f23745c..06a176f 100644 --- a/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp +++ b/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp @@ -20,9 +20,10 @@ namespace { class ExecutionEngineTest : public testing::Test { protected: - ExecutionEngineTest() - : M(new Module("<main>", getGlobalContext())), Error(""), - Engine(EngineBuilder(M).setErrorStr(&Error).create()) { + ExecutionEngineTest() { + auto Owner = make_unique<Module>("<main>", getGlobalContext()); + M = Owner.get(); + Engine.reset(EngineBuilder(std::move(Owner)).setErrorStr(&Error).create()); } virtual void SetUp() { @@ -35,9 +36,9 @@ protected: GlobalValue::ExternalLinkage, nullptr, Name); } - Module *const M; std::string Error; - const std::unique_ptr<ExecutionEngine> Engine; + Module *M; // Owned by ExecutionEngine. + std::unique_ptr<ExecutionEngine> Engine; }; TEST_F(ExecutionEngineTest, ForwardGlobalMapping) { |
