summaryrefslogtreecommitdiff
path: root/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
diff options
context:
space:
mode:
authorAhmed Charles <ahmedcharles@gmail.com>2014-03-06 05:51:42 +0000
committerAhmed Charles <ahmedcharles@gmail.com>2014-03-06 05:51:42 +0000
commitf4ccd110750a3f3fe6a107d5c74c649c2a0dc407 (patch)
treeded9f38d17d1d9f3693d90f82a0a596726034174 /unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
parentca8b562f2d4d996d5198af537ad312e544da1172 (diff)
downloadllvm-f4ccd110750a3f3fe6a107d5c74c649c2a0dc407.tar.gz
llvm-f4ccd110750a3f3fe6a107d5c74c649c2a0dc407.tar.bz2
llvm-f4ccd110750a3f3fe6a107d5c74c649c2a0dc407.tar.xz
Replace OwningPtr<T> with std::unique_ptr<T>.
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ExecutionEngine/MCJIT/MCJITTestBase.h')
-rw-r--r--unittests/ExecutionEngine/MCJIT/MCJITTestBase.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
index a8f6b2b1b8..b2cb3bbef6 100644
--- a/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
+++ b/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
@@ -185,11 +185,9 @@ protected:
// Populates Modules A and B:
// Module A { Extern FB1, Function FA which calls FB1 },
// Module B { Extern FA, Function FB1, Function FB2 which calls FA },
- void createCrossModuleRecursiveCase(OwningPtr<Module> &A,
- Function *&FA,
- OwningPtr<Module> &B,
- Function *&FB1,
- Function *&FB2) {
+ void createCrossModuleRecursiveCase(std::unique_ptr<Module> &A, Function *&FA,
+ std::unique_ptr<Module> &B,
+ Function *&FB1, Function *&FB2) {
// Define FB1 in B.
B.reset(createEmptyModule("B"));
FB1 = insertAccumulateFunction(B.get(), 0, "FB1");
@@ -211,12 +209,10 @@ protected:
// Module A { Function FA },
// Module B { Extern FA, Function FB which calls FA },
// Module C { Extern FB, Function FC which calls FB },
- void createThreeModuleChainedCallsCase(OwningPtr<Module> &A,
- Function *&FA,
- OwningPtr<Module> &B,
- Function *&FB,
- OwningPtr<Module> &C,
- Function *&FC) {
+ void
+ createThreeModuleChainedCallsCase(std::unique_ptr<Module> &A, Function *&FA,
+ std::unique_ptr<Module> &B, Function *&FB,
+ std::unique_ptr<Module> &C, Function *&FC) {
A.reset(createEmptyModule("A"));
FA = insertAddFunction(A.get());
@@ -233,8 +229,8 @@ protected:
// Module A { Function FA },
// Populates Modules A and B:
// Module B { Function FB }
- void createTwoModuleCase(OwningPtr<Module> &A, Function *&FA,
- OwningPtr<Module> &B, Function *&FB) {
+ void createTwoModuleCase(std::unique_ptr<Module> &A, Function *&FA,
+ std::unique_ptr<Module> &B, Function *&FB) {
A.reset(createEmptyModule("A"));
FA = insertAddFunction(A.get());
@@ -244,8 +240,8 @@ protected:
// Module A { Function FA },
// Module B { Extern FA, Function FB which calls FA }
- void createTwoModuleExternCase(OwningPtr<Module> &A, Function *&FA,
- OwningPtr<Module> &B, Function *&FB) {
+ void createTwoModuleExternCase(std::unique_ptr<Module> &A, Function *&FA,
+ std::unique_ptr<Module> &B, Function *&FB) {
A.reset(createEmptyModule("A"));
FA = insertAddFunction(A.get());
@@ -258,12 +254,9 @@ protected:
// Module A { Function FA },
// Module B { Extern FA, Function FB which calls FA },
// Module C { Extern FB, Function FC which calls FA },
- void createThreeModuleCase(OwningPtr<Module> &A,
- Function *&FA,
- OwningPtr<Module> &B,
- Function *&FB,
- OwningPtr<Module> &C,
- Function *&FC) {
+ void createThreeModuleCase(std::unique_ptr<Module> &A, Function *&FA,
+ std::unique_ptr<Module> &B, Function *&FB,
+ std::unique_ptr<Module> &C, Function *&FC) {
A.reset(createEmptyModule("A"));
FA = insertAddFunction(A.get());
@@ -342,10 +335,10 @@ protected:
CodeModel::Model CodeModel;
StringRef MArch;
SmallVector<std::string, 1> MAttrs;
- OwningPtr<ExecutionEngine> TheJIT;
+ std::unique_ptr<ExecutionEngine> TheJIT;
RTDyldMemoryManager *MM;
- OwningPtr<Module> M;
+ std::unique_ptr<Module> M;
};
} // namespace llvm