diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-09-14 15:01:55 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-09-14 15:01:55 +0000 |
commit | e1a6074b52f07383144ebc2552712fa5d73b0e58 (patch) | |
tree | 36c01fcd0f90d99d70ca850528e7f4fb42a60161 | |
parent | 0d4fd5b6680be0fd020c16d4c10f0554a43895f9 (diff) | |
download | bcm5719-llvm-e1a6074b52f07383144ebc2552712fa5d73b0e58.tar.gz bcm5719-llvm-e1a6074b52f07383144ebc2552712fa5d73b0e58.zip |
Remove uses of std::auto_ptr, it's going away in C++17.
std::unique_ptr is pretty much a drop-in replacement here. Also remove nullptr
checks that are doing nothing.
llvm-svn: 313265
5 files changed, 5 insertions, 14 deletions
diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp index 194fec8a879..103b5ecde94 100644 --- a/lldb/source/Core/IOHandler.cpp +++ b/lldb/source/Core/IOHandler.cpp @@ -1146,7 +1146,7 @@ public: const char *text = m_delegate_sp->WindowDelegateGetHelpText(); KeyHelp *key_help = m_delegate_sp->WindowDelegateGetKeyHelp(); if ((text && text[0]) || key_help) { - std::auto_ptr<HelpDialogDelegate> help_delegate_ap( + std::unique_ptr<HelpDialogDelegate> help_delegate_ap( new HelpDialogDelegate(text, key_help)); const size_t num_lines = help_delegate_ap->GetNumLines(); const size_t max_length = help_delegate_ap->GetMaxLineLength(); diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp index 54dd237eb4b..31cb51cae4d 100644 --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -167,10 +167,7 @@ EmulateInstructionARM64::CreateInstance(const ArchSpec &arch, if (EmulateInstructionARM64::SupportsEmulatingInstructionsOfTypeStatic( inst_type)) { if (arch.GetTriple().getArch() == llvm::Triple::aarch64) { - std::auto_ptr<EmulateInstructionARM64> emulate_insn_ap( - new EmulateInstructionARM64(arch)); - if (emulate_insn_ap.get()) - return emulate_insn_ap.release(); + return new EmulateInstructionARM64(arch); } } diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp index 4d1d89abb1d..d61caac18c4 100644 --- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -212,10 +212,7 @@ EmulateInstructionMIPS::CreateInstance(const ArchSpec &arch, inst_type)) { if (arch.GetTriple().getArch() == llvm::Triple::mips || arch.GetTriple().getArch() == llvm::Triple::mipsel) { - std::auto_ptr<EmulateInstructionMIPS> emulate_insn_ap( - new EmulateInstructionMIPS(arch)); - if (emulate_insn_ap.get()) - return emulate_insn_ap.release(); + return new EmulateInstructionMIPS(arch); } } diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp index 11c5bf84090..81b5f8db153 100644 --- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -199,10 +199,7 @@ EmulateInstructionMIPS64::CreateInstance(const ArchSpec &arch, inst_type)) { if (arch.GetTriple().getArch() == llvm::Triple::mips64 || arch.GetTriple().getArch() == llvm::Triple::mips64el) { - std::auto_ptr<EmulateInstructionMIPS64> emulate_insn_ap( - new EmulateInstructionMIPS64(arch)); - if (emulate_insn_ap.get()) - return emulate_insn_ap.release(); + return new EmulateInstructionMIPS64(arch); } } diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index aca1b6b4b97..0f67ab5f33c 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -451,7 +451,7 @@ ObjectFile *ObjectFileELF::CreateMemoryInstance( if (ELFHeader::MagicBytesMatch(magic)) { unsigned address_size = ELFHeader::AddressSizeInBytes(magic); if (address_size == 4 || address_size == 8) { - std::auto_ptr<ObjectFileELF> objfile_ap( + std::unique_ptr<ObjectFileELF> objfile_ap( new ObjectFileELF(module_sp, data_sp, process_sp, header_addr)); ArchSpec spec; if (objfile_ap->GetArchitecture(spec) && |