diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-15 15:54:37 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-08-15 15:54:37 +0000 |
commit | 0eaee545eef49ff9498234d3a51a5cbde59bf976 (patch) | |
tree | fd7691e102022fb97622c5485fa8c4f506fc124e /llvm/unittests | |
parent | 1c34d10776828c0756ff4f0b2b9aa8bda2be348a (diff) | |
download | bcm5719-llvm-0eaee545eef49ff9498234d3a51a5cbde59bf976.tar.gz bcm5719-llvm-0eaee545eef49ff9498234d3a51a5cbde59bf976.zip |
[llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.
llvm-svn: 369013
Diffstat (limited to 'llvm/unittests')
44 files changed, 177 insertions, 177 deletions
diff --git a/llvm/unittests/ADT/FunctionRefTest.cpp b/llvm/unittests/ADT/FunctionRefTest.cpp index a599bee7e15..5064a2975a9 100644 --- a/llvm/unittests/ADT/FunctionRefTest.cpp +++ b/llvm/unittests/ADT/FunctionRefTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/ADT/MakeUniqueTest.cpp - make_unique unit tests ------===// +//===- llvm/unittest/ADT/MakeUniqueTest.cpp - std::make_unique unit tests ------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/llvm/unittests/ADT/IteratorTest.cpp b/llvm/unittests/ADT/IteratorTest.cpp index f46f109d572..2f5abb64e7d 100644 --- a/llvm/unittests/ADT/IteratorTest.cpp +++ b/llvm/unittests/ADT/IteratorTest.cpp @@ -107,10 +107,10 @@ TEST(PointeeIteratorTest, Basic) { TEST(PointeeIteratorTest, SmartPointer) { SmallVector<std::unique_ptr<int>, 4> V; - V.push_back(make_unique<int>(1)); - V.push_back(make_unique<int>(2)); - V.push_back(make_unique<int>(3)); - V.push_back(make_unique<int>(4)); + V.push_back(std::make_unique<int>(1)); + V.push_back(std::make_unique<int>(2)); + V.push_back(std::make_unique<int>(3)); + V.push_back(std::make_unique<int>(4)); typedef pointee_iterator< SmallVectorImpl<std::unique_ptr<int>>::const_iterator> @@ -209,10 +209,10 @@ TEST(FilterIteratorTest, FunctionPointer) { TEST(FilterIteratorTest, Composition) { auto IsOdd = [](int N) { return N % 2 == 1; }; - std::unique_ptr<int> A[] = {make_unique<int>(0), make_unique<int>(1), - make_unique<int>(2), make_unique<int>(3), - make_unique<int>(4), make_unique<int>(5), - make_unique<int>(6)}; + std::unique_ptr<int> A[] = {make_unique<int>(0), std::make_unique<int>(1), + std::make_unique<int>(2), std::make_unique<int>(3), + std::make_unique<int>(4), std::make_unique<int>(5), + std::make_unique<int>(6)}; using PointeeIterator = pointee_iterator<std::unique_ptr<int> *>; auto Range = make_filter_range( make_range(PointeeIterator(std::begin(A)), PointeeIterator(std::end(A))), diff --git a/llvm/unittests/ADT/MakeUniqueTest.cpp b/llvm/unittests/ADT/MakeUniqueTest.cpp index c0c10969947..d643d09df7a 100644 --- a/llvm/unittests/ADT/MakeUniqueTest.cpp +++ b/llvm/unittests/ADT/MakeUniqueTest.cpp @@ -1,4 +1,4 @@ -//===- llvm/unittest/ADT/MakeUniqueTest.cpp - make_unique unit tests ------===// +//===- llvm/unittest/ADT/MakeUniqueTest.cpp - std::make_unique unit tests ------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -14,60 +14,60 @@ using namespace llvm; namespace { TEST(MakeUniqueTest, SingleObject) { - auto p0 = make_unique<int>(); + auto p0 = std::make_unique<int>(); EXPECT_TRUE((bool)p0); EXPECT_EQ(0, *p0); - auto p1 = make_unique<int>(5); + auto p1 = std::make_unique<int>(5); EXPECT_TRUE((bool)p1); EXPECT_EQ(5, *p1); - auto p2 = make_unique<std::tuple<int, int>>(0, 1); + auto p2 = std::make_unique<std::tuple<int, int>>(0, 1); EXPECT_TRUE((bool)p2); EXPECT_EQ(std::make_tuple(0, 1), *p2); - auto p3 = make_unique<std::tuple<int, int, int>>(0, 1, 2); + auto p3 = std::make_unique<std::tuple<int, int, int>>(0, 1, 2); EXPECT_TRUE((bool)p3); EXPECT_EQ(std::make_tuple(0, 1, 2), *p3); - auto p4 = make_unique<std::tuple<int, int, int, int>>(0, 1, 2, 3); + auto p4 = std::make_unique<std::tuple<int, int, int, int>>(0, 1, 2, 3); EXPECT_TRUE((bool)p4); EXPECT_EQ(std::make_tuple(0, 1, 2, 3), *p4); - auto p5 = make_unique<std::tuple<int, int, int, int, int>>(0, 1, 2, 3, 4); + auto p5 = std::make_unique<std::tuple<int, int, int, int, int>>(0, 1, 2, 3, 4); EXPECT_TRUE((bool)p5); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4), *p5); auto p6 = - make_unique<std::tuple<int, int, int, int, int, int>>(0, 1, 2, 3, 4, 5); + std::make_unique<std::tuple<int, int, int, int, int, int>>(0, 1, 2, 3, 4, 5); EXPECT_TRUE((bool)p6); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5), *p6); - auto p7 = make_unique<std::tuple<int, int, int, int, int, int, int>>( + auto p7 = std::make_unique<std::tuple<int, int, int, int, int, int, int>>( 0, 1, 2, 3, 4, 5, 6); EXPECT_TRUE((bool)p7); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6), *p7); - auto p8 = make_unique<std::tuple<int, int, int, int, int, int, int, int>>( + auto p8 = std::make_unique<std::tuple<int, int, int, int, int, int, int, int>>( 0, 1, 2, 3, 4, 5, 6, 7); EXPECT_TRUE((bool)p8); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7), *p8); auto p9 = - make_unique<std::tuple<int, int, int, int, int, int, int, int, int>>( + std::make_unique<std::tuple<int, int, int, int, int, int, int, int, int>>( 0, 1, 2, 3, 4, 5, 6, 7, 8); EXPECT_TRUE((bool)p9); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8), *p9); auto p10 = - make_unique<std::tuple<int, int, int, int, int, int, int, int, int, int>>( + std::make_unique<std::tuple<int, int, int, int, int, int, int, int, int, int>>( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); EXPECT_TRUE((bool)p10); EXPECT_EQ(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), *p10); } TEST(MakeUniqueTest, Array) { - auto p1 = make_unique<int[]>(2); + auto p1 = std::make_unique<int[]>(2); EXPECT_TRUE((bool)p1); EXPECT_EQ(0, p1[0]); EXPECT_EQ(0, p1[1]); diff --git a/llvm/unittests/ADT/MapVectorTest.cpp b/llvm/unittests/ADT/MapVectorTest.cpp index b8fdbdd0e0b..f7e5812f2e9 100644 --- a/llvm/unittests/ADT/MapVectorTest.cpp +++ b/llvm/unittests/ADT/MapVectorTest.cpp @@ -149,8 +149,8 @@ TEST(MapVectorTest, iteration_test) { TEST(MapVectorTest, NonCopyable) { MapVector<int, std::unique_ptr<int>> MV; - MV.insert(std::make_pair(1, llvm::make_unique<int>(1))); - MV.insert(std::make_pair(2, llvm::make_unique<int>(2))); + MV.insert(std::make_pair(1, std::make_unique<int>(1))); + MV.insert(std::make_pair(2, std::make_unique<int>(2))); ASSERT_EQ(MV.count(1), 1u); ASSERT_EQ(*MV.find(2)->second, 2); @@ -306,8 +306,8 @@ TEST(SmallMapVectorSmallTest, iteration_test) { TEST(SmallMapVectorSmallTest, NonCopyable) { SmallMapVector<int, std::unique_ptr<int>, 8> MV; - MV.insert(std::make_pair(1, llvm::make_unique<int>(1))); - MV.insert(std::make_pair(2, llvm::make_unique<int>(2))); + MV.insert(std::make_pair(1, std::make_unique<int>(1))); + MV.insert(std::make_pair(2, std::make_unique<int>(2))); ASSERT_EQ(MV.count(1), 1u); ASSERT_EQ(*MV.find(2)->second, 2); diff --git a/llvm/unittests/ADT/STLExtrasTest.cpp b/llvm/unittests/ADT/STLExtrasTest.cpp index 8704ddda265..4cbef904ca8 100644 --- a/llvm/unittests/ADT/STLExtrasTest.cpp +++ b/llvm/unittests/ADT/STLExtrasTest.cpp @@ -451,7 +451,7 @@ TEST(STLExtrasTest, to_address) { EXPECT_EQ(V1, to_address(V1)); // Check fancy pointer overload for unique_ptr - std::unique_ptr<int> V2 = make_unique<int>(0); + std::unique_ptr<int> V2 = std::make_unique<int>(0); EXPECT_EQ(V2.get(), to_address(V2)); V2.reset(V1); diff --git a/llvm/unittests/Analysis/MemorySSATest.cpp b/llvm/unittests/Analysis/MemorySSATest.cpp index bfdf37ee190..b470f162612 100644 --- a/llvm/unittests/Analysis/MemorySSATest.cpp +++ b/llvm/unittests/Analysis/MemorySSATest.cpp @@ -51,7 +51,7 @@ protected: : DT(*Test.F), AC(*Test.F), AA(Test.TLI), BAA(Test.DL, *Test.F, Test.TLI, AC, &DT) { AA.addAAResult(BAA); - MSSA = make_unique<MemorySSA>(*Test.F, &AA, &DT); + MSSA = std::make_unique<MemorySSA>(*Test.F, &AA, &DT); Walker = MSSA->getWalker(); } }; @@ -1431,7 +1431,7 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithPhiNotOpt) { MemorySSA &MSSA = *Analyses->MSSA; MemorySSAWalker *Walker = Analyses->Walker; std::unique_ptr<MemorySSAUpdater> MSSAU = - make_unique<MemorySSAUpdater>(&MSSA); + std::make_unique<MemorySSAUpdater>(&MSSA); MemoryPhi *Phi = MSSA.getMemoryAccess(Exit); EXPECT_EQ(Phi, Walker->getClobberingMemoryAccess(S1)); @@ -1493,7 +1493,7 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithPhiOpt) { MemorySSA &MSSA = *Analyses->MSSA; MemorySSAWalker *Walker = Analyses->Walker; std::unique_ptr<MemorySSAUpdater> MSSAU = - make_unique<MemorySSAUpdater>(&MSSA); + std::make_unique<MemorySSAUpdater>(&MSSA); MemoryDef *DefS1 = cast<MemoryDef>(MSSA.getMemoryAccess(S1)); EXPECT_EQ(DefS1, Walker->getClobberingMemoryAccess(S2)); @@ -1565,7 +1565,7 @@ TEST_F(MemorySSATest, TestAddedEdgeToBlockWithNoPhiAddNewPhis) { setupAnalyses(); MemorySSA &MSSA = *Analyses->MSSA; std::unique_ptr<MemorySSAUpdater> MSSAU = - make_unique<MemorySSAUpdater>(&MSSA); + std::make_unique<MemorySSAUpdater>(&MSSA); // Alter CFG, add edge: f -> c FBlock->getTerminator()->eraseFromParent(); diff --git a/llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp b/llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp index 3ac32aebeac..f98173a35a1 100644 --- a/llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp +++ b/llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp @@ -59,10 +59,10 @@ protected: MachineModuleInfo MMI(TM.get()); - MF = make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F), 0, + MF = std::make_unique<MachineFunction>(*F, *TM, *TM->getSubtargetImpl(*F), 0, MMI); - DAG = make_unique<SelectionDAG>(*TM, CodeGenOpt::None); + DAG = std::make_unique<SelectionDAG>(*TM, CodeGenOpt::None); if (!DAG) report_fatal_error("DAG?"); OptimizationRemarkEmitter ORE(F); diff --git a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp index 11983f72cb0..dea0fc7ed02 100644 --- a/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp +++ b/llvm/unittests/CodeGen/GlobalISel/CSETest.cpp @@ -22,7 +22,7 @@ TEST_F(GISelMITest, TestCSE) { auto MIBInput1 = B.buildInstr(TargetOpcode::G_TRUNC, {s16}, {Copies[1]}); auto MIBAdd = B.buildInstr(TargetOpcode::G_ADD, {s16}, {MIBInput, MIBInput}); GISelCSEInfo CSEInfo; - CSEInfo.setCSEConfig(make_unique<CSEConfigFull>()); + CSEInfo.setCSEConfig(std::make_unique<CSEConfigFull>()); CSEInfo.analyze(*MF); B.setCSEInfo(&CSEInfo); CSEMIRBuilder CSEB(B.getState()); @@ -84,7 +84,7 @@ TEST_F(GISelMITest, TestCSEConstantConfig) { auto MIBAdd = B.buildInstr(TargetOpcode::G_ADD, {s16}, {MIBInput, MIBInput}); auto MIBZero = B.buildConstant(s16, 0); GISelCSEInfo CSEInfo; - CSEInfo.setCSEConfig(make_unique<CSEConfigConstantOnly>()); + CSEInfo.setCSEConfig(std::make_unique<CSEConfigConstantOnly>()); CSEInfo.analyze(*MF); B.setCSEInfo(&CSEInfo); CSEMIRBuilder CSEB(B.getState()); diff --git a/llvm/unittests/CodeGen/GlobalISel/GISelMITest.h b/llvm/unittests/CodeGen/GlobalISel/GISelMITest.h index 37188760c1d..0af63b70eec 100644 --- a/llvm/unittests/CodeGen/GlobalISel/GISelMITest.h +++ b/llvm/unittests/CodeGen/GlobalISel/GISelMITest.h @@ -111,7 +111,7 @@ body: | )MIR") + Twine(MIRFunc) + Twine("...\n")) .toNullTerminatedStringRef(S); std::unique_ptr<MIRParser> MIR; - auto MMI = make_unique<MachineModuleInfo>(&TM); + auto MMI = std::make_unique<MachineModuleInfo>(&TM); std::unique_ptr<Module> M = parseMIR(Context, MIR, TM, MIRString, "func", *MMI); return make_pair(std::move(M), std::move(MMI)); diff --git a/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp b/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp index de6445175e4..5e7b750f194 100644 --- a/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp +++ b/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp @@ -98,7 +98,7 @@ body: | )MIR") + Twine(MIRFunc) + Twine("...\n")) .toNullTerminatedStringRef(S); std::unique_ptr<MIRParser> MIR; - auto MMI = make_unique<MachineModuleInfo>(&TM); + auto MMI = std::make_unique<MachineModuleInfo>(&TM); std::unique_ptr<Module> M = parseMIR(Context, MIR, TM, MIRString, "func", *MMI); return make_pair(std::move(M), std::move(MMI)); diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp index 67d0c5954cc..b94763a06b5 100644 --- a/llvm/unittests/CodeGen/MachineInstrTest.cpp +++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp @@ -136,7 +136,7 @@ private: }; std::unique_ptr<BogusTargetMachine> createTargetMachine() { - return llvm::make_unique<BogusTargetMachine>(); + return std::make_unique<BogusTargetMachine>(); } std::unique_ptr<MachineFunction> createMachineFunction() { @@ -150,7 +150,7 @@ std::unique_ptr<MachineFunction> createMachineFunction() { MachineModuleInfo MMI(TM.get()); const TargetSubtargetInfo &STI = *TM->getSubtargetImpl(*F); - return llvm::make_unique<MachineFunction>(*F, *TM, STI, FunctionNum, MMI); + return std::make_unique<MachineFunction>(*F, *TM, STI, FunctionNum, MMI); } // This test makes sure that MachineInstr::isIdenticalTo handles Defs correctly diff --git a/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp b/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp index ff01ef7e739..7a4000d9613 100644 --- a/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp +++ b/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp @@ -88,7 +88,7 @@ public: RandomAccessVisitorTest() {} static void SetUpTestCase() { - GlobalState = llvm::make_unique<GlobalTestState>(); + GlobalState = std::make_unique<GlobalTestState>(); AppendingTypeTableBuilder Builder(GlobalState->Allocator); @@ -120,7 +120,7 @@ public: static void TearDownTestCase() { GlobalState.reset(); } void SetUp() override { - TestState = llvm::make_unique<PerTestState>(); + TestState = std::make_unique<PerTestState>(); } void TearDown() override { TestState.reset(); } diff --git a/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp b/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp index d011db9fcd4..e00240d7427 100644 --- a/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp +++ b/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp @@ -25,8 +25,8 @@ public: void SetUp() override { Refs.clear(); - TTB = make_unique<AppendingTypeTableBuilder>(Storage); - CRB = make_unique<ContinuationRecordBuilder>(); + TTB = std::make_unique<AppendingTypeTableBuilder>(Storage); + CRB = std::make_unique<ContinuationRecordBuilder>(); Symbols.clear(); } diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp index d2c0f3c3b20..2e062e8fe96 100644 --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -446,7 +446,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) { return make_error<StringError>("no code emitter for target " + TripleName, inconvertibleErrorCode()); - Stream = make_unique<raw_svector_ostream>(FileBytes); + Stream = std::make_unique<raw_svector_ostream>(FileBytes); MS = TheTarget->createMCObjectStreamer( TheTriple, *MC, std::unique_ptr<MCAsmBackend>(MAB), @@ -469,7 +469,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) { MC->setDwarfVersion(Version); Asm->setDwarfVersion(Version); - StringPool = llvm::make_unique<DwarfStringPool>(Allocator, *Asm, StringRef()); + StringPool = std::make_unique<DwarfStringPool>(Allocator, *Asm, StringRef()); StringOffsetsStartSym = Asm->createTempSymbol("str_offsets_base"); return Error::success(); @@ -541,12 +541,12 @@ bool dwarfgen::Generator::saveFile(StringRef Path) { dwarfgen::CompileUnit &dwarfgen::Generator::addCompileUnit() { CompileUnits.push_back( - make_unique<CompileUnit>(*this, Version, Asm->getPointerSize())); + std::make_unique<CompileUnit>(*this, Version, Asm->getPointerSize())); return *CompileUnits.back(); } dwarfgen::LineTable &dwarfgen::Generator::addLineTable(DwarfFormat Format) { LineTables.push_back( - make_unique<LineTable>(Version, Format, Asm->getPointerSize())); + std::make_unique<LineTable>(Version, Format, Asm->getPointerSize())); return *LineTables.back(); } diff --git a/llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp b/llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp index 766f54d5206..f48e8379046 100644 --- a/llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp @@ -464,7 +464,7 @@ private: std::unique_ptr<IPDBSession> Session; void InsertItemWithTag(PDB_SymType Tag) { - auto RawSymbol = llvm::make_unique<MockRawSymbol>(Tag); + auto RawSymbol = std::make_unique<MockRawSymbol>(Tag); auto Symbol = PDBSymbol::create(*Session, std::move(RawSymbol)); SymbolMap.insert(std::make_pair(Tag, std::move(Symbol))); } diff --git a/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp b/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp index 77b1085a852..b92b3f6e984 100644 --- a/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp +++ b/llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp @@ -27,7 +27,7 @@ private: protected: ExecutionEngineTest() { - auto Owner = make_unique<Module>("<main>", Context); + auto Owner = std::make_unique<Module>("<main>", Context); M = Owner.get(); Engine.reset(EngineBuilder(std::move(Owner)).setErrorStr(&Error).create()); } diff --git a/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp b/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp index b0c6d5b4481..23f8a691c8f 100644 --- a/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp +++ b/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp @@ -71,7 +71,7 @@ Error JITLinkTestCommon::TestResources::initializeTripleSpecifics(Triple &TT) { if (!STI) report_fatal_error("Could not build MCSubtargetInfo for triple"); - DisCtx = llvm::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr); + DisCtx = std::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr); Dis.reset(TheTarget->createMCDisassembler(*STI, *DisCtx)); if (!Dis) @@ -83,7 +83,7 @@ Error JITLinkTestCommon::TestResources::initializeTripleSpecifics(Triple &TT) { void JITLinkTestCommon::TestResources::initializeTestSpecifics( StringRef AsmSrc, const Triple &TT, bool PIC, bool LargeCodeModel) { SrcMgr.AddNewSourceBuffer(MemoryBuffer::getMemBuffer(AsmSrc), SMLoc()); - AsCtx = llvm::make_unique<MCContext>(MAI.get(), MRI.get(), &MOFI, &SrcMgr); + AsCtx = std::make_unique<MCContext>(MAI.get(), MRI.get(), &MOFI, &SrcMgr); MOFI.InitMCObjectFileInfo(TT, PIC, *AsCtx, LargeCodeModel); std::unique_ptr<MCCodeEmitter> CE( @@ -131,7 +131,7 @@ JITLinkTestCommon::TestJITLinkContext::setMemoryManager( JITLinkMemoryManager & JITLinkTestCommon::TestJITLinkContext::getMemoryManager() { if (!MemMgr) - MemMgr = llvm::make_unique<InProcessMemoryManager>(); + MemMgr = std::make_unique<InProcessMemoryManager>(); return *MemMgr; } diff --git a/llvm/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp b/llvm/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp index 98c5d44d466..e051ad551c7 100644 --- a/llvm/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp +++ b/llvm/unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp @@ -39,7 +39,7 @@ public: return; } - auto JTCtx = llvm::make_unique<TestJITLinkContext>( + auto JTCtx = std::make_unique<TestJITLinkContext>( **TR, [&](AtomGraph &G) { RunGraphTest(G, (*TR)->getDisassembler()); }); JTCtx->externals() = std::move(Externals); diff --git a/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp index 375318c323f..d52ff4ba651 100644 --- a/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp @@ -37,7 +37,7 @@ TEST_F(CoreAPIsStandardTest, BasicSuccessfulLookup) { std::shared_ptr<MaterializationResponsibility> FooMR; - cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>( + cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooMR = std::make_shared<MaterializationResponsibility>(std::move(R)); @@ -105,7 +105,7 @@ TEST_F(CoreAPIsStandardTest, RemoveSymbolsTest) { // Bar will be unmaterialized. bool BarDiscarded = false; bool BarMaterializerDestructed = false; - cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>( + cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [this](MaterializationResponsibility R) { ADD_FAILURE() << "Unexpected materialization of \"Bar\""; @@ -122,7 +122,7 @@ TEST_F(CoreAPIsStandardTest, RemoveSymbolsTest) { // Baz will be in the materializing state initially, then // materialized for the final removal attempt. Optional<MaterializationResponsibility> BazR; - cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>( + cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Baz, BazSym.getFlags()}}), [&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); }, [](const JITDylib &JD, const SymbolStringPtr &Name) { @@ -217,7 +217,7 @@ TEST_F(CoreAPIsStandardTest, LookupFlagsTest) { BarSym.setFlags(static_cast<JITSymbolFlags::FlagNames>( JITSymbolFlags::Exported | JITSymbolFlags::Weak)); - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [](MaterializationResponsibility R) { llvm_unreachable("Symbol materialized on flags lookup"); @@ -251,7 +251,7 @@ TEST_F(CoreAPIsStandardTest, LookupWithGeneratorFailure) { } }; - JD.addGenerator(llvm::make_unique<BadGenerator>()); + JD.addGenerator(std::make_unique<BadGenerator>()); EXPECT_THAT_ERROR(JD.lookupFlags({Foo}).takeError(), Failed<StringError>()) << "Generator failure did not propagate through lookupFlags"; @@ -314,7 +314,7 @@ TEST_F(CoreAPIsStandardTest, TestThatReExportsDontUnnecessarilyMaterialize) { cantFail(JD.define(absoluteSymbols({{Foo, FooSym}}))); bool BarMaterialized = false; - auto BarMU = llvm::make_unique<SimpleMaterializationUnit>( + auto BarMU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { BarMaterialized = true; @@ -344,7 +344,7 @@ TEST_F(CoreAPIsStandardTest, TestReexportsGenerator) { auto Filter = [this](SymbolStringPtr Name) { return Name != Bar; }; - JD.addGenerator(llvm::make_unique<ReexportsGenerator>(JD2, false, Filter)); + JD.addGenerator(std::make_unique<ReexportsGenerator>(JD2, false, Filter)); auto Flags = cantFail(JD.lookupFlags({Foo, Bar, Baz})); EXPECT_EQ(Flags.size(), 1U) << "Unexpected number of results"; @@ -358,7 +358,7 @@ TEST_F(CoreAPIsStandardTest, TestReexportsGenerator) { TEST_F(CoreAPIsStandardTest, TestTrivialCircularDependency) { Optional<MaterializationResponsibility> FooR; - auto FooMU = llvm::make_unique<SimpleMaterializationUnit>( + auto FooMU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); }); @@ -394,15 +394,15 @@ TEST_F(CoreAPIsStandardTest, TestCircularDependenceInOneJITDylib) { // Create a MaterializationUnit for each symbol that moves the // MaterializationResponsibility into one of the locals above. - auto FooMU = llvm::make_unique<SimpleMaterializationUnit>( + auto FooMU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooR.emplace(std::move(R)); }); - auto BarMU = llvm::make_unique<SimpleMaterializationUnit>( + auto BarMU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { BarR.emplace(std::move(R)); }); - auto BazMU = llvm::make_unique<SimpleMaterializationUnit>( + auto BazMU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Baz, BazSym.getFlags()}}), [&](MaterializationResponsibility R) { BazR.emplace(std::move(R)); }); @@ -524,7 +524,7 @@ TEST_F(CoreAPIsStandardTest, DropMaterializerWhenEmpty) { JITSymbolFlags WeakExported(JITSymbolFlags::Exported); WeakExported |= JITSymbolFlags::Weak; - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, WeakExported}, {Bar, WeakExported}}), [](MaterializationResponsibility R) { llvm_unreachable("Unexpected call to materialize"); @@ -555,7 +555,7 @@ TEST_F(CoreAPIsStandardTest, AddAndMaterializeLazySymbol) { JITSymbolFlags WeakExported(JITSymbolFlags::Exported); WeakExported |= JITSymbolFlags::Weak; - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}, {Bar, WeakExported}}), [&](MaterializationResponsibility R) { assert(BarDiscarded && "Bar should have been discarded by this point"); @@ -597,7 +597,7 @@ TEST_F(CoreAPIsStandardTest, TestBasicWeakSymbolMaterialization) { BarSym.setFlags(BarSym.getFlags() | JITSymbolFlags::Weak); bool BarMaterialized = false; - auto MU1 = llvm::make_unique<SimpleMaterializationUnit>( + auto MU1 = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})), R.notifyEmitted(); @@ -605,7 +605,7 @@ TEST_F(CoreAPIsStandardTest, TestBasicWeakSymbolMaterialization) { }); bool DuplicateBarDiscarded = false; - auto MU2 = llvm::make_unique<SimpleMaterializationUnit>( + auto MU2 = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { ADD_FAILURE() << "Attempt to materialize Bar from the wrong unit"; @@ -644,7 +644,7 @@ TEST_F(CoreAPIsStandardTest, DefineMaterializingSymbol) { MU->doMaterialize(JD); }); - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { cantFail( @@ -690,7 +690,7 @@ TEST_F(CoreAPIsStandardTest, GeneratorTest) { SymbolMap Symbols; }; - JD.addGenerator(llvm::make_unique<TestGenerator>(SymbolMap({{Bar, BarSym}}))); + JD.addGenerator(std::make_unique<TestGenerator>(SymbolMap({{Bar, BarSym}}))); auto Result = cantFail(ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo, Bar})); @@ -701,7 +701,7 @@ TEST_F(CoreAPIsStandardTest, GeneratorTest) { } TEST_F(CoreAPIsStandardTest, FailResolution) { - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported | JITSymbolFlags::Weak}, {Bar, JITSymbolFlags::Exported | JITSymbolFlags::Weak}}), [&](MaterializationResponsibility R) { @@ -737,7 +737,7 @@ TEST_F(CoreAPIsStandardTest, FailEmissionEarly) { cantFail(JD.define(absoluteSymbols({{Baz, BazSym}}))); - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { R.notifyResolved(SymbolMap({{Foo, FooSym}, {Bar, BarSym}})); @@ -769,7 +769,7 @@ TEST_F(CoreAPIsStandardTest, FailEmissionEarly) { } TEST_F(CoreAPIsStandardTest, TestLookupWithUnthreadedMaterialization) { - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}), [&](MaterializationResponsibility R) { R.notifyResolved({{Foo, FooSym}}); @@ -821,14 +821,14 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) { bool FooMaterialized = false; bool BarMaterialized = false; - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { auto Requested = R.getRequestedSymbols(); EXPECT_EQ(Requested.size(), 1U) << "Expected one symbol requested"; EXPECT_EQ(*Requested.begin(), Foo) << "Expected \"Foo\" requested"; - auto NewMU = llvm::make_unique<SimpleMaterializationUnit>( + auto NewMU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R2) { R2.notifyResolved(SymbolMap({{Bar, BarSym}})); @@ -865,7 +865,7 @@ TEST_F(CoreAPIsStandardTest, TestGetRequestedSymbolsAndReplace) { } TEST_F(CoreAPIsStandardTest, TestMaterializationResponsibilityDelegation) { - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}, {Bar, BarSym.getFlags()}}), [&](MaterializationResponsibility R) { auto R2 = R.delegate({Bar}); @@ -896,11 +896,11 @@ TEST_F(CoreAPIsStandardTest, TestMaterializeWeakSymbol) { WeakExported &= JITSymbolFlags::Weak; std::unique_ptr<MaterializationResponsibility> FooResponsibility; - auto MU = llvm::make_unique<SimpleMaterializationUnit>( + auto MU = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, FooSym.getFlags()}}), [&](MaterializationResponsibility R) { FooResponsibility = - llvm::make_unique<MaterializationResponsibility>(std::move(R)); + std::make_unique<MaterializationResponsibility>(std::move(R)); }); cantFail(JD.define(MU)); @@ -911,7 +911,7 @@ TEST_F(CoreAPIsStandardTest, TestMaterializeWeakSymbol) { ES.lookup(JITDylibSearchList({{&JD, false}}), {Foo}, SymbolState::Ready, std::move(OnCompletion), NoDependenciesToRegister); - auto MU2 = llvm::make_unique<SimpleMaterializationUnit>( + auto MU2 = std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{Foo, JITSymbolFlags::Exported}}), [](MaterializationResponsibility R) { llvm_unreachable("This unit should never be materialized"); diff --git a/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp index 87d582b3c27..d4757e0f86e 100644 --- a/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp @@ -37,7 +37,7 @@ TEST_F(LazyReexportsTest, BasicLocalCallThroughManagerOperation) { bool DummyTargetMaterialized = false; - cantFail(JD.define(llvm::make_unique<SimpleMaterializationUnit>( + cantFail(JD.define(std::make_unique<SimpleMaterializationUnit>( SymbolFlagsMap({{DummyTarget, JITSymbolFlags::Exported}}), [&](MaterializationResponsibility R) { DummyTargetMaterialized = true; diff --git a/llvm/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp index 06b96f9fd38..59cd11c5e5a 100644 --- a/llvm/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp @@ -25,7 +25,7 @@ public: class DummyCallbackManager : public JITCompileCallbackManager { public: DummyCallbackManager(ExecutionSession &ES) - : JITCompileCallbackManager(llvm::make_unique<DummyTrampolinePool>(), ES, + : JITCompileCallbackManager(std::make_unique<DummyTrampolinePool>(), ES, 0) {} }; @@ -78,7 +78,7 @@ TEST(LegacyCompileOnDemandLayerTest, FindSymbol) { llvm::orc::LegacyCompileOnDemandLayer<decltype(TestBaseLayer)> COD( AcknowledgeORCv1Deprecation, ES, TestBaseLayer, GetResolver, SetResolver, [](Function &F) { return std::set<Function *>{&F}; }, CallbackMgr, - [] { return llvm::make_unique<DummyStubsManager>(); }, true); + [] { return std::make_unique<DummyStubsManager>(); }, true); auto Sym = COD.findSymbol("foo", true); diff --git a/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp index 001019daa4b..3f0f85b69a7 100644 --- a/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp @@ -75,7 +75,7 @@ TEST(LegacyRTDyldObjectLinkingLayerTest, TestSetProcessAllSections) { }); LLVMContext Context; - auto M = llvm::make_unique<Module>("", Context); + auto M = std::make_unique<Module>("", Context); M->setTargetTriple("x86_64-unknown-linux-gnu"); Type *Int32Ty = IntegerType::get(Context, 32); GlobalVariable *GV = diff --git a/llvm/unittests/ExecutionEngine/Orc/QueueChannel.h b/llvm/unittests/ExecutionEngine/Orc/QueueChannel.h index 56a3926ee65..511f038dec1 100644 --- a/llvm/unittests/ExecutionEngine/Orc/QueueChannel.h +++ b/llvm/unittests/ExecutionEngine/Orc/QueueChannel.h @@ -135,8 +135,8 @@ inline std::pair<std::unique_ptr<QueueChannel>, std::unique_ptr<QueueChannel>> createPairedQueueChannels() { auto Q1 = std::make_shared<Queue>(); auto Q2 = std::make_shared<Queue>(); - auto C1 = llvm::make_unique<QueueChannel>(Q1, Q2); - auto C2 = llvm::make_unique<QueueChannel>(Q2, Q1); + auto C1 = std::make_unique<QueueChannel>(Q1, Q2); + auto C2 = std::make_unique<QueueChannel>(Q2, Q1); return std::make_pair(std::move(C1), std::move(C2)); } diff --git a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp index 440b840faaa..ecb8cf65393 100644 --- a/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp @@ -54,7 +54,7 @@ static bool testSetProcessAllSections(std::unique_ptr<MemoryBuffer> Obj, auto Foo = ES.intern("foo"); RTDyldObjectLinkingLayer ObjLayer(ES, [&DebugSectionSeen]() { - return llvm::make_unique<MemoryManagerWrapper>(DebugSectionSeen); + return std::make_unique<MemoryManagerWrapper>(DebugSectionSeen); }); auto OnResolveDoNothing = [](Expected<SymbolMap> R) { @@ -71,7 +71,7 @@ static bool testSetProcessAllSections(std::unique_ptr<MemoryBuffer> Obj, TEST(RTDyldObjectLinkingLayerTest, TestSetProcessAllSections) { LLVMContext Context; - auto M = llvm::make_unique<Module>("", Context); + auto M = std::make_unique<Module>("", Context); M->setTargetTriple("x86_64-unknown-linux-gnu"); Type *Int32Ty = IntegerType::get(Context, 32); GlobalVariable *GV = @@ -123,7 +123,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) { }; // Create a module with two void() functions: foo and bar. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); ThreadSafeModule M; { ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy"); @@ -153,7 +153,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) { auto &JD = ES.createJITDylib("main"); auto Foo = ES.intern("foo"); RTDyldObjectLinkingLayer ObjLayer( - ES, []() { return llvm::make_unique<SectionMemoryManager>(); }); + ES, []() { return std::make_unique<SectionMemoryManager>(); }); IRCompileLayer CompileLayer(ES, ObjLayer, FunkySimpleCompiler(*TM)); ObjLayer.setOverrideObjectFlagsWithResponsibilityFlags(true); @@ -196,7 +196,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) { }; // Create a module with two void() functions: foo and bar. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); ThreadSafeModule M; { ModuleBuilder MB(*TSCtx.getContext(), TM->getTargetTriple().str(), "dummy"); @@ -218,7 +218,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) { auto &JD = ES.createJITDylib("main"); auto Foo = ES.intern("foo"); RTDyldObjectLinkingLayer ObjLayer( - ES, []() { return llvm::make_unique<SectionMemoryManager>(); }); + ES, []() { return std::make_unique<SectionMemoryManager>(); }); IRCompileLayer CompileLayer(ES, ObjLayer, FunkySimpleCompiler(*TM)); ObjLayer.setAutoClaimResponsibilityForObjectSymbols(true); diff --git a/llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp index b50c5f99707..1ffb06db659 100644 --- a/llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp @@ -21,36 +21,36 @@ namespace { TEST(ThreadSafeModuleTest, ContextWhollyOwnedByOneModule) { // Test that ownership of a context can be transferred to a single // ThreadSafeModule. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); - auto M = llvm::make_unique<Module>("M", *TSCtx.getContext()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); + auto M = std::make_unique<Module>("M", *TSCtx.getContext()); ThreadSafeModule TSM(std::move(M), std::move(TSCtx)); } TEST(ThreadSafeModuleTest, ContextOwnershipSharedByTwoModules) { // Test that ownership of a context can be shared between more than one // ThreadSafeModule. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); - auto M1 = llvm::make_unique<Module>("M1", *TSCtx.getContext()); + auto M1 = std::make_unique<Module>("M1", *TSCtx.getContext()); ThreadSafeModule TSM1(std::move(M1), TSCtx); - auto M2 = llvm::make_unique<Module>("M2", *TSCtx.getContext()); + auto M2 = std::make_unique<Module>("M2", *TSCtx.getContext()); ThreadSafeModule TSM2(std::move(M2), std::move(TSCtx)); } TEST(ThreadSafeModuleTest, ContextOwnershipSharedWithClient) { // Test that ownership of a context can be shared with a client-held // ThreadSafeContext so that it can be re-used for new modules. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); { // Create and destroy a module. - auto M1 = llvm::make_unique<Module>("M1", *TSCtx.getContext()); + auto M1 = std::make_unique<Module>("M1", *TSCtx.getContext()); ThreadSafeModule TSM1(std::move(M1), TSCtx); } // Verify that the context is still available for re-use. - auto M2 = llvm::make_unique<Module>("M2", *TSCtx.getContext()); + auto M2 = std::make_unique<Module>("M2", *TSCtx.getContext()); ThreadSafeModule TSM2(std::move(M2), std::move(TSCtx)); } @@ -58,16 +58,16 @@ TEST(ThreadSafeModuleTest, ThreadSafeModuleMoveAssignment) { // Move assignment needs to move the module before the context (opposite // to the field order) to ensure that overwriting with an empty // ThreadSafeModule does not destroy the context early. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); - auto M = llvm::make_unique<Module>("M", *TSCtx.getContext()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); + auto M = std::make_unique<Module>("M", *TSCtx.getContext()); ThreadSafeModule TSM(std::move(M), std::move(TSCtx)); TSM = ThreadSafeModule(); } TEST(ThreadSafeModuleTest, BasicContextLockAPI) { // Test that basic lock API calls work. - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); - auto M = llvm::make_unique<Module>("M", *TSCtx.getContext()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); + auto M = std::make_unique<Module>("M", *TSCtx.getContext()); ThreadSafeModule TSM(std::move(M), TSCtx); { auto L = TSCtx.getLock(); } @@ -84,10 +84,10 @@ TEST(ThreadSafeModuleTest, ContextLockPreservesContext) { // has been destroyed) even though all references to the context have // been thrown away (apart from the lock). - ThreadSafeContext TSCtx(llvm::make_unique<LLVMContext>()); + ThreadSafeContext TSCtx(std::make_unique<LLVMContext>()); auto L = TSCtx.getLock(); auto &Ctx = *TSCtx.getContext(); - auto M = llvm::make_unique<Module>("M", Ctx); + auto M = std::make_unique<Module>("M", Ctx); TSCtx = ThreadSafeContext(); } diff --git a/llvm/unittests/FuzzMutate/StrategiesTest.cpp b/llvm/unittests/FuzzMutate/StrategiesTest.cpp index 9ef88e22682..e710f467622 100644 --- a/llvm/unittests/FuzzMutate/StrategiesTest.cpp +++ b/llvm/unittests/FuzzMutate/StrategiesTest.cpp @@ -32,10 +32,10 @@ std::unique_ptr<IRMutator> createInjectorMutator() { std::vector<std::unique_ptr<IRMutationStrategy>> Strategies; Strategies.push_back( - llvm::make_unique<InjectorIRStrategy>( + std::make_unique<InjectorIRStrategy>( InjectorIRStrategy::getDefaultOps())); - return llvm::make_unique<IRMutator>(std::move(Types), std::move(Strategies)); + return std::make_unique<IRMutator>(std::move(Types), std::move(Strategies)); } std::unique_ptr<IRMutator> createDeleterMutator() { @@ -44,9 +44,9 @@ std::unique_ptr<IRMutator> createDeleterMutator() { Type::getInt64Ty, Type::getFloatTy, Type::getDoubleTy}; std::vector<std::unique_ptr<IRMutationStrategy>> Strategies; - Strategies.push_back(llvm::make_unique<InstDeleterIRStrategy>()); + Strategies.push_back(std::make_unique<InstDeleterIRStrategy>()); - return llvm::make_unique<IRMutator>(std::move(Types), std::move(Strategies)); + return std::make_unique<IRMutator>(std::move(Types), std::move(Strategies)); } std::unique_ptr<Module> parseAssembly( @@ -79,7 +79,7 @@ TEST(InjectorIRStrategyTest, EmptyModule) { // Test that we can inject into empty module LLVMContext Ctx; - auto M = llvm::make_unique<Module>("M", Ctx); + auto M = std::make_unique<Module>("M", Ctx); ASSERT_TRUE(M && !verifyModule(*M, &errs())); auto Mutator = createInjectorMutator(); diff --git a/llvm/unittests/IR/CFGBuilder.cpp b/llvm/unittests/IR/CFGBuilder.cpp index 1ce598799ca..424a83bb635 100644 --- a/llvm/unittests/IR/CFGBuilder.cpp +++ b/llvm/unittests/IR/CFGBuilder.cpp @@ -20,8 +20,8 @@ using namespace llvm; CFGHolder::CFGHolder(StringRef ModuleName, StringRef FunctionName) - : Context(llvm::make_unique<LLVMContext>()), - M(llvm::make_unique<Module>(ModuleName, *Context)) { + : Context(std::make_unique<LLVMContext>()), + M(std::make_unique<Module>(ModuleName, *Context)) { FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Context), {}, false); F = Function::Create(FTy, Function::ExternalLinkage, FunctionName, M.get()); } diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp index c1bce90d69a..fa0dc61d3df 100644 --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -34,7 +34,7 @@ TEST(ContextAndReplaceableUsesTest, FromContext) { TEST(ContextAndReplaceableUsesTest, FromReplaceableUses) { LLVMContext Context; - ContextAndReplaceableUses CRU(make_unique<ReplaceableMetadataImpl>(Context)); + ContextAndReplaceableUses CRU(std::make_unique<ReplaceableMetadataImpl>(Context)); EXPECT_EQ(&Context, &CRU.getContext()); EXPECT_TRUE(CRU.hasReplaceableUses()); EXPECT_TRUE(CRU.getReplaceableUses()); @@ -43,7 +43,7 @@ TEST(ContextAndReplaceableUsesTest, FromReplaceableUses) { TEST(ContextAndReplaceableUsesTest, makeReplaceable) { LLVMContext Context; ContextAndReplaceableUses CRU(Context); - CRU.makeReplaceable(make_unique<ReplaceableMetadataImpl>(Context)); + CRU.makeReplaceable(std::make_unique<ReplaceableMetadataImpl>(Context)); EXPECT_EQ(&Context, &CRU.getContext()); EXPECT_TRUE(CRU.hasReplaceableUses()); EXPECT_TRUE(CRU.getReplaceableUses()); @@ -51,7 +51,7 @@ TEST(ContextAndReplaceableUsesTest, makeReplaceable) { TEST(ContextAndReplaceableUsesTest, takeReplaceableUses) { LLVMContext Context; - auto ReplaceableUses = make_unique<ReplaceableMetadataImpl>(Context); + auto ReplaceableUses = std::make_unique<ReplaceableMetadataImpl>(Context); auto *Ptr = ReplaceableUses.get(); ContextAndReplaceableUses CRU(std::move(ReplaceableUses)); ReplaceableUses = CRU.takeReplaceableUses(); diff --git a/llvm/unittests/IR/TimePassesTest.cpp b/llvm/unittests/IR/TimePassesTest.cpp index a76652202b8..fb70503209d 100644 --- a/llvm/unittests/IR/TimePassesTest.cpp +++ b/llvm/unittests/IR/TimePassesTest.cpp @@ -127,7 +127,7 @@ TEST(TimePassesTest, CustomOut) { // Setup time-passes handler and redirect output to the stream. std::unique_ptr<TimePassesHandler> TimePasses = - llvm::make_unique<TimePassesHandler>(true); + std::make_unique<TimePassesHandler>(true); TimePasses->setOutStream(ReportStream); TimePasses->registerCallbacks(PIC); diff --git a/llvm/unittests/Linker/LinkModulesTest.cpp b/llvm/unittests/Linker/LinkModulesTest.cpp index 832e50c19ee..05523c56cc2 100644 --- a/llvm/unittests/Linker/LinkModulesTest.cpp +++ b/llvm/unittests/Linker/LinkModulesTest.cpp @@ -277,7 +277,7 @@ TEST_F(LinkModuleTest, MoveDistinctMDs) { EXPECT_EQ(M3, M4->getOperand(0)); // Link into destination module. - auto Dst = llvm::make_unique<Module>("Linked", C); + auto Dst = std::make_unique<Module>("Linked", C); ASSERT_TRUE(Dst.get()); Ctx.setDiagnosticHandlerCallBack(expectNoDiags); Linker::linkModules(*Dst, std::move(Src)); @@ -346,7 +346,7 @@ TEST_F(LinkModuleTest, RemangleIntrinsics) { ASSERT_TRUE(Bar->getFunction("llvm.memset.p0s_struct.rtx_def.0s.i32")); // Link two modules together. - auto Dst = llvm::make_unique<Module>("Linked", C); + auto Dst = std::make_unique<Module>("Linked", C); ASSERT_TRUE(Dst.get()); Ctx.setDiagnosticHandlerCallBack(expectNoDiags); bool Failed = Linker::linkModules(*Foo, std::move(Bar)); diff --git a/llvm/unittests/MC/DwarfLineTables.cpp b/llvm/unittests/MC/DwarfLineTables.cpp index af1250daee5..88e9565e1ca 100644 --- a/llvm/unittests/MC/DwarfLineTables.cpp +++ b/llvm/unittests/MC/DwarfLineTables.cpp @@ -38,7 +38,7 @@ struct Context { MRI.reset(TheTarget->createMCRegInfo(Triple)); MAI.reset(TheTarget->createMCAsmInfo(*MRI, Triple)); - Ctx = llvm::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr); + Ctx = std::make_unique<MCContext>(MAI.get(), MRI.get(), nullptr); } operator bool() { return Ctx.get(); } diff --git a/llvm/unittests/ProfileData/CoverageMappingTest.cpp b/llvm/unittests/ProfileData/CoverageMappingTest.cpp index 6b94fa16bfa..82e7574d15c 100644 --- a/llvm/unittests/ProfileData/CoverageMappingTest.cpp +++ b/llvm/unittests/ProfileData/CoverageMappingTest.cpp @@ -234,12 +234,12 @@ struct CoverageMappingTest : ::testing::TestWithParam<std::pair<bool, bool>> { for (const auto &OF : OutputFunctions) { ArrayRef<OutputFunctionCoverageData> Funcs(OF); CoverageReaders.push_back( - make_unique<CoverageMappingReaderMock>(Funcs)); + std::make_unique<CoverageMappingReaderMock>(Funcs)); } } else { ArrayRef<OutputFunctionCoverageData> Funcs(OutputFunctions); CoverageReaders.push_back( - make_unique<CoverageMappingReaderMock>(Funcs)); + std::make_unique<CoverageMappingReaderMock>(Funcs)); } return CoverageMapping::load(CoverageReaders, *ProfileReader); } diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp index b1e515984a4..3e862aafcf0 100644 --- a/llvm/unittests/ProfileData/InstrProfTest.cpp +++ b/llvm/unittests/ProfileData/InstrProfTest.cpp @@ -889,7 +889,7 @@ TEST_P(MaybeSparseInstrProfTest, instr_prof_bogus_symtab_empty_func_name) { // Testing symtab creator interface used by value profile transformer. TEST_P(MaybeSparseInstrProfTest, instr_prof_symtab_module_test) { LLVMContext Ctx; - std::unique_ptr<Module> M = llvm::make_unique<Module>("MyModule.cpp", Ctx); + std::unique_ptr<Module> M = std::make_unique<Module>("MyModule.cpp", Ctx); FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx), /*isVarArg=*/false); Function::Create(FTy, Function::ExternalLinkage, "Gfoo", M.get()); diff --git a/llvm/unittests/Support/BinaryStreamTest.cpp b/llvm/unittests/Support/BinaryStreamTest.cpp index 5291a31013c..6d6ecc45c90 100644 --- a/llvm/unittests/Support/BinaryStreamTest.cpp +++ b/llvm/unittests/Support/BinaryStreamTest.cpp @@ -144,8 +144,8 @@ protected: for (uint32_t I = 0; I < NumEndians; ++I) { auto InByteStream = - llvm::make_unique<BinaryByteStream>(InputData, Endians[I]); - auto InBrokenStream = llvm::make_unique<BrokenStream>( + std::make_unique<BinaryByteStream>(InputData, Endians[I]); + auto InBrokenStream = std::make_unique<BrokenStream>( BrokenInputData, Endians[I], Align); Streams[I * 2].Input = std::move(InByteStream); @@ -159,8 +159,8 @@ protected: for (uint32_t I = 0; I < NumEndians; ++I) { Streams[I * 2].Output = - llvm::make_unique<MutableBinaryByteStream>(OutputData, Endians[I]); - Streams[I * 2 + 1].Output = llvm::make_unique<BrokenStream>( + std::make_unique<MutableBinaryByteStream>(OutputData, Endians[I]); + Streams[I * 2 + 1].Output = std::make_unique<BrokenStream>( BrokenOutputData, Endians[I], Align); } } @@ -168,8 +168,8 @@ protected: void initializeOutputFromInput(uint32_t Align) { for (uint32_t I = 0; I < NumEndians; ++I) { Streams[I * 2].Output = - llvm::make_unique<MutableBinaryByteStream>(InputData, Endians[I]); - Streams[I * 2 + 1].Output = llvm::make_unique<BrokenStream>( + std::make_unique<MutableBinaryByteStream>(InputData, Endians[I]); + Streams[I * 2 + 1].Output = std::make_unique<BrokenStream>( BrokenInputData, Endians[I], Align); } } @@ -177,8 +177,8 @@ protected: void initializeInputFromOutput(uint32_t Align) { for (uint32_t I = 0; I < NumEndians; ++I) { Streams[I * 2].Input = - llvm::make_unique<BinaryByteStream>(OutputData, Endians[I]); - Streams[I * 2 + 1].Input = llvm::make_unique<BrokenStream>( + std::make_unique<BinaryByteStream>(OutputData, Endians[I]); + Streams[I * 2 + 1].Input = std::make_unique<BrokenStream>( BrokenOutputData, Endians[I], Align); } } diff --git a/llvm/unittests/Support/Casting.cpp b/llvm/unittests/Support/Casting.cpp index bcdaca94a3c..a196fc2ec5e 100644 --- a/llvm/unittests/Support/Casting.cpp +++ b/llvm/unittests/Support/Casting.cpp @@ -193,12 +193,12 @@ TEST(CastingTest, dyn_cast_or_null) { EXPECT_NE(F5, null_foo); } -std::unique_ptr<derived> newd() { return llvm::make_unique<derived>(); } -std::unique_ptr<base> newb() { return llvm::make_unique<derived>(); } +std::unique_ptr<derived> newd() { return std::make_unique<derived>(); } +std::unique_ptr<base> newb() { return std::make_unique<derived>(); } TEST(CastingTest, unique_dyn_cast) { derived *OrigD = nullptr; - auto D = llvm::make_unique<derived>(); + auto D = std::make_unique<derived>(); OrigD = D.get(); // Converting from D to itself is valid, it should return a new unique_ptr diff --git a/llvm/unittests/Support/FileCheckTest.cpp b/llvm/unittests/Support/FileCheckTest.cpp index d85690d633b..375f8960c10 100644 --- a/llvm/unittests/Support/FileCheckTest.cpp +++ b/llvm/unittests/Support/FileCheckTest.cpp @@ -87,9 +87,9 @@ TEST_F(FileCheckTest, NumericVariable) { // returns true, getValue and eval return value of expression, setValue // clears expression. std::unique_ptr<FileCheckNumericVariableUse> FooVarUsePtr = - llvm::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar); + std::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar); std::unique_ptr<FileCheckExpressionLiteral> One = - llvm::make_unique<FileCheckExpressionLiteral>(1); + std::make_unique<FileCheckExpressionLiteral>(1); FileCheckASTBinop Binop = FileCheckASTBinop(doAdd, std::move(FooVarUsePtr), std::move(One)); FileCheckNumericVariable FoobarExprVar = @@ -126,11 +126,11 @@ TEST_F(FileCheckTest, Binop) { FileCheckNumericVariable FooVar = FileCheckNumericVariable("FOO", 1); FooVar.setValue(42); std::unique_ptr<FileCheckNumericVariableUse> FooVarUse = - llvm::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar); + std::make_unique<FileCheckNumericVariableUse>("FOO", &FooVar); FileCheckNumericVariable BarVar = FileCheckNumericVariable("BAR", 2); BarVar.setValue(18); std::unique_ptr<FileCheckNumericVariableUse> BarVarUse = - llvm::make_unique<FileCheckNumericVariableUse>("BAR", &BarVar); + std::make_unique<FileCheckNumericVariableUse>("BAR", &BarVar); FileCheckASTBinop Binop = FileCheckASTBinop(doAdd, std::move(FooVarUse), std::move(BarVarUse)); @@ -453,8 +453,8 @@ TEST_F(FileCheckTest, Substitution) { LineVar.setValue(42); NVar.setValue(10); auto LineVarUse = - llvm::make_unique<FileCheckNumericVariableUse>("@LINE", &LineVar); - auto NVarUse = llvm::make_unique<FileCheckNumericVariableUse>("N", &NVar); + std::make_unique<FileCheckNumericVariableUse>("@LINE", &LineVar); + auto NVarUse = std::make_unique<FileCheckNumericVariableUse>("N", &NVar); FileCheckNumericSubstitution SubstitutionLine = FileCheckNumericSubstitution( &Context, "@LINE", std::move(LineVarUse), 12); FileCheckNumericSubstitution SubstitutionN = diff --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/Support/Host.cpp index ec9dd951a9f..4562d933df7 100644 --- a/llvm/unittests/Support/Host.cpp +++ b/llvm/unittests/Support/Host.cpp @@ -273,7 +273,7 @@ static bool runAndGetCommandOutput( Size = ::lseek(FD, 0, SEEK_END); ASSERT_NE(-1, Size); ::lseek(FD, 0, SEEK_SET); - Buffer = llvm::make_unique<char[]>(Size); + Buffer = std::make_unique<char[]>(Size); ASSERT_EQ(::read(FD, Buffer.get(), Size), Size); ::close(FD); diff --git a/llvm/unittests/Support/TrigramIndexTest.cpp b/llvm/unittests/Support/TrigramIndexTest.cpp index 9b10daa86e8..42b3fcdbd53 100644 --- a/llvm/unittests/Support/TrigramIndexTest.cpp +++ b/llvm/unittests/Support/TrigramIndexTest.cpp @@ -22,7 +22,7 @@ protected: std::unique_ptr<TrigramIndex> makeTrigramIndex( std::vector<std::string> Rules) { std::unique_ptr<TrigramIndex> TI = - make_unique<TrigramIndex>(); + std::make_unique<TrigramIndex>(); for (auto &Rule : Rules) TI->insert(Rule); return TI; diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp index e02f68f2ace..0c9df117031 100644 --- a/llvm/unittests/Support/YAMLIOTest.cpp +++ b/llvm/unittests/Support/YAMLIOTest.cpp @@ -2841,19 +2841,19 @@ template <> struct PolymorphicTraits<std::unique_ptr<Poly>> { static Scalar &getAsScalar(std::unique_ptr<Poly> &N) { if (!N || !isa<Scalar>(*N)) - N = llvm::make_unique<Scalar>(); + N = std::make_unique<Scalar>(); return *cast<Scalar>(N.get()); } static Seq &getAsSequence(std::unique_ptr<Poly> &N) { if (!N || !isa<Seq>(*N)) - N = llvm::make_unique<Seq>(); + N = std::make_unique<Seq>(); return *cast<Seq>(N.get()); } static Map &getAsMap(std::unique_ptr<Poly> &N) { if (!N || !isa<Map>(*N)) - N = llvm::make_unique<Map>(); + N = std::make_unique<Map>(); return *cast<Map>(N.get()); } }; @@ -2932,7 +2932,7 @@ template <> struct SequenceTraits<Seq> { TEST(YAMLIO, TestReadWritePolymorphicScalar) { std::string intermediate; - std::unique_ptr<Poly> node = llvm::make_unique<Scalar>(true); + std::unique_ptr<Poly> node = std::make_unique<Scalar>(true); llvm::raw_string_ostream ostr(intermediate); Output yout(ostr); @@ -2946,9 +2946,9 @@ TEST(YAMLIO, TestReadWritePolymorphicScalar) { TEST(YAMLIO, TestReadWritePolymorphicSeq) { std::string intermediate; { - auto seq = llvm::make_unique<Seq>(); - seq->push_back(llvm::make_unique<Scalar>(true)); - seq->push_back(llvm::make_unique<Scalar>(1.0)); + auto seq = std::make_unique<Seq>(); + seq->push_back(std::make_unique<Scalar>(true)); + seq->push_back(std::make_unique<Scalar>(1.0)); auto node = llvm::unique_dyn_cast<Poly>(seq); llvm::raw_string_ostream ostr(intermediate); @@ -2978,9 +2978,9 @@ TEST(YAMLIO, TestReadWritePolymorphicSeq) { TEST(YAMLIO, TestReadWritePolymorphicMap) { std::string intermediate; { - auto map = llvm::make_unique<Map>(); - (*map)["foo"] = llvm::make_unique<Scalar>(false); - (*map)["bar"] = llvm::make_unique<Scalar>(2.0); + auto map = std::make_unique<Map>(); + (*map)["foo"] = std::make_unique<Scalar>(false); + (*map)["bar"] = std::make_unique<Scalar>(2.0); std::unique_ptr<Poly> node = llvm::unique_dyn_cast<Poly>(map); llvm::raw_string_ostream ostr(intermediate); diff --git a/llvm/unittests/Target/AArch64/InstSizes.cpp b/llvm/unittests/Target/AArch64/InstSizes.cpp index a70f43c4379..8214d4f4113 100644 --- a/llvm/unittests/Target/AArch64/InstSizes.cpp +++ b/llvm/unittests/Target/AArch64/InstSizes.cpp @@ -30,7 +30,7 @@ std::unique_ptr<LLVMTargetMachine> createTargetMachine() { std::unique_ptr<AArch64InstrInfo> createInstrInfo(TargetMachine *TM) { AArch64Subtarget ST(TM->getTargetTriple(), TM->getTargetCPU(), TM->getTargetFeatureString(), *TM, /* isLittle */ false); - return llvm::make_unique<AArch64InstrInfo>(ST); + return std::make_unique<AArch64InstrInfo>(ST); } /// The \p InputIRSnippet is only needed for things that can't be expressed in diff --git a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp index 690f4340068..a586ac7bb20 100644 --- a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp +++ b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp @@ -66,9 +66,9 @@ TEST(ValueMapperTest, mapMDNodeCycle) { TEST(ValueMapperTest, mapMDNodeDuplicatedCycle) { LLVMContext Context; auto *PtrTy = Type::getInt8Ty(Context)->getPointerTo(); - std::unique_ptr<GlobalVariable> G0 = llvm::make_unique<GlobalVariable>( + std::unique_ptr<GlobalVariable> G0 = std::make_unique<GlobalVariable>( PtrTy, false, GlobalValue::ExternalLinkage, nullptr, "G0"); - std::unique_ptr<GlobalVariable> G1 = llvm::make_unique<GlobalVariable>( + std::unique_ptr<GlobalVariable> G1 = std::make_unique<GlobalVariable>( PtrTy, false, GlobalValue::ExternalLinkage, nullptr, "G1"); // Create a cycle that references G0. diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h b/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h index 3ee811a6830..d0bf3cf1a65 100644 --- a/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h +++ b/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h @@ -48,7 +48,7 @@ protected: VPlanPtr buildHCFG(BasicBlock *LoopHeader) { doAnalysis(*LoopHeader->getParent()); - auto Plan = llvm::make_unique<VPlan>(); + auto Plan = std::make_unique<VPlan>(); VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan); HCFGBuilder.buildHierarchicalCFG(); return Plan; @@ -58,7 +58,7 @@ protected: VPlanPtr buildPlainCFG(BasicBlock *LoopHeader) { doAnalysis(*LoopHeader->getParent()); - auto Plan = llvm::make_unique<VPlan>(); + auto Plan = std::make_unique<VPlan>(); VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan); VPRegionBlock *TopRegion = HCFGBuilder.buildPlainCFG(); Plan->setEntry(TopRegion); diff --git a/llvm/unittests/XRay/FDRProducerConsumerTest.cpp b/llvm/unittests/XRay/FDRProducerConsumerTest.cpp index e1fa0e345d2..6eff4dfcc50 100644 --- a/llvm/unittests/XRay/FDRProducerConsumerTest.cpp +++ b/llvm/unittests/XRay/FDRProducerConsumerTest.cpp @@ -34,43 +34,43 @@ using ::testing::SizeIs; template <class RecordType> std::unique_ptr<Record> MakeRecord(); template <> std::unique_ptr<Record> MakeRecord<NewBufferRecord>() { - return make_unique<NewBufferRecord>(1); + return std::make_unique<NewBufferRecord>(1); } template <> std::unique_ptr<Record> MakeRecord<NewCPUIDRecord>() { - return make_unique<NewCPUIDRecord>(1, 2); + return std::make_unique<NewCPUIDRecord>(1, 2); } template <> std::unique_ptr<Record> MakeRecord<TSCWrapRecord>() { - return make_unique<TSCWrapRecord>(1); + return std::make_unique<TSCWrapRecord>(1); } template <> std::unique_ptr<Record> MakeRecord<WallclockRecord>() { - return make_unique<WallclockRecord>(1, 2); + return std::make_unique<WallclockRecord>(1, 2); } template <> std::unique_ptr<Record> MakeRecord<CustomEventRecord>() { - return make_unique<CustomEventRecord>(4, 1, 2, "data"); + return std::make_unique<CustomEventRecord>(4, 1, 2, "data"); } template <> std::unique_ptr<Record> MakeRecord<CallArgRecord>() { - return make_unique<CallArgRecord>(1); + return std::make_unique<CallArgRecord>(1); } template <> std::unique_ptr<Record> MakeRecord<PIDRecord>() { - return make_unique<PIDRecord>(1); + return std::make_unique<PIDRecord>(1); } template <> std::unique_ptr<Record> MakeRecord<FunctionRecord>() { - return make_unique<FunctionRecord>(RecordTypes::ENTER, 1, 2); + return std::make_unique<FunctionRecord>(RecordTypes::ENTER, 1, 2); } template <> std::unique_ptr<Record> MakeRecord<CustomEventRecordV5>() { - return make_unique<CustomEventRecordV5>(4, 1, "data"); + return std::make_unique<CustomEventRecordV5>(4, 1, "data"); } template <> std::unique_ptr<Record> MakeRecord<TypedEventRecord>() { - return make_unique<TypedEventRecord>(4, 1, 2, "data"); + return std::make_unique<TypedEventRecord>(4, 1, 2, "data"); } template <class T> class RoundTripTest : public ::testing::Test { @@ -82,7 +82,7 @@ public: H.NonstopTSC = true; H.CycleFrequency = 3e9; - Writer = make_unique<FDRTraceWriter>(OS, H); + Writer = std::make_unique<FDRTraceWriter>(OS, H); Rec = MakeRecord<T>(); } @@ -105,7 +105,7 @@ public: H.NonstopTSC = true; H.CycleFrequency = 3e9; - Writer = make_unique<FDRTraceWriter>(OS, H); + Writer = std::make_unique<FDRTraceWriter>(OS, H); Rec = MakeRecord<T>(); } diff --git a/llvm/unittests/XRay/FDRRecordPrinterTest.cpp b/llvm/unittests/XRay/FDRRecordPrinterTest.cpp index 39c1e866f04..bfee1c5d388 100644 --- a/llvm/unittests/XRay/FDRRecordPrinterTest.cpp +++ b/llvm/unittests/XRay/FDRRecordPrinterTest.cpp @@ -22,7 +22,7 @@ template <class RecordType> struct Helper {}; template <> struct Helper<BufferExtents> { static std::unique_ptr<Record> construct() { - return make_unique<BufferExtents>(1); + return std::make_unique<BufferExtents>(1); } static const char *expected() { return "<Buffer: size = 1 bytes>"; } @@ -30,7 +30,7 @@ template <> struct Helper<BufferExtents> { template <> struct Helper<WallclockRecord> { static std::unique_ptr<Record> construct() { - return make_unique<WallclockRecord>(1, 2); + return std::make_unique<WallclockRecord>(1, 2); } static const char *expected() { return "<Wall Time: seconds = 1.000002>"; } @@ -38,7 +38,7 @@ template <> struct Helper<WallclockRecord> { template <> struct Helper<NewCPUIDRecord> { static std::unique_ptr<Record> construct() { - return make_unique<NewCPUIDRecord>(1, 2); + return std::make_unique<NewCPUIDRecord>(1, 2); } static const char *expected() { return "<CPU: id = 1, tsc = 2>"; } @@ -46,7 +46,7 @@ template <> struct Helper<NewCPUIDRecord> { template <> struct Helper<TSCWrapRecord> { static std::unique_ptr<Record> construct() { - return make_unique<TSCWrapRecord>(1); + return std::make_unique<TSCWrapRecord>(1); } static const char *expected() { return "<TSC Wrap: base = 1>"; } @@ -54,7 +54,7 @@ template <> struct Helper<TSCWrapRecord> { template <> struct Helper<CustomEventRecord> { static std::unique_ptr<Record> construct() { - return make_unique<CustomEventRecord>(4, 1, 2, "data"); + return std::make_unique<CustomEventRecord>(4, 1, 2, "data"); } static const char *expected() { @@ -64,7 +64,7 @@ template <> struct Helper<CustomEventRecord> { template <> struct Helper<CallArgRecord> { static std::unique_ptr<Record> construct() { - return make_unique<CallArgRecord>(1); + return std::make_unique<CallArgRecord>(1); } static const char *expected() { @@ -74,7 +74,7 @@ template <> struct Helper<CallArgRecord> { template <> struct Helper<PIDRecord> { static std::unique_ptr<Record> construct() { - return make_unique<PIDRecord>(1); + return std::make_unique<PIDRecord>(1); } static const char *expected() { return "<PID: 1>"; } @@ -82,7 +82,7 @@ template <> struct Helper<PIDRecord> { template <> struct Helper<NewBufferRecord> { static std::unique_ptr<Record> construct() { - return make_unique<NewBufferRecord>(1); + return std::make_unique<NewBufferRecord>(1); } static const char *expected() { return "<Thread ID: 1>"; } @@ -90,7 +90,7 @@ template <> struct Helper<NewBufferRecord> { template <> struct Helper<EndBufferRecord> { static std::unique_ptr<Record> construct() { - return make_unique<EndBufferRecord>(); + return std::make_unique<EndBufferRecord>(); } static const char *expected() { return "<End of Buffer>"; } |