summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-03-14 21:32:34 +0000
committerReid Kleckner <rnk@google.com>2018-03-14 21:32:34 +0000
commitc7fd1540b3009e576060b3ed01e59370efd8da0a (patch)
tree9b4c1e157754d1f6d289bbd298b9dcf82d454a49 /llvm/unittests/ExecutionEngine/Orc
parent11f7f9908b139f480c9571c723ddffa3e8e7a08c (diff)
downloadbcm5719-llvm-c7fd1540b3009e576060b3ed01e59370efd8da0a.tar.gz
bcm5719-llvm-c7fd1540b3009e576060b3ed01e59370efd8da0a.zip
Revert "[ORC] Switch from shared_ptr to unique_ptr for addModule methods."
This reverts commit r327566, it breaks test/ExecutionEngine/OrcMCJIT/test-global-ctors.ll. The test doesn't crash with a stack trace, unfortunately. It merely returns 1 as the exit code. ASan didn't produce a report, and I reproduced this on my Linux machine and Windows box. llvm-svn: 327576
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp3
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp13
2 files changed, 10 insertions, 6 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp
index eacd3e0b0f9..3d0ee365f1c 100644
--- a/llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp
@@ -14,7 +14,6 @@
#include "llvm/ExecutionEngine/Orc/NullResolver.h"
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
-#include "llvm/IR/Module.h"
#include "llvm/Object/ObjectFile.h"
#include "gtest/gtest.h"
@@ -303,7 +302,7 @@ TEST(ObjectTransformLayerTest, Main) {
// Make sure that the calls from IRCompileLayer to ObjectTransformLayer
// compile.
cantFail(CompileLayer.addModule(ES.allocateVModule(),
- std::unique_ptr<llvm::Module>()));
+ std::shared_ptr<llvm::Module>()));
// Make sure that the calls from ObjectTransformLayer to ObjectLinkingLayer
// compile.
diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
index f053407a478..ca445b4d4e1 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
@@ -73,8 +73,9 @@ protected:
CompileContext *CCtx = static_cast<CompileContext*>(Ctx);
auto *ET = CCtx->APIExecTest;
CCtx->M = ET->createTestModule(ET->TM->getTargetTriple());
- LLVMOrcAddEagerlyCompiledIR(JITStack, &CCtx->H, wrap(CCtx->M.release()),
- myResolver, nullptr);
+ LLVMSharedModuleRef SM = LLVMOrcMakeSharedModule(wrap(CCtx->M.release()));
+ LLVMOrcAddEagerlyCompiledIR(JITStack, &CCtx->H, SM, myResolver, nullptr);
+ LLVMOrcDisposeSharedModuleRef(SM);
CCtx->Compiled = true;
LLVMOrcTargetAddress MainAddr;
LLVMOrcGetSymbolAddress(JITStack, &MainAddr, "main");
@@ -96,8 +97,10 @@ TEST_F(OrcCAPIExecutionTest, TestEagerIRCompilation) {
LLVMOrcGetMangledSymbol(JIT, &testFuncName, "testFunc");
+ LLVMSharedModuleRef SM = LLVMOrcMakeSharedModule(wrap(M.release()));
LLVMOrcModuleHandle H;
- LLVMOrcAddEagerlyCompiledIR(JIT, &H, wrap(M.release()), myResolver, nullptr);
+ LLVMOrcAddEagerlyCompiledIR(JIT, &H, SM, myResolver, nullptr);
+ LLVMOrcDisposeSharedModuleRef(SM);
LLVMOrcTargetAddress MainAddr;
LLVMOrcGetSymbolAddress(JIT, &MainAddr, "main");
MainFnTy MainFn = (MainFnTy)MainAddr;
@@ -122,8 +125,10 @@ TEST_F(OrcCAPIExecutionTest, TestLazyIRCompilation) {
LLVMOrcGetMangledSymbol(JIT, &testFuncName, "testFunc");
+ LLVMSharedModuleRef SM = LLVMOrcMakeSharedModule(wrap(M.release()));
LLVMOrcModuleHandle H;
- LLVMOrcAddLazilyCompiledIR(JIT, &H, wrap(M.release()), myResolver, nullptr);
+ LLVMOrcAddLazilyCompiledIR(JIT, &H, SM, myResolver, nullptr);
+ LLVMOrcDisposeSharedModuleRef(SM);
LLVMOrcTargetAddress MainAddr;
LLVMOrcGetSymbolAddress(JIT, &MainAddr, "main");
MainFnTy MainFn = (MainFnTy)MainAddr;
OpenPOWER on IntegriCloud