llvm.org GIT mirror llvm / b81740d
Don't use std::make_unique. We still have to support C++11 standard libraries, make_unique is a C++14 feature. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240642 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 5 years ago
1 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
77 //===----------------------------------------------------------------------===//
88
99 #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h"
10 #include "llvm/ADT/STLExtras.h"
1011 #include "llvm/ADT/SmallVector.h"
1112 #include "gtest/gtest.h"
1213
3132 struct AllocatingTransform {
3233 std::unique_ptr
3334 operator()(std::unique_ptr Obj) const {
34 return std::make_unique(*Obj + 1);
35 return llvm::make_unique(*Obj + 1);
3536 }
3637 };
3738
5354 SymbolResolverPtrT Resolver) {
5455 EXPECT_EQ(MockManager, *MemMgr) << "MM should pass through";
5556 EXPECT_EQ(MockResolver, *Resolver) << "Resolver should pass through";
56 int I = 0;
57 size_t I = 0;
5758 for (auto &ObjPtr : Objects) {
5859 EXPECT_EQ(MockObjects[I++] + 1, *ObjPtr) << "Transform should be applied";
5960 }
224225
225226 // Test addObjectSet with T1 (allocating, unique pointers)
226227 std::vector> Objs1;
227 Objs1.push_back(std::make_unique(MockObject1));
228 Objs1.push_back(std::make_unique(MockObject2));
229 auto MM = std::make_unique(MockManager);
230 auto SR = std::make_unique(MockResolver);
228 Objs1.push_back(llvm::make_unique(MockObject1));
229 Objs1.push_back(llvm::make_unique(MockObject2));
230 auto MM = llvm::make_unique(MockManager);
231 auto SR = llvm::make_unique(MockResolver);
231232 M.expectAddObjectSet(Objs1, MM.get(), SR.get());
232233 auto H = T1.addObjectSet(Objs1, std::move(MM), std::move(SR));
233234 M.verifyAddObjectSet(H);
274275 M.verifyMapSectionAddress();
275276
276277 // Test takeOwnershipOfBuffers, using unique pointer to buffer set
277 auto MockBufferSetPtr = std::make_unique(366);
278 auto MockBufferSetPtr = llvm::make_unique(366);
278279 M.expectTakeOwnershipOfBuffers(H, MockBufferSetPtr.get());
279280 T2.takeOwnershipOfBuffers(H, std::move(MockBufferSetPtr));
280281 M.verifyTakeOwnershipOfBuffers();
292293 EXPECT_EQ(278, Mutatee) << "Expected incrementing transform";
293294
294295 // Verify transform getter (const)
295 auto OwnedObj = std::make_unique(288);
296 auto OwnedObj = llvm::make_unique(288);
296297 const auto &T1C = T1;
297298 OwnedObj = T1C.getTransform()(std::move(OwnedObj));
298299 EXPECT_EQ(289, *OwnedObj) << "Expected incrementing transform";