From ab884fa603f8ba2147fe5d9c143f6e7f582e63c5 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 10 Feb 2015 23:46:48 +0000 Subject: [PATCH] Convert std::make_unique<> to llvm::make_unique<>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228768 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp | 9 +++++---- lib/DebugInfo/PDB/DIA/DIASession.cpp | 14 +++++++------- unittests/DebugInfo/PDB/PDBApiTest.cpp | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp b/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp index 5c94f6e16ea..268f8329349 100644 --- a/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp +++ b/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/STLExtras.h" #include "llvm/DebugInfo/PDB/PDBExtras.h" #include "llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h" #include "llvm/DebugInfo/PDB/DIA/DIARawSymbol.h" @@ -275,7 +276,7 @@ DIARawSymbol::findChildren(PDB_SymType Type) const { if (S_OK != Symbol->findChildren(EnumVal, nullptr, nsNone, &DiaEnumerator)) return nullptr; - return std::make_unique(Session, DiaEnumerator); + return llvm::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -293,7 +294,7 @@ DIARawSymbol::findChildren(PDB_SymType Type, StringRef Name, Symbol->findChildren(EnumVal, Name16Str, CompareFlags, &DiaEnumerator)) return nullptr; - return std::make_unique(Session, DiaEnumerator); + return llvm::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -312,7 +313,7 @@ DIARawSymbol::findChildrenByRVA(PDB_SymType Type, StringRef Name, &DiaEnumerator)) return nullptr; - return std::make_unique(Session, DiaEnumerator); + return llvm::make_unique(Session, DiaEnumerator); } std::unique_ptr @@ -321,7 +322,7 @@ DIARawSymbol::findInlineFramesByRVA(uint32_t RVA) const { if (S_OK != Symbol->findInlineFramesByRVA(RVA, &DiaEnumerator)) return nullptr; - return std::make_unique(Session, DiaEnumerator); + return llvm::make_unique(Session, DiaEnumerator); } void DIARawSymbol::getDataBytes(llvm::SmallVector &bytes) const { diff --git a/lib/DebugInfo/PDB/DIA/DIASession.cpp b/lib/DebugInfo/PDB/DIA/DIASession.cpp index 0df2354e018..fed6da81171 100644 --- a/lib/DebugInfo/PDB/DIA/DIASession.cpp +++ b/lib/DebugInfo/PDB/DIA/DIASession.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/STLExtras.h" #include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h" #include "llvm/DebugInfo/PDB/PDBSymbolExe.h" @@ -62,7 +63,7 @@ std::unique_ptr DIASession::getGlobalScope() const { if (S_OK != Session->get_globalScope(&GlobalScope)) return nullptr; - auto RawSymbol = std::make_unique(*this, GlobalScope); + auto RawSymbol = llvm::make_unique(*this, GlobalScope); auto PdbSymbol(PDBSymbol::create(*this, std::move(RawSymbol))); std::unique_ptr ExeSymbol( static_cast(PdbSymbol.release())); @@ -74,7 +75,7 @@ std::unique_ptr DIASession::getSymbolById(uint32_t SymbolId) const { if (S_OK != Session->symbolById(SymbolId, &LocatedSymbol)) return nullptr; - auto RawSymbol = std::make_unique(*this, LocatedSymbol); + auto RawSymbol = llvm::make_unique(*this, LocatedSymbol); return PDBSymbol::create(*this, std::move(RawSymbol)); } @@ -83,7 +84,7 @@ std::unique_ptr DIASession::getAllSourceFiles() const { if (S_OK != Session->findFile(nullptr, nullptr, nsNone, &Files)) return nullptr; - return std::make_unique(*this, Files); + return llvm::make_unique(*this, Files); } std::unique_ptr DIASession::getSourceFilesForCompiland( @@ -96,7 +97,7 @@ std::unique_ptr DIASession::getSourceFilesForCompiland( Session->findFile(RawSymbol.getDiaSymbol(), nullptr, nsNone, &Files)) return nullptr; - return std::make_unique(*this, Files); + return llvm::make_unique(*this, Files); } std::unique_ptr @@ -105,7 +106,7 @@ DIASession::getSourceFileById(uint32_t FileId) const { if (S_OK != Session->findFileById(FileId, &LocatedFile)) return nullptr; - return std::make_unique(*this, LocatedFile); + return llvm::make_unique(*this, LocatedFile); } std::unique_ptr DIASession::getDebugStreams() const { @@ -113,6 +114,5 @@ std::unique_ptr DIASession::getDebugStreams() const { if (S_OK != Session->getEnumDebugStreams(&DiaEnumerator)) return nullptr; - return std::unique_ptr( - new DIAEnumDebugStreams(DiaEnumerator)); + return llvm::make_unique(DiaEnumerator); } diff --git a/unittests/DebugInfo/PDB/PDBApiTest.cpp b/unittests/DebugInfo/PDB/PDBApiTest.cpp index 1917097c783..ba2024b36f6 100644 --- a/unittests/DebugInfo/PDB/PDBApiTest.cpp +++ b/unittests/DebugInfo/PDB/PDBApiTest.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -#include #include +#include "llvm/ADT/STLExtras.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h" #include "llvm/DebugInfo/PDB/IPDBSession.h" @@ -339,7 +339,7 @@ private: std::unique_ptr Session; void InsertItemWithTag(PDB_SymType Tag) { - auto RawSymbol = std::make_unique(*Session, Tag); + auto RawSymbol = llvm::make_unique(*Session, Tag); auto Symbol = PDBSymbol::create(*Session, std::move(RawSymbol)); SymbolMap.insert(std::make_pair(Tag, std::move(Symbol))); }