summaryrefslogtreecommitdiff
path: root/lib/DebugInfo
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 /lib/DebugInfo
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 'lib/DebugInfo')
-rw-r--r--lib/DebugInfo/DWARFContext.cpp10
-rw-r--r--lib/DebugInfo/DWARFContext.h13
-rw-r--r--lib/DebugInfo/DWARFUnit.h7
3 files changed, 14 insertions, 16 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp
index 5cce8df521..37e86bd92d 100644
--- a/lib/DebugInfo/DWARFContext.cpp
+++ b/lib/DebugInfo/DWARFContext.cpp
@@ -301,7 +301,7 @@ void DWARFContext::parseCompileUnits() {
const DataExtractor &DIData = DataExtractor(getInfoSection().Data,
isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
- OwningPtr<DWARFCompileUnit> CU(new DWARFCompileUnit(
+ std::unique_ptr<DWARFCompileUnit> CU(new DWARFCompileUnit(
getDebugAbbrev(), getInfoSection().Data, getAbbrevSection(),
getRangeSection(), getStringSection(), StringRef(), getAddrSection(),
&getInfoSection().Relocs, isLittleEndian()));
@@ -321,7 +321,7 @@ void DWARFContext::parseTypeUnits() {
const DataExtractor &DIData =
DataExtractor(I->second.Data, isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
- OwningPtr<DWARFTypeUnit> TU(new DWARFTypeUnit(
+ std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(
getDebugAbbrev(), I->second.Data, getAbbrevSection(),
getRangeSection(), getStringSection(), StringRef(), getAddrSection(),
&I->second.Relocs, isLittleEndian()));
@@ -338,7 +338,7 @@ void DWARFContext::parseDWOCompileUnits() {
const DataExtractor &DIData =
DataExtractor(getInfoDWOSection().Data, isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
- OwningPtr<DWARFCompileUnit> DWOCU(new DWARFCompileUnit(
+ std::unique_ptr<DWARFCompileUnit> DWOCU(new DWARFCompileUnit(
getDebugAbbrevDWO(), getInfoDWOSection().Data, getAbbrevDWOSection(),
getRangeDWOSection(), getStringDWOSection(),
getStringOffsetDWOSection(), getAddrSection(),
@@ -359,7 +359,7 @@ void DWARFContext::parseDWOTypeUnits() {
const DataExtractor &DIData =
DataExtractor(I->second.Data, isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
- OwningPtr<DWARFTypeUnit> TU(new DWARFTypeUnit(
+ std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(
getDebugAbbrevDWO(), I->second.Data, getAbbrevDWOSection(),
getRangeDWOSection(), getStringDWOSection(),
getStringOffsetDWOSection(), getAddrSection(), &I->second.Relocs,
@@ -629,7 +629,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
if (!zlib::isAvailable() ||
!consumeCompressedDebugSectionHeader(data, OriginalSize))
continue;
- OwningPtr<MemoryBuffer> UncompressedSection;
+ std::unique_ptr<MemoryBuffer> UncompressedSection;
if (zlib::uncompress(data, UncompressedSection, OriginalSize) !=
zlib::StatusOK)
continue;
diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h
index 823e98a6b3..96eaa70bd5 100644
--- a/lib/DebugInfo/DWARFContext.h
+++ b/lib/DebugInfo/DWARFContext.h
@@ -18,7 +18,6 @@
#include "DWARFDebugRangeList.h"
#include "DWARFTypeUnit.h"
#include "llvm/ADT/MapVector.h"
-#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/DebugInfo/DIContext.h"
@@ -31,15 +30,15 @@ namespace llvm {
class DWARFContext : public DIContext {
SmallVector<DWARFCompileUnit *, 1> CUs;
SmallVector<DWARFTypeUnit *, 1> TUs;
- OwningPtr<DWARFDebugAbbrev> Abbrev;
- OwningPtr<DWARFDebugLoc> Loc;
- OwningPtr<DWARFDebugAranges> Aranges;
- OwningPtr<DWARFDebugLine> Line;
- OwningPtr<DWARFDebugFrame> DebugFrame;
+ std::unique_ptr<DWARFDebugAbbrev> Abbrev;
+ std::unique_ptr<DWARFDebugLoc> Loc;
+ std::unique_ptr<DWARFDebugAranges> Aranges;
+ std::unique_ptr<DWARFDebugLine> Line;
+ std::unique_ptr<DWARFDebugFrame> DebugFrame;
SmallVector<DWARFCompileUnit *, 1> DWOCUs;
SmallVector<DWARFTypeUnit *, 1> DWOTUs;
- OwningPtr<DWARFDebugAbbrev> AbbrevDWO;
+ std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
DWARFContext(DWARFContext &) LLVM_DELETED_FUNCTION;
DWARFContext &operator=(DWARFContext &) LLVM_DELETED_FUNCTION;
diff --git a/lib/DebugInfo/DWARFUnit.h b/lib/DebugInfo/DWARFUnit.h
index d7d9aa27a8..5b4cf0905b 100644
--- a/lib/DebugInfo/DWARFUnit.h
+++ b/lib/DebugInfo/DWARFUnit.h
@@ -14,7 +14,6 @@
#include "DWARFDebugInfoEntry.h"
#include "DWARFDebugRangeList.h"
#include "DWARFRelocMap.h"
-#include "llvm/ADT/OwningPtr.h"
#include <vector>
namespace llvm {
@@ -50,14 +49,14 @@ class DWARFUnit {
std::vector<DWARFDebugInfoEntryMinimal> DieArray;
class DWOHolder {
- OwningPtr<object::ObjectFile> DWOFile;
- OwningPtr<DWARFContext> DWOContext;
+ std::unique_ptr<object::ObjectFile> DWOFile;
+ std::unique_ptr<DWARFContext> DWOContext;
DWARFUnit *DWOU;
public:
DWOHolder(object::ObjectFile *DWOFile);
DWARFUnit *getUnit() const { return DWOU; }
};
- OwningPtr<DWOHolder> DWO;
+ std::unique_ptr<DWOHolder> DWO;
protected:
virtual bool extractImpl(DataExtractor debug_info, uint32_t *offset_ptr);