summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/Binary.cpp4
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp3
-rw-r--r--llvm/lib/Object/ELFObjectFile.cpp2
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp2
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp2
-rw-r--r--llvm/lib/Object/MachOUniversal.cpp10
-rw-r--r--llvm/lib/Object/ObjectFile.cpp3
7 files changed, 13 insertions, 13 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp
index 673a34e98a6..63fd3ed0110 100644
--- a/llvm/lib/Object/Binary.cpp
+++ b/llvm/lib/Object/Binary.cpp
@@ -43,7 +43,7 @@ StringRef Binary::getFileName() const {
ErrorOr<Binary *> object::createBinary(MemoryBuffer *Source,
LLVMContext *Context) {
- OwningPtr<MemoryBuffer> scopedSource(Source);
+ std::unique_ptr<MemoryBuffer> scopedSource(Source);
sys::fs::file_magic Type = sys::fs::identify_magic(Source->getBuffer());
switch (Type) {
@@ -80,7 +80,7 @@ ErrorOr<Binary *> object::createBinary(MemoryBuffer *Source,
}
ErrorOr<Binary *> object::createBinary(StringRef Path) {
- OwningPtr<MemoryBuffer> File;
+ std::unique_ptr<MemoryBuffer> File;
if (error_code EC = MemoryBuffer::getFileOrSTDIN(Path, File))
return EC;
return createBinary(File.release());
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 95faa13256c..6ef2fbfed53 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -1068,7 +1068,8 @@ error_code ExportDirectoryEntryRef::getSymbolName(StringRef &Result) const {
ErrorOr<ObjectFile *> ObjectFile::createCOFFObjectFile(MemoryBuffer *Object,
bool BufferOwned) {
error_code EC;
- OwningPtr<COFFObjectFile> Ret(new COFFObjectFile(Object, EC, BufferOwned));
+ std::unique_ptr<COFFObjectFile> Ret(
+ new COFFObjectFile(Object, EC, BufferOwned));
if (EC)
return EC;
return Ret.release();
diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
index 17b615e0170..a2c4df2007f 100644
--- a/llvm/lib/Object/ELFObjectFile.cpp
+++ b/llvm/lib/Object/ELFObjectFile.cpp
@@ -24,7 +24,7 @@ ErrorOr<ObjectFile *> ObjectFile::createELFObjectFile(MemoryBuffer *Obj,
1ULL << countTrailingZeros(uintptr_t(Obj->getBufferStart()));
error_code EC;
- OwningPtr<ObjectFile> R;
+ std::unique_ptr<ObjectFile> R;
if (Ident.first == ELF::ELFCLASS32 && Ident.second == ELF::ELFDATA2LSB)
#if !LLVM_IS_UNALIGNED_ACCESS_FAST
if (MaxAlignment >= 4)
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index e8d51ecbf67..d5ea80d1d0e 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -144,7 +144,7 @@ basic_symbol_iterator IRObjectFile::symbol_end_impl() const {
ErrorOr<SymbolicFile *> llvm::object::SymbolicFile::createIRObjectFile(
MemoryBuffer *Object, LLVMContext &Context, bool BufferOwned) {
error_code EC;
- OwningPtr<IRObjectFile> Ret(
+ std::unique_ptr<IRObjectFile> Ret(
new IRObjectFile(Object, EC, Context, BufferOwned));
if (EC)
return EC;
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 00599efce05..5dd9e5596b3 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -1549,7 +1549,7 @@ ErrorOr<ObjectFile *> ObjectFile::createMachOObjectFile(MemoryBuffer *Buffer,
bool BufferOwned) {
StringRef Magic = Buffer->getBuffer().slice(0, 4);
error_code EC;
- OwningPtr<MachOObjectFile> Ret;
+ std::unique_ptr<MachOObjectFile> Ret;
if (Magic == "\xFE\xED\xFA\xCE")
Ret.reset(new MachOObjectFile(Buffer, false, false, EC, BufferOwned));
else if (Magic == "\xCE\xFA\xED\xFE")
diff --git a/llvm/lib/Object/MachOUniversal.cpp b/llvm/lib/Object/MachOUniversal.cpp
index 3975a18c601..70baa9f63a6 100644
--- a/llvm/lib/Object/MachOUniversal.cpp
+++ b/llvm/lib/Object/MachOUniversal.cpp
@@ -72,7 +72,7 @@ MachOUniversalBinary::ObjectForArch::ObjectForArch(
}
error_code MachOUniversalBinary::ObjectForArch::getAsObjectFile(
- OwningPtr<ObjectFile> &Result) const {
+ std::unique_ptr<ObjectFile> &Result) const {
if (Parent) {
StringRef ParentData = Parent->getData();
StringRef ObjectData = ParentData.substr(Header.offset, Header.size);
@@ -95,7 +95,8 @@ void MachOUniversalBinary::anchor() { }
ErrorOr<MachOUniversalBinary *>
MachOUniversalBinary::create(MemoryBuffer *Source) {
error_code EC;
- OwningPtr<MachOUniversalBinary> Ret(new MachOUniversalBinary(Source, EC));
+ std::unique_ptr<MachOUniversalBinary> Ret(
+ new MachOUniversalBinary(Source, EC));
if (EC)
return EC;
return Ret.release();
@@ -134,9 +135,8 @@ static bool getCTMForArch(Triple::ArchType Arch, MachO::CPUType &CTM) {
}
}
-error_code
-MachOUniversalBinary::getObjectForArch(Triple::ArchType Arch,
- OwningPtr<ObjectFile> &Result) const {
+error_code MachOUniversalBinary::getObjectForArch(
+ Triple::ArchType Arch, std::unique_ptr<ObjectFile> &Result) const {
MachO::CPUType CTM;
if (!getCTMForArch(Arch, CTM))
return object_error::arch_not_found;
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index 058bc3436a6..d30f0cca49c 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -12,7 +12,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Object/ObjectFile.h"
-#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -87,7 +86,7 @@ ErrorOr<ObjectFile *> ObjectFile::createObjectFile(MemoryBuffer *Object,
}
ErrorOr<ObjectFile *> ObjectFile::createObjectFile(StringRef ObjectPath) {
- OwningPtr<MemoryBuffer> File;
+ std::unique_ptr<MemoryBuffer> File;
if (error_code EC = MemoryBuffer::getFile(ObjectPath, File))
return EC;
return createObjectFile(File.release());
OpenPOWER on IntegriCloud