From b81740d1468cd6af257ae89bb141d2fa478752d8 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 25 Jun 2015 13:47:36 +0000 Subject: [PATCH] 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 --- .../Orc/ObjectTransformLayerTest.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp b/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp index 772ed5e706d..41b2307cadd 100644 --- a/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "gtest/gtest.h" @@ -32,7 +33,7 @@ typedef int MockMemoryBufferSet; struct AllocatingTransform { std::unique_ptr operator()(std::unique_ptr Obj) const { - return std::make_unique(*Obj + 1); + return llvm::make_unique(*Obj + 1); } }; @@ -54,7 +55,7 @@ public: SymbolResolverPtrT Resolver) { EXPECT_EQ(MockManager, *MemMgr) << "MM should pass through"; EXPECT_EQ(MockResolver, *Resolver) << "Resolver should pass through"; - int I = 0; + size_t I = 0; for (auto &ObjPtr : Objects) { EXPECT_EQ(MockObjects[I++] + 1, *ObjPtr) << "Transform should be applied"; } @@ -225,10 +226,10 @@ TEST(ObjectTransformLayerTest, Main) { // Test addObjectSet with T1 (allocating, unique pointers) std::vector> Objs1; - Objs1.push_back(std::make_unique(MockObject1)); - Objs1.push_back(std::make_unique(MockObject2)); - auto MM = std::make_unique(MockManager); - auto SR = std::make_unique(MockResolver); + Objs1.push_back(llvm::make_unique(MockObject1)); + Objs1.push_back(llvm::make_unique(MockObject2)); + auto MM = llvm::make_unique(MockManager); + auto SR = llvm::make_unique(MockResolver); M.expectAddObjectSet(Objs1, MM.get(), SR.get()); auto H = T1.addObjectSet(Objs1, std::move(MM), std::move(SR)); M.verifyAddObjectSet(H); @@ -275,7 +276,7 @@ TEST(ObjectTransformLayerTest, Main) { M.verifyMapSectionAddress(); // Test takeOwnershipOfBuffers, using unique pointer to buffer set - auto MockBufferSetPtr = std::make_unique(366); + auto MockBufferSetPtr = llvm::make_unique(366); M.expectTakeOwnershipOfBuffers(H, MockBufferSetPtr.get()); T2.takeOwnershipOfBuffers(H, std::move(MockBufferSetPtr)); M.verifyTakeOwnershipOfBuffers(); @@ -293,7 +294,7 @@ TEST(ObjectTransformLayerTest, Main) { EXPECT_EQ(278, Mutatee) << "Expected incrementing transform"; // Verify transform getter (const) - auto OwnedObj = std::make_unique(288); + auto OwnedObj = llvm::make_unique(288); const auto &T1C = T1; OwnedObj = T1C.getTransform()(std::move(OwnedObj)); EXPECT_EQ(289, *OwnedObj) << "Expected incrementing transform";