[llvm] r203083 - Replace OwningPtr<T> with std::unique_ptr<T>.
Eric Christopher
echristo at gmail.com
Wed Mar 5 22:07:50 PST 2014
Awesome. Thanks Ahmed!
-eric
On Wed, Mar 5, 2014 at 9:51 PM, Ahmed Charles <ahmedcharles at gmail.com> wrote:
> Author: ace2001ac
> Date: Wed Mar 5 23:51:42 2014
> New Revision: 203083
>
> URL: http://llvm.org/viewvc/llvm-project?rev=203083&view=rev
> Log:
> 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.
>
> Modified:
> llvm/trunk/examples/Fibonacci/fibonacci.cpp
> llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp
> llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp
> llvm/trunk/include/llvm/Analysis/CallGraph.h
> llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
> llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
> llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h
> llvm/trunk/include/llvm/ExecutionEngine/ObjectBuffer.h
> llvm/trunk/include/llvm/ExecutionEngine/ObjectImage.h
> llvm/trunk/include/llvm/IR/Module.h
> llvm/trunk/include/llvm/LTO/LTOModule.h
> llvm/trunk/include/llvm/LineEditor/LineEditor.h
> llvm/trunk/include/llvm/MC/MCDisassembler.h
> llvm/trunk/include/llvm/MC/MCExternalSymbolizer.h
> llvm/trunk/include/llvm/MC/MCMachObjectWriter.h
> llvm/trunk/include/llvm/MC/MCModuleYAML.h
> llvm/trunk/include/llvm/MC/MCObjectDisassembler.h
> llvm/trunk/include/llvm/MC/MCObjectSymbolizer.h
> llvm/trunk/include/llvm/MC/MCStreamer.h
> llvm/trunk/include/llvm/MC/MCSymbolizer.h
> llvm/trunk/include/llvm/Object/IRObjectFile.h
> llvm/trunk/include/llvm/Object/MachOUniversal.h
> llvm/trunk/include/llvm/Support/Compression.h
> llvm/trunk/include/llvm/Support/FileSystem.h
> llvm/trunk/include/llvm/Support/StreamableMemoryObject.h
> llvm/trunk/include/llvm/Support/YAMLParser.h
> llvm/trunk/include/llvm/Support/YAMLTraits.h
> llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
> llvm/trunk/lib/AsmParser/Parser.cpp
> llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
> llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
> llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
> llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp
> llvm/trunk/lib/CodeGen/MachineScheduler.cpp
> llvm/trunk/lib/CodeGen/RegAllocBase.h
> llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
> llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
> llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
> llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
> llvm/trunk/lib/CodeGen/TailDuplication.cpp
> llvm/trunk/lib/DebugInfo/DWARFContext.cpp
> llvm/trunk/lib/DebugInfo/DWARFContext.h
> llvm/trunk/lib/DebugInfo/DWARFUnit.h
> llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
> llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
> llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
> llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
> llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h
> llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
> llvm/trunk/lib/IR/AsmWriter.h
> llvm/trunk/lib/IR/Core.cpp
> llvm/trunk/lib/IR/GCOV.cpp
> llvm/trunk/lib/IR/Module.cpp
> llvm/trunk/lib/IRReader/IRReader.cpp
> llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
> llvm/trunk/lib/LTO/LTOModule.cpp
> llvm/trunk/lib/MC/ELFObjectWriter.cpp
> llvm/trunk/lib/MC/MCAsmStreamer.cpp
> llvm/trunk/lib/MC/MCDisassembler.cpp
> llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
> llvm/trunk/lib/MC/MCDisassembler/Disassembler.h
> llvm/trunk/lib/MC/MCExternalSymbolizer.cpp
> llvm/trunk/lib/MC/MCModuleYAML.cpp
> llvm/trunk/lib/MC/MCObjectSymbolizer.cpp
> llvm/trunk/lib/MC/MCSymbolizer.cpp
> llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
> llvm/trunk/lib/Object/Binary.cpp
> llvm/trunk/lib/Object/COFFObjectFile.cpp
> llvm/trunk/lib/Object/ELFObjectFile.cpp
> llvm/trunk/lib/Object/IRObjectFile.cpp
> llvm/trunk/lib/Object/MachOObjectFile.cpp
> llvm/trunk/lib/Object/MachOUniversal.cpp
> llvm/trunk/lib/Object/ObjectFile.cpp
> llvm/trunk/lib/Support/CommandLine.cpp
> llvm/trunk/lib/Support/Compression.cpp
> llvm/trunk/lib/Support/FileUtilities.cpp
> llvm/trunk/lib/Support/LockFileManager.cpp
> llvm/trunk/lib/Support/SourceMgr.cpp
> llvm/trunk/lib/Support/StringRef.cpp
> llvm/trunk/lib/Support/Timer.cpp
> llvm/trunk/lib/Support/Windows/Program.inc
> llvm/trunk/lib/Support/YAMLParser.cpp
> llvm/trunk/lib/TableGen/Main.cpp
> llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
> llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
> llvm/trunk/lib/Transforms/Instrumentation/DebugIR.h
> llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
> llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
> llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
> llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
> llvm/trunk/lib/Transforms/Utils/SpecialCaseList.cpp
> llvm/trunk/tools/bugpoint/BugDriver.cpp
> llvm/trunk/tools/bugpoint/Miscompilation.cpp
> llvm/trunk/tools/gold/gold-plugin.cpp
> llvm/trunk/tools/llc/llc.cpp
> llvm/trunk/tools/lli/lli.cpp
> llvm/trunk/tools/llvm-ar/llvm-ar.cpp
> llvm/trunk/tools/llvm-as/llvm-as.cpp
> llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
> llvm/trunk/tools/llvm-cov/llvm-cov.cpp
> llvm/trunk/tools/llvm-dis/llvm-dis.cpp
> llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
> llvm/trunk/tools/llvm-extract/llvm-extract.cpp
> llvm/trunk/tools/llvm-jitlistener/llvm-jitlistener.cpp
> llvm/trunk/tools/llvm-link/llvm-link.cpp
> llvm/trunk/tools/llvm-lto/llvm-lto.cpp
> llvm/trunk/tools/llvm-mc/Disassembler.cpp
> llvm/trunk/tools/llvm-mc/llvm-mc.cpp
> llvm/trunk/tools/llvm-mcmarkup/llvm-mcmarkup.cpp
> llvm/trunk/tools/llvm-nm/llvm-nm.cpp
> llvm/trunk/tools/llvm-objdump/MachODump.cpp
> llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
> llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
> llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
> llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
> llvm/trunk/tools/llvm-readobj/MachODumper.cpp
> llvm/trunk/tools/llvm-readobj/ObjDumper.h
> llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
> llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
> llvm/trunk/tools/llvm-size/llvm-size.cpp
> llvm/trunk/tools/llvm-stress/llvm-stress.cpp
> llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
> llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h
> llvm/trunk/tools/macho-dump/macho-dump.cpp
> llvm/trunk/tools/obj2yaml/obj2yaml.cpp
> llvm/trunk/tools/opt/opt.cpp
> llvm/trunk/tools/yaml2obj/yaml2obj.cpp
> llvm/trunk/unittests/Analysis/CFGTest.cpp
> llvm/trunk/unittests/Bitcode/BitReaderTest.cpp
> llvm/trunk/unittests/ExecutionEngine/ExecutionEngineTest.cpp
> llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
> llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h
> llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
> llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp
> llvm/trunk/unittests/ExecutionEngine/JIT/MultiJITTest.cpp
> llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp
> llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
> llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
> llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
> llvm/trunk/unittests/IR/ConstantsTest.cpp
> llvm/trunk/unittests/IR/DominatorTreeTest.cpp
> llvm/trunk/unittests/IR/IRBuilderTest.cpp
> llvm/trunk/unittests/IR/LegacyPassManagerTest.cpp
> llvm/trunk/unittests/IR/PassManagerTest.cpp
> llvm/trunk/unittests/IR/PatternMatch.cpp
> llvm/trunk/unittests/IR/ValueHandleTest.cpp
> llvm/trunk/unittests/IR/ValueMapTest.cpp
> llvm/trunk/unittests/IR/ValueTest.cpp
> llvm/trunk/unittests/IR/VerifierTest.cpp
> llvm/trunk/unittests/Linker/LinkModulesTest.cpp
> llvm/trunk/unittests/Option/OptionParsingTest.cpp
> llvm/trunk/unittests/Support/CompressionTest.cpp
> llvm/trunk/unittests/Support/LineIteratorTest.cpp
> llvm/trunk/unittests/Support/Path.cpp
> llvm/trunk/unittests/Transforms/DebugIR/DebugIR.cpp
> llvm/trunk/unittests/Transforms/Utils/SpecialCaseList.cpp
> llvm/trunk/utils/FileCheck/FileCheck.cpp
> llvm/trunk/utils/FileUpdate/FileUpdate.cpp
> llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
> llvm/trunk/utils/TableGen/DAGISelMatcher.h
> llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp
> llvm/trunk/utils/yaml-bench/YAMLBench.cpp
>
> Modified: llvm/trunk/examples/Fibonacci/fibonacci.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Fibonacci/fibonacci.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/examples/Fibonacci/fibonacci.cpp (original)
> +++ llvm/trunk/examples/Fibonacci/fibonacci.cpp Wed Mar 5 23:51:42 2014
> @@ -96,7 +96,7 @@ int main(int argc, char **argv) {
> LLVMContext Context;
>
> // Create some module to put our function into it.
> - OwningPtr<Module> M(new Module("test", Context));
> + std::unique_ptr<Module> M(new Module("test", Context));
>
> // We are about to create the "fib" function:
> Function *FibF = CreateFibFunction(M.get(), Context);
>
> Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/MCJIT/cached/toy.cpp Wed Mar 5 23:51:42 2014
> @@ -715,7 +715,7 @@ public:
> // This file isn't in our cache
> return NULL;
> }
> - OwningPtr<MemoryBuffer> IRObjectBuffer;
> + std::unique_ptr<MemoryBuffer> IRObjectBuffer;
> MemoryBuffer::getFile(IRCacheFile.c_str(), IRObjectBuffer, -1, false);
> // MCJIT will want to write into this buffer, and we don't want that
> // because the file has probably just been mmapped. Instead we make
>
> Modified: llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp (original)
> +++ llvm/trunk/examples/Kaleidoscope/MCJIT/complete/toy.cpp Wed Mar 5 23:51:42 2014
> @@ -739,7 +739,7 @@ public:
> // This file isn't in our cache
> return NULL;
> }
> - OwningPtr<MemoryBuffer> IRObjectBuffer;
> + std::unique_ptr<MemoryBuffer> IRObjectBuffer;
> MemoryBuffer::getFile(IRCacheFile.c_str(), IRObjectBuffer, -1, false);
> // MCJIT will want to write into this buffer, and we don't want that
> // because the file has probably just been mmapped. Instead we make
>
> Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Analysis/CallGraph.h (original)
> +++ llvm/trunk/include/llvm/Analysis/CallGraph.h Wed Mar 5 23:51:42 2014
> @@ -53,7 +53,6 @@
> #define LLVM_ANALYSIS_CALLGRAPH_H
>
> #include "llvm/ADT/GraphTraits.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/IR/CallSite.h"
> #include "llvm/IR/Function.h"
> @@ -314,7 +313,7 @@ private:
> /// call graph interface is entirelly a wrapper around a \c CallGraph object
> /// which is stored internally for each module.
> class CallGraphWrapperPass : public ModulePass {
> - OwningPtr<CallGraph> G;
> + std::unique_ptr<CallGraph> G;
>
> public:
> static char ID; // Class identification, replacement for typeinfo
>
> Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original)
> +++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #define LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
>
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/PointerIntPair.h"
> #include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/Analysis/AliasAnalysis.h"
> @@ -325,7 +324,8 @@ namespace llvm {
> AliasAnalysis *AA;
> const DataLayout *DL;
> DominatorTree *DT;
> - OwningPtr<PredIteratorCache> PredCache;
> + std::unique_ptr<PredIteratorCache> PredCache;
> +
> public:
> MemoryDependenceAnalysis();
> ~MemoryDependenceAnalysis();
>
> Modified: llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamReader.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original)
> +++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #ifndef LLVM_BITCODE_BITSTREAMREADER_H
> #define LLVM_BITCODE_BITSTREAMREADER_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Bitcode/BitCodes.h"
> #include "llvm/Support/Endian.h"
> #include "llvm/Support/StreamableMemoryObject.h"
> @@ -44,7 +43,7 @@ public:
> std::vector<std::pair<unsigned, std::string> > RecordNames;
> };
> private:
> - OwningPtr<StreamableMemoryObject> BitcodeBytes;
> + std::unique_ptr<StreamableMemoryObject> BitcodeBytes;
>
> std::vector<BlockInfo> BlockInfoRecords;
>
>
> Modified: llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h Wed Mar 5 23:51:42 2014
> @@ -29,7 +29,6 @@ namespace llvm {
> class MachineBlockFrequencyInfo;
> class MachineFunction;
> class TargetRegisterInfo;
> - template<class T> class OwningPtr;
>
> typedef PBQP::RegAlloc::Graph PBQPRAGraph;
>
> @@ -158,8 +157,9 @@ namespace llvm {
> PBQP::PBQPNum benefit);
> };
>
> - FunctionPass* createPBQPRegisterAllocator(OwningPtr<PBQPBuilder> &builder,
> - char *customPassID=0);
> + FunctionPass *
> + createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> &builder,
> + char *customPassID = 0);
> }
>
> #endif /* LLVM_CODEGEN_REGALLOCPBQP_H */
>
> Modified: llvm/trunk/include/llvm/ExecutionEngine/ObjectBuffer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/ObjectBuffer.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ExecutionEngine/ObjectBuffer.h (original)
> +++ llvm/trunk/include/llvm/ExecutionEngine/ObjectBuffer.h Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #ifndef LLVM_EXECUTIONENGINE_OBJECTBUFFER_H
> #define LLVM_EXECUTIONENGINE_OBJECTBUFFER_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/Support/MemoryBuffer.h"
> #include "llvm/Support/raw_ostream.h"
> @@ -49,7 +48,7 @@ public:
>
> protected:
> // The memory contained in an ObjectBuffer
> - OwningPtr<MemoryBuffer> Buffer;
> + std::unique_ptr<MemoryBuffer> Buffer;
> };
>
> /// ObjectBufferStream - This class encapsulates the SmallVector and
>
> Modified: llvm/trunk/include/llvm/ExecutionEngine/ObjectImage.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/ObjectImage.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ExecutionEngine/ObjectImage.h (original)
> +++ llvm/trunk/include/llvm/ExecutionEngine/ObjectImage.h Wed Mar 5 23:51:42 2014
> @@ -28,7 +28,7 @@ class ObjectImage {
> virtual void anchor();
>
> protected:
> - OwningPtr<ObjectBuffer> Buffer;
> + std::unique_ptr<ObjectBuffer> Buffer;
>
> public:
> ObjectImage(ObjectBuffer *Input) : Buffer(Input) {}
>
> Modified: llvm/trunk/include/llvm/IR/Module.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Module.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/Module.h (original)
> +++ llvm/trunk/include/llvm/IR/Module.h Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #ifndef LLVM_IR_MODULE_H
> #define LLVM_IR_MODULE_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/DataLayout.h"
> #include "llvm/IR/Function.h"
> #include "llvm/IR/GlobalAlias.h"
> @@ -197,7 +196,8 @@ private:
> NamedMDListType NamedMDList; ///< The named metadata in the module
> std::string GlobalScopeAsm; ///< Inline Asm at global scope.
> ValueSymbolTable *ValSymTab; ///< Symbol table for values
> - OwningPtr<GVMaterializer> Materializer; ///< Used to materialize GlobalValues
> + std::unique_ptr<GVMaterializer>
> + Materializer; ///< Used to materialize GlobalValues
> std::string ModuleID; ///< Human readable identifier for the module
> std::string TargetTriple; ///< Platform target triple Module compiled on
> void *NamedMDSymTab; ///< NamedMDNode names.
>
> Modified: llvm/trunk/include/llvm/LTO/LTOModule.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTOModule.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/LTO/LTOModule.h (original)
> +++ llvm/trunk/include/llvm/LTO/LTOModule.h Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #define LTO_MODULE_H
>
> #include "llvm-c/lto.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/IR/Mangler.h"
> #include "llvm/IR/Module.h"
> @@ -48,8 +47,8 @@ private:
> const llvm::GlobalValue *symbol;
> };
>
> - llvm::OwningPtr<llvm::Module> _module;
> - llvm::OwningPtr<llvm::TargetMachine> _target;
> + std::unique_ptr<llvm::Module> _module;
> + std::unique_ptr<llvm::TargetMachine> _target;
> llvm::MCObjectFileInfo ObjFileInfo;
> StringSet _linkeropt_strings;
> std::vector<const char *> _deplibs;
>
> Modified: llvm/trunk/include/llvm/LineEditor/LineEditor.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LineEditor/LineEditor.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/LineEditor/LineEditor.h (original)
> +++ llvm/trunk/include/llvm/LineEditor/LineEditor.h Wed Mar 5 23:51:42 2014
> @@ -111,7 +111,7 @@ public:
> private:
> std::string Prompt;
> std::string HistoryPath;
> - OwningPtr<InternalData> Data;
> + std::unique_ptr<InternalData> Data;
>
> struct CompleterConcept {
> virtual ~CompleterConcept();
> @@ -145,7 +145,7 @@ private:
> T Value;
> };
>
> - llvm::OwningPtr<const CompleterConcept> Completer;
> + std::unique_ptr<const CompleterConcept> Completer;
> };
>
> }
>
> Modified: llvm/trunk/include/llvm/MC/MCDisassembler.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDisassembler.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCDisassembler.h (original)
> +++ llvm/trunk/include/llvm/MC/MCDisassembler.h Wed Mar 5 23:51:42 2014
> @@ -56,10 +56,9 @@ public:
> };
>
> /// Constructor - Performs initial setup for the disassembler.
> - MCDisassembler(const MCSubtargetInfo &STI) : GetOpInfo(0), SymbolLookUp(0),
> - DisInfo(0), Ctx(0),
> - STI(STI), Symbolizer(0),
> - CommentStream(0) {}
> + MCDisassembler(const MCSubtargetInfo &STI)
> + : GetOpInfo(0), SymbolLookUp(0), DisInfo(0), Ctx(0), STI(STI),
> + Symbolizer(), CommentStream(0) {}
>
> virtual ~MCDisassembler();
>
> @@ -102,7 +101,7 @@ private:
> protected:
> // Subtarget information, for instruction decoding predicates if required.
> const MCSubtargetInfo &STI;
> - OwningPtr<MCSymbolizer> Symbolizer;
> + std::unique_ptr<MCSymbolizer> Symbolizer;
>
> public:
> // Helpers around MCSymbolizer
> @@ -115,7 +114,7 @@ public:
>
> /// Set \p Symzer as the current symbolizer.
> /// This takes ownership of \p Symzer, and deletes the previously set one.
> - void setSymbolizer(OwningPtr<MCSymbolizer> &Symzer);
> + void setSymbolizer(std::unique_ptr<MCSymbolizer> &Symzer);
>
> /// Sets up an external symbolizer that uses the C API callbacks.
> void setupForSymbolicDisassembly(LLVMOpInfoCallback GetOpInfo,
>
> Modified: llvm/trunk/include/llvm/MC/MCExternalSymbolizer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExternalSymbolizer.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCExternalSymbolizer.h (original)
> +++ llvm/trunk/include/llvm/MC/MCExternalSymbolizer.h Wed Mar 5 23:51:42 2014
> @@ -18,6 +18,7 @@
>
> #include "llvm-c/Disassembler.h"
> #include "llvm/MC/MCSymbolizer.h"
> +#include <memory>
>
> namespace llvm {
>
> @@ -38,12 +39,11 @@ class MCExternalSymbolizer : public MCSy
>
> public:
> MCExternalSymbolizer(MCContext &Ctx,
> - OwningPtr<MCRelocationInfo> &RelInfo,
> + std::unique_ptr<MCRelocationInfo> &RelInfo,
> LLVMOpInfoCallback getOpInfo,
> - LLVMSymbolLookupCallback symbolLookUp,
> - void *disInfo)
> - : MCSymbolizer(Ctx, RelInfo),
> - GetOpInfo(getOpInfo), SymbolLookUp(symbolLookUp), DisInfo(disInfo) {}
> + LLVMSymbolLookupCallback symbolLookUp, void *disInfo)
> + : MCSymbolizer(Ctx, RelInfo), GetOpInfo(getOpInfo),
> + SymbolLookUp(symbolLookUp), DisInfo(disInfo) {}
>
> bool tryAddingSymbolicOperand(MCInst &MI, raw_ostream &CommentStream,
> int64_t Value,
>
> Modified: llvm/trunk/include/llvm/MC/MCMachObjectWriter.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCMachObjectWriter.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCMachObjectWriter.h (original)
> +++ llvm/trunk/include/llvm/MC/MCMachObjectWriter.h Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> #define LLVM_MC_MCMACHOBJECTWRITER_H
>
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/MC/MCExpr.h"
> #include "llvm/MC/MCObjectWriter.h"
> @@ -92,7 +91,7 @@ class MachObjectWriter : public MCObject
> };
>
> /// The target specific Mach-O writer instance.
> - llvm::OwningPtr<MCMachObjectTargetWriter> TargetObjectWriter;
> + std::unique_ptr<MCMachObjectTargetWriter> TargetObjectWriter;
>
> /// @name Relocation Data
> /// @{
>
> Modified: llvm/trunk/include/llvm/MC/MCModuleYAML.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCModuleYAML.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCModuleYAML.h (original)
> +++ llvm/trunk/include/llvm/MC/MCModuleYAML.h Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> #ifndef LLVM_MC_MCMODULEYAML_H
> #define LLVM_MC_MCMODULEYAML_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/MC/MCModule.h"
> #include "llvm/Support/raw_ostream.h"
> @@ -33,7 +32,7 @@ StringRef mcmodule2yaml(raw_ostream &OS,
>
> /// \brief Creates a new module and returns it in \p MCM.
> /// \returns The empty string on success, an error message on failure.
> -StringRef yaml2mcmodule(OwningPtr<MCModule> &MCM, StringRef YamlContent,
> +StringRef yaml2mcmodule(std::unique_ptr<MCModule> &MCM, StringRef YamlContent,
> const MCInstrInfo &MII, const MCRegisterInfo &MRI);
>
> } // end namespace llvm
>
> Modified: llvm/trunk/include/llvm/MC/MCObjectDisassembler.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectDisassembler.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCObjectDisassembler.h (original)
> +++ llvm/trunk/include/llvm/MC/MCObjectDisassembler.h Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> #define LLVM_MC_MCOBJECTDISASSEMBLER_H
>
> #include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/Support/DataTypes.h"
> #include "llvm/Support/MemoryObject.h"
> @@ -67,7 +66,7 @@ public:
> /// \brief Set the region on which to fallback if disassembly was requested
> /// somewhere not accessible in the object file.
> /// This is used for dynamic disassembly (see RawMemoryObject).
> - void setFallbackRegion(OwningPtr<MemoryObject> &Region) {
> + void setFallbackRegion(std::unique_ptr<MemoryObject> &Region) {
> FallbackRegion.reset(Region.release());
> }
>
> @@ -113,7 +112,7 @@ protected:
> MCObjectSymbolizer *MOS;
>
> /// \brief The fallback memory region, outside the object file.
> - OwningPtr<MemoryObject> FallbackRegion;
> + std::unique_ptr<MemoryObject> FallbackRegion;
>
> /// \brief Return a memory region suitable for reading starting at \p Addr.
> /// In most cases, this returns a StringRefMemoryObject backed by the
>
> Modified: llvm/trunk/include/llvm/MC/MCObjectSymbolizer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectSymbolizer.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCObjectSymbolizer.h (original)
> +++ llvm/trunk/include/llvm/MC/MCObjectSymbolizer.h Wed Mar 5 23:51:42 2014
> @@ -41,7 +41,7 @@ protected:
> const object::RelocationRef *findRelocationAt(uint64_t Addr);
> const object::SectionRef *findSectionContaining(uint64_t Addr);
>
> - MCObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
> + MCObjectSymbolizer(MCContext &Ctx, std::unique_ptr<MCRelocationInfo> &RelInfo,
> const object::ObjectFile *Obj);
>
> public:
> @@ -63,8 +63,9 @@ public:
>
> /// \brief Create an object symbolizer for \p Obj.
> static MCObjectSymbolizer *
> - createObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
> - const object::ObjectFile *Obj);
> + createObjectSymbolizer(MCContext &Ctx,
> + std::unique_ptr<MCRelocationInfo> &RelInfo,
> + const object::ObjectFile *Obj);
>
> private:
> typedef DenseMap<uint64_t, object::RelocationRef> AddrToRelocMap;
>
> Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
> +++ llvm/trunk/include/llvm/MC/MCStreamer.h Wed Mar 5 23:51:42 2014
> @@ -130,7 +130,7 @@ public:
> void emitCurrentConstantPool();
>
> private:
> - OwningPtr<AssemblerConstantPools> ConstantPools;
> + std::unique_ptr<AssemblerConstantPools> ConstantPools;
> };
>
> /// MCStreamer - Streaming machine code generation interface. This interface
> @@ -144,7 +144,7 @@ private:
> ///
> class MCStreamer {
> MCContext &Context;
> - OwningPtr<MCTargetStreamer> TargetStreamer;
> + std::unique_ptr<MCTargetStreamer> TargetStreamer;
>
> MCStreamer(const MCStreamer &) LLVM_DELETED_FUNCTION;
> MCStreamer &operator=(const MCStreamer &) LLVM_DELETED_FUNCTION;
>
> Modified: llvm/trunk/include/llvm/MC/MCSymbolizer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbolizer.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCSymbolizer.h (original)
> +++ llvm/trunk/include/llvm/MC/MCSymbolizer.h Wed Mar 5 23:51:42 2014
> @@ -16,10 +16,10 @@
> #ifndef LLVM_MC_MCSYMBOLIZER_H
> #define LLVM_MC_MCSYMBOLIZER_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/MC/MCRelocationInfo.h"
> #include "llvm/Support/Compiler.h"
> #include "llvm/Support/DataTypes.h"
> +#include <memory>
>
> namespace llvm {
>
> @@ -42,11 +42,11 @@ class MCSymbolizer {
>
> protected:
> MCContext &Ctx;
> - OwningPtr<MCRelocationInfo> RelInfo;
> + std::unique_ptr<MCRelocationInfo> RelInfo;
>
> public:
> /// \brief Construct an MCSymbolizer, taking ownership of \p RelInfo.
> - MCSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo);
> + MCSymbolizer(MCContext &Ctx, std::unique_ptr<MCRelocationInfo> &RelInfo);
> virtual ~MCSymbolizer();
>
> /// \brief Try to add a symbolic operand instead of \p Value to the MCInst.
>
> Modified: llvm/trunk/include/llvm/Object/IRObjectFile.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/IRObjectFile.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/IRObjectFile.h (original)
> +++ llvm/trunk/include/llvm/Object/IRObjectFile.h Wed Mar 5 23:51:42 2014
> @@ -23,8 +23,9 @@ class GlobalValue;
>
> namespace object {
> class IRObjectFile : public SymbolicFile {
> - OwningPtr<Module> M;
> - OwningPtr<Mangler> Mang;
> + std::unique_ptr<Module> M;
> + std::unique_ptr<Mangler> Mang;
> +
> public:
> IRObjectFile(MemoryBuffer *Object, error_code &EC, LLVMContext &Context,
> bool BufferOwned);
>
> Modified: llvm/trunk/include/llvm/Object/MachOUniversal.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/MachOUniversal.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/MachOUniversal.h (original)
> +++ llvm/trunk/include/llvm/Object/MachOUniversal.h Wed Mar 5 23:51:42 2014
> @@ -14,7 +14,6 @@
> #ifndef LLVM_OBJECT_MACHOUNIVERSAL_H
> #define LLVM_OBJECT_MACHOUNIVERSAL_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/ADT/Triple.h"
> #include "llvm/Object/Binary.h"
> @@ -53,7 +52,7 @@ public:
> ObjectForArch getNext() const { return ObjectForArch(Parent, Index + 1); }
> uint32_t getCPUType() const { return Header.cputype; }
>
> - error_code getAsObjectFile(OwningPtr<ObjectFile> &Result) const;
> + error_code getAsObjectFile(std::unique_ptr<ObjectFile> &Result) const;
> };
>
> class object_iterator {
> @@ -95,7 +94,7 @@ public:
> }
>
> error_code getObjectForArch(Triple::ArchType Arch,
> - OwningPtr<ObjectFile> &Result) const;
> + std::unique_ptr<ObjectFile> &Result) const;
> };
>
> }
>
> Modified: llvm/trunk/include/llvm/Support/Compression.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Compression.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/Compression.h (original)
> +++ llvm/trunk/include/llvm/Support/Compression.h Wed Mar 5 23:51:42 2014
> @@ -15,11 +15,11 @@
> #define LLVM_SUPPORT_COMPRESSION_H
>
> #include "llvm/Support/DataTypes.h"
> +#include <memory>
>
> namespace llvm {
>
> class MemoryBuffer;
> -template<typename T> class OwningPtr;
> class StringRef;
>
> namespace zlib {
> @@ -43,11 +43,11 @@ enum Status {
> bool isAvailable();
>
> Status compress(StringRef InputBuffer,
> - OwningPtr<MemoryBuffer> &CompressedBuffer,
> + std::unique_ptr<MemoryBuffer> &CompressedBuffer,
> CompressionLevel Level = DefaultCompression);
>
> Status uncompress(StringRef InputBuffer,
> - OwningPtr<MemoryBuffer> &UncompressedBuffer,
> + std::unique_ptr<MemoryBuffer> &UncompressedBuffer,
> size_t UncompressedSize);
>
> uint32_t crc32(StringRef Buffer);
>
> Modified: llvm/trunk/include/llvm/Support/FileSystem.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/FileSystem.h (original)
> +++ llvm/trunk/include/llvm/Support/FileSystem.h Wed Mar 5 23:51:42 2014
> @@ -28,7 +28,6 @@
> #define LLVM_SUPPORT_FILESYSTEM_H
>
> #include "llvm/ADT/IntrusiveRefCntPtr.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/Twine.h"
> #include "llvm/Support/DataTypes.h"
>
> Modified: llvm/trunk/include/llvm/Support/StreamableMemoryObject.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StreamableMemoryObject.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/StreamableMemoryObject.h (original)
> +++ llvm/trunk/include/llvm/Support/StreamableMemoryObject.h Wed Mar 5 23:51:42 2014
> @@ -11,10 +11,11 @@
> #ifndef LLVM_SUPPORT_STREAMABLEMEMORYOBJECT_H
> #define LLVM_SUPPORT_STREAMABLEMEMORYOBJECT_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/Compiler.h"
> #include "llvm/Support/DataStream.h"
> #include "llvm/Support/MemoryObject.h"
> +#include <cassert>
> +#include <memory>
> #include <vector>
>
> namespace llvm {
> @@ -137,7 +138,7 @@ public:
> private:
> const static uint32_t kChunkSize = 4096 * 4;
> mutable std::vector<unsigned char> Bytes;
> - OwningPtr<DataStreamer> Streamer;
> + std::unique_ptr<DataStreamer> Streamer;
> mutable size_t BytesRead; // Bytes read from stream
> size_t BytesSkipped;// Bytes skipped at start of stream (e.g. wrapper/header)
> mutable size_t ObjectSize; // 0 if unknown, set if wrapper seen or EOF reached
>
> Modified: llvm/trunk/include/llvm/Support/YAMLParser.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/YAMLParser.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/YAMLParser.h (original)
> +++ llvm/trunk/include/llvm/Support/YAMLParser.h Wed Mar 5 23:51:42 2014
> @@ -38,7 +38,6 @@
> #ifndef LLVM_SUPPORT_YAMLPARSER_H
> #define LLVM_SUPPORT_YAMLPARSER_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/Support/Allocator.h"
> @@ -96,8 +95,8 @@ public:
> void printError(Node *N, const Twine &Msg);
>
> private:
> - OwningPtr<Scanner> scanner;
> - OwningPtr<Document> CurrentDoc;
> + std::unique_ptr<Scanner> scanner;
> + std::unique_ptr<Document> CurrentDoc;
>
> friend class Document;
> };
> @@ -115,7 +114,7 @@ public:
> NK_Alias
> };
>
> - Node(unsigned int Type, OwningPtr<Document> &, StringRef Anchor,
> + Node(unsigned int Type, std::unique_ptr<Document> &, StringRef Anchor,
> StringRef Tag);
>
> /// @brief Get the value of the anchor attached to this node. If it does not
> @@ -156,7 +155,7 @@ public:
> }
>
> protected:
> - OwningPtr<Document> &Doc;
> + std::unique_ptr<Document> &Doc;
> SMRange SourceRange;
>
> void operator delete(void *) throw() {}
> @@ -177,7 +176,7 @@ private:
> class NullNode : public Node {
> void anchor() override;
> public:
> - NullNode(OwningPtr<Document> &D)
> + NullNode(std::unique_ptr<Document> &D)
> : Node(NK_Null, D, StringRef(), StringRef()) {}
>
> static inline bool classof(const Node *N) {
> @@ -193,7 +192,7 @@ public:
> class ScalarNode : public Node {
> void anchor() override;
> public:
> - ScalarNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag,
> + ScalarNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag,
> StringRef Val)
> : Node(NK_Scalar, D, Anchor, Tag), Value(Val) {
> SMLoc Start = SMLoc::getFromPointer(Val.begin());
> @@ -235,11 +234,8 @@ private:
> class KeyValueNode : public Node {
> void anchor() override;
> public:
> - KeyValueNode(OwningPtr<Document> &D)
> - : Node(NK_KeyValue, D, StringRef(), StringRef())
> - , Key(0)
> - , Value(0)
> - {}
> + KeyValueNode(std::unique_ptr<Document> &D)
> + : Node(NK_KeyValue, D, StringRef(), StringRef()), Key(0), Value(0) {}
>
> /// @brief Parse and return the key.
> ///
> @@ -353,7 +349,7 @@ public:
> MT_Inline ///< An inline mapping node is used for "[key: value]".
> };
>
> - MappingNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag,
> + MappingNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag,
> MappingType MT)
> : Node(NK_Mapping, D, Anchor, Tag), Type(MT), IsAtBeginning(true),
> IsAtEnd(false), CurrentEntry(0) {}
> @@ -410,7 +406,7 @@ public:
> ST_Indentless
> };
>
> - SequenceNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag,
> + SequenceNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag,
> SequenceType ST)
> : Node(NK_Sequence, D, Anchor, Tag), SeqType(ST), IsAtBeginning(true),
> IsAtEnd(false),
> @@ -453,8 +449,8 @@ private:
> class AliasNode : public Node {
> void anchor() override;
> public:
> - AliasNode(OwningPtr<Document> &D, StringRef Val)
> - : Node(NK_Alias, D, StringRef(), StringRef()), Name(Val) {}
> + AliasNode(std::unique_ptr<Document> &D, StringRef Val)
> + : Node(NK_Alias, D, StringRef(), StringRef()), Name(Val) {}
>
> StringRef getName() const { return Name; }
> Node *getTarget();
> @@ -531,7 +527,7 @@ private:
> class document_iterator {
> public:
> document_iterator() : Doc(0) {}
> - document_iterator(OwningPtr<Document> &D) : Doc(&D) {}
> + document_iterator(std::unique_ptr<Document> &D) : Doc(&D) {}
>
> bool operator ==(const document_iterator &Other) {
> if (isAtEnd() || Other.isAtEnd())
> @@ -558,16 +554,14 @@ public:
> return *Doc->get();
> }
>
> - OwningPtr<Document> &operator ->() {
> - return *Doc;
> - }
> + std::unique_ptr<Document> &operator->() { return *Doc; }
>
> private:
> bool isAtEnd() const {
> return !Doc || !*Doc;
> }
>
> - OwningPtr<Document> *Doc;
> + std::unique_ptr<Document> *Doc;
> };
>
> }
>
> Modified: llvm/trunk/include/llvm/Support/YAMLTraits.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/YAMLTraits.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/YAMLTraits.h (original)
> +++ llvm/trunk/include/llvm/Support/YAMLTraits.h Wed Mar 5 23:51:42 2014
> @@ -852,15 +852,15 @@ public:
> void nextDocument();
>
> private:
> - llvm::SourceMgr SrcMgr; // must be before Strm
> - OwningPtr<llvm::yaml::Stream> Strm;
> - OwningPtr<HNode> TopNode;
> - llvm::error_code EC;
> - llvm::BumpPtrAllocator StringAllocator;
> - llvm::yaml::document_iterator DocIterator;
> - std::vector<bool> BitValuesUsed;
> - HNode *CurrentNode;
> - bool ScalarMatchFound;
> + llvm::SourceMgr SrcMgr; // must be before Strm
> + std::unique_ptr<llvm::yaml::Stream> Strm;
> + std::unique_ptr<HNode> TopNode;
> + llvm::error_code EC;
> + llvm::BumpPtrAllocator StringAllocator;
> + llvm::yaml::document_iterator DocIterator;
> + std::vector<bool> BitValuesUsed;
> + HNode *CurrentNode;
> + bool ScalarMatchFound;
> };
>
>
>
> Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
> +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Wed Mar 5 23:51:42 2014
> @@ -59,7 +59,7 @@ INITIALIZE_PASS_END(MemoryDependenceAnal
> "Memory Dependence Analysis", false, true)
>
> MemoryDependenceAnalysis::MemoryDependenceAnalysis()
> -: FunctionPass(ID), PredCache(0) {
> + : FunctionPass(ID), PredCache() {
> initializeMemoryDependenceAnalysisPass(*PassRegistry::getPassRegistry());
> }
> MemoryDependenceAnalysis::~MemoryDependenceAnalysis() {
>
> Modified: llvm/trunk/lib/AsmParser/Parser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/Parser.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/AsmParser/Parser.cpp (original)
> +++ llvm/trunk/lib/AsmParser/Parser.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
>
> #include "llvm/AsmParser/Parser.h"
> #include "LLParser.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/Module.h"
> #include "llvm/Support/MemoryBuffer.h"
> #include "llvm/Support/SourceMgr.h"
> @@ -34,7 +33,7 @@ Module *llvm::ParseAssembly(MemoryBuffer
> return LLParser(F, SM, Err, M).Run() ? 0 : M;
>
> // Otherwise create a new module.
> - OwningPtr<Module> M2(new Module(F->getBufferIdentifier(), Context));
> + std::unique_ptr<Module> M2(new Module(F->getBufferIdentifier(), Context));
> if (LLParser(F, SM, Err, M2.get()).Run())
> return 0;
> return M2.release();
> @@ -42,7 +41,7 @@ Module *llvm::ParseAssembly(MemoryBuffer
>
> Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,
> LLVMContext &Context) {
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, File)) {
> Err = SMDiagnostic(Filename, SourceMgr::DK_Error,
> "Could not open input file: " + ec.message());
>
> Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h (original)
> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h Wed Mar 5 23:51:42 2014
> @@ -127,7 +127,7 @@ class BitcodeReader : public GVMateriali
> Module *TheModule;
> MemoryBuffer *Buffer;
> bool BufferOwned;
> - OwningPtr<BitstreamReader> StreamFile;
> + std::unique_ptr<BitstreamReader> StreamFile;
> BitstreamCursor Stream;
> DataStreamer *LazyStreamer;
> uint64_t NextUnreadBit;
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
>
> #define DEBUG_TYPE "asm-printer"
> #include "llvm/CodeGen/AsmPrinter.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/Twine.h"
> #include "llvm/CodeGen/MachineBasicBlock.h"
> @@ -118,16 +117,15 @@ void AsmPrinter::EmitInlineAsm(StringRef
> // Tell SrcMgr about this buffer, it takes ownership of the buffer.
> SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
>
> - OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr,
> - OutContext, OutStreamer,
> - *MAI));
> + std::unique_ptr<MCAsmParser> Parser(
> + createMCAsmParser(SrcMgr, OutContext, OutStreamer, *MAI));
>
> // Initialize the parser with a fresh subtarget info. It is better to use a
> // new STI here because the parser may modify it and we do not want those
> // modifications to persist after parsing the inlineasm. The modifications
> // made by the parser will be seen by the code emitters because it passes
> // the current STI down to the EncodeInstruction() method.
> - OwningPtr<MCSubtargetInfo> STI(TM.getTarget().createMCSubtargetInfo(
> + std::unique_ptr<MCSubtargetInfo> STI(TM.getTarget().createMCSubtargetInfo(
> TM.getTargetTriple(), TM.getTargetCPU(), TM.getTargetFeatureString()));
>
> // Preserve a copy of the original STI because the parser may modify it. For
> @@ -136,8 +134,8 @@ void AsmPrinter::EmitInlineAsm(StringRef
> // emitInlineAsmEnd().
> MCSubtargetInfo STIOrig = *STI;
>
> - OwningPtr<MCTargetAsmParser>
> - TAP(TM.getTarget().createMCAsmParser(*STI, *Parser, *MII));
> + std::unique_ptr<MCTargetAsmParser> TAP(
> + TM.getTarget().createMCAsmParser(*STI, *Parser, *MII));
> if (!TAP)
> report_fatal_error("Inline asm not supported by this streamer because"
> " we don't have an asm parser for this target\n");
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Wed Mar 5 23:51:42 2014
> @@ -18,7 +18,6 @@
> #include "DwarfDebug.h"
> #include "llvm/ADT/DenseMap.h"
> #include "llvm/ADT/Optional.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/IR/DIBuilder.h"
> #include "llvm/IR/DebugInfo.h"
> @@ -71,7 +70,7 @@ protected:
> DICompileUnit CUNode;
>
> /// Unit debug information entry.
> - const OwningPtr<DIE> UnitDie;
> + const std::unique_ptr<DIE> UnitDie;
>
> /// Offset of the UnitDie from beginning of debug info section.
> unsigned DebugInfoOffset;
>
> Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Target/TargetMachine.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/CodeGen/AsmPrinter.h"
> #include "llvm/CodeGen/MachineFunctionAnalysis.h"
> #include "llvm/CodeGen/MachineModuleInfo.h"
> @@ -174,7 +173,7 @@ bool LLVMTargetMachine::addPassesToEmitF
> const MCRegisterInfo &MRI = *getRegisterInfo();
> const MCInstrInfo &MII = *getInstrInfo();
> const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
> - OwningPtr<MCStreamer> AsmStreamer;
> + std::unique_ptr<MCStreamer> AsmStreamer;
>
> switch (FileType) {
> case CGFT_AssemblyFile: {
> @@ -281,7 +280,7 @@ bool LLVMTargetMachine::addPassesToEmitM
> if (MCE == 0 || MAB == 0)
> return true;
>
> - OwningPtr<MCStreamer> AsmStreamer;
> + std::unique_ptr<MCStreamer> AsmStreamer;
> AsmStreamer.reset(getTarget().createMCObjectStreamer(
> getTargetTriple(), *Ctx, *MAB, Out, MCE, STI, hasMCRelaxAll(),
> hasMCNoExecStack()));
>
> Modified: llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp (original)
> +++ llvm/trunk/lib/CodeGen/LiveRegMatrix.cpp Wed Mar 5 23:51:42 2014
> @@ -67,7 +67,7 @@ void LiveRegMatrix::releaseMemory() {
> Matrix[i].clear();
> // No need to clear Queries here, since LiveIntervalUnion::Query doesn't
> // have anything important to clear and LiveRegMatrix's runOnFunction()
> - // does a OwningPtr::reset anyways.
> + // does a std::unique_ptr::reset anyways.
> }
> }
>
>
> Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #define DEBUG_TYPE "misched"
>
> #include "llvm/CodeGen/MachineScheduler.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/PriorityQueue.h"
> #include "llvm/Analysis/AliasAnalysis.h"
> #include "llvm/CodeGen/LiveIntervalAnalysis.h"
> @@ -321,7 +320,7 @@ bool MachineScheduler::runOnMachineFunct
>
> // Instantiate the selected scheduler for this target, function, and
> // optimization level.
> - OwningPtr<ScheduleDAGInstrs> Scheduler(createMachineScheduler());
> + std::unique_ptr<ScheduleDAGInstrs> Scheduler(createMachineScheduler());
> scheduleRegions(*Scheduler);
>
> DEBUG(LIS->dump());
> @@ -342,7 +341,7 @@ bool PostMachineScheduler::runOnMachineF
>
> // Instantiate the selected scheduler for this target, function, and
> // optimization level.
> - OwningPtr<ScheduleDAGInstrs> Scheduler(createPostMachineScheduler());
> + std::unique_ptr<ScheduleDAGInstrs> Scheduler(createPostMachineScheduler());
> scheduleRegions(*Scheduler);
>
> if (VerifyScheduling)
>
> Modified: llvm/trunk/lib/CodeGen/RegAllocBase.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBase.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/RegAllocBase.h (original)
> +++ llvm/trunk/lib/CodeGen/RegAllocBase.h Wed Mar 5 23:51:42 2014
> @@ -37,7 +37,6 @@
> #ifndef LLVM_CODEGEN_REGALLOCBASE
> #define LLVM_CODEGEN_REGALLOCBASE
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/CodeGen/LiveInterval.h"
> #include "llvm/CodeGen/RegisterClassInfo.h"
>
>
> Modified: llvm/trunk/lib/CodeGen/RegAllocBasic.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/RegAllocBasic.cpp (original)
> +++ llvm/trunk/lib/CodeGen/RegAllocBasic.cpp Wed Mar 5 23:51:42 2014
> @@ -64,7 +64,7 @@ class RABasic : public MachineFunctionPa
> MachineFunction *MF;
>
> // state
> - OwningPtr<Spiller> SpillerInstance;
> + std::unique_ptr<Spiller> SpillerInstance;
> std::priority_queue<LiveInterval*, std::vector<LiveInterval*>,
> CompSpillWeight> Queue;
>
>
> Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
> +++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Wed Mar 5 23:51:42 2014
> @@ -101,7 +101,7 @@ class RAGreedy : public MachineFunctionP
> LiveDebugVariables *DebugVars;
>
> // state
> - OwningPtr<Spiller> SpillerInstance;
> + std::unique_ptr<Spiller> SpillerInstance;
> PQueue Queue;
> unsigned NextCascade;
>
> @@ -196,8 +196,8 @@ class RAGreedy : public MachineFunctionP
> };
>
> // splitting state.
> - OwningPtr<SplitAnalysis> SA;
> - OwningPtr<SplitEditor> SE;
> + std::unique_ptr<SplitAnalysis> SA;
> + std::unique_ptr<SplitEditor> SE;
>
> /// Cached per-block interference maps
> InterferenceCache IntfCache;
>
> Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
> +++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Wed Mar 5 23:51:42 2014
> @@ -34,7 +34,6 @@
> #include "llvm/CodeGen/RegAllocPBQP.h"
> #include "RegisterCoalescer.h"
> #include "Spiller.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Analysis/AliasAnalysis.h"
> #include "llvm/CodeGen/CalcSpillWeights.h"
> #include "llvm/CodeGen/LiveIntervalAnalysis.h"
> @@ -88,7 +87,7 @@ public:
> static char ID;
>
> /// Construct a PBQP register allocator.
> - RegAllocPBQP(OwningPtr<PBQPBuilder> &b, char *cPassID=0)
> + RegAllocPBQP(std::unique_ptr<PBQPBuilder> &b, char *cPassID=0)
> : MachineFunctionPass(ID), builder(b.release()), customPassID(cPassID) {
> initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
> initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
> @@ -117,8 +116,7 @@ private:
> typedef std::map<RegPair, PBQP::PBQPNum> CoalesceMap;
> typedef std::set<unsigned> RegSet;
>
> -
> - OwningPtr<PBQPBuilder> builder;
> + std::unique_ptr<PBQPBuilder> builder;
>
> char *customPassID;
>
> @@ -129,7 +127,7 @@ private:
> MachineRegisterInfo *mri;
> const MachineBlockFrequencyInfo *mbfi;
>
> - OwningPtr<Spiller> spiller;
> + std::unique_ptr<Spiller> spiller;
> LiveIntervals *lis;
> LiveStacks *lss;
> VirtRegMap *vrm;
> @@ -191,7 +189,7 @@ PBQPRAProblem *PBQPBuilder::build(Machin
> MachineRegisterInfo *mri = &mf->getRegInfo();
> const TargetRegisterInfo *tri = mf->getTarget().getRegisterInfo();
>
> - OwningPtr<PBQPRAProblem> p(new PBQPRAProblem());
> + std::unique_ptr<PBQPRAProblem> p(new PBQPRAProblem());
> PBQPRAGraph &g = p->getGraph();
> RegSet pregs;
>
> @@ -314,7 +312,7 @@ PBQPRAProblem *PBQPBuilderWithCoalescing
> const MachineBlockFrequencyInfo *mbfi,
> const RegSet &vregs) {
>
> - OwningPtr<PBQPRAProblem> p(PBQPBuilder::build(mf, lis, mbfi, vregs));
> + std::unique_ptr<PBQPRAProblem> p(PBQPBuilder::build(mf, lis, mbfi, vregs));
> PBQPRAGraph &g = p->getGraph();
>
> const TargetMachine &tm = mf->getTarget();
> @@ -587,8 +585,8 @@ bool RegAllocPBQP::runOnMachineFunction(
> while (!pbqpAllocComplete) {
> DEBUG(dbgs() << " PBQP Regalloc round " << round << ":\n");
>
> - OwningPtr<PBQPRAProblem> problem(
> - builder->build(mf, lis, mbfi, vregsToAlloc));
> + std::unique_ptr<PBQPRAProblem> problem(
> + builder->build(mf, lis, mbfi, vregsToAlloc));
>
> #ifndef NDEBUG
> if (pbqpDumpGraphs) {
> @@ -622,14 +620,14 @@ bool RegAllocPBQP::runOnMachineFunction(
> return true;
> }
>
> -FunctionPass* llvm::createPBQPRegisterAllocator(
> - OwningPtr<PBQPBuilder> &builder,
> - char *customPassID) {
> +FunctionPass *
> +llvm::createPBQPRegisterAllocator(std::unique_ptr<PBQPBuilder> &builder,
> + char *customPassID) {
> return new RegAllocPBQP(builder, customPassID);
> }
>
> FunctionPass* llvm::createDefaultPBQPRegisterAllocator() {
> - OwningPtr<PBQPBuilder> Builder;
> + std::unique_ptr<PBQPBuilder> Builder;
> if (pbqpCoalescing)
> Builder.reset(new PBQPBuilderWithCoalescing());
> else
>
> Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
> +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
>
> #define DEBUG_TYPE "regalloc"
> #include "RegisterCoalescer.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/SmallSet.h"
> #include "llvm/ADT/Statistic.h"
>
> Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original)
> +++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #define DEBUG_TYPE "tailduplication"
> #include "llvm/CodeGen/Passes.h"
> #include "llvm/ADT/DenseSet.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SetVector.h"
> #include "llvm/ADT/SmallSet.h"
> #include "llvm/ADT/Statistic.h"
> @@ -65,7 +64,7 @@ namespace {
> const MachineBranchProbabilityInfo *MBPI;
> MachineModuleInfo *MMI;
> MachineRegisterInfo *MRI;
> - OwningPtr<RegScavenger> RS;
> + std::unique_ptr<RegScavenger> RS;
> bool PreRegAlloc;
>
> // SSAUpdateVRs - A list of virtual registers for which to update SSA form.
>
> Modified: llvm/trunk/lib/DebugInfo/DWARFContext.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARFContext.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARFContext.cpp Wed Mar 5 23:51:42 2014
> @@ -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::DWARFContextInMemo
> if (!zlib::isAvailable() ||
> !consumeCompressedDebugSectionHeader(data, OriginalSize))
> continue;
> - OwningPtr<MemoryBuffer> UncompressedSection;
> + std::unique_ptr<MemoryBuffer> UncompressedSection;
> if (zlib::uncompress(data, UncompressedSection, OriginalSize) !=
> zlib::StatusOK)
> continue;
>
> Modified: llvm/trunk/lib/DebugInfo/DWARFContext.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARFContext.h (original)
> +++ llvm/trunk/lib/DebugInfo/DWARFContext.h Wed Mar 5 23:51:42 2014
> @@ -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;
>
> Modified: llvm/trunk/lib/DebugInfo/DWARFUnit.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFUnit.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARFUnit.h (original)
> +++ llvm/trunk/lib/DebugInfo/DWARFUnit.h Wed Mar 5 23:51:42 2014
> @@ -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);
>
> Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Wed Mar 5 23:51:42 2014
> @@ -443,7 +443,7 @@ ExecutionEngine *ExecutionEngine::create
> }
>
> ExecutionEngine *EngineBuilder::create(TargetMachine *TM) {
> - OwningPtr<TargetMachine> TheTM(TM); // Take ownership.
> + std::unique_ptr<TargetMachine> TheTM(TM); // Take ownership.
>
> // Make sure we can resolve symbols in the program as well. The zero arg
> // to the function tells DynamicLibrary to load the program, not a library.
>
> Modified: llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp Wed Mar 5 23:51:42 2014
> @@ -20,7 +20,6 @@
> #include "llvm/IR/Function.h"
> #include "llvm/IR/Metadata.h"
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/CodeGen/MachineFunction.h"
> #include "llvm/DebugInfo/DIContext.h"
> #include "llvm/ExecutionEngine/ObjectImage.h"
> @@ -40,7 +39,7 @@ namespace {
> class IntelJITEventListener : public JITEventListener {
> typedef DenseMap<void*, unsigned int> MethodIDMap;
>
> - OwningPtr<IntelJITEventsWrapper> Wrapper;
> + std::unique_ptr<IntelJITEventsWrapper> Wrapper;
> MethodIDMap MethodIDs;
> FilenameCache Filenames;
>
>
> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> #define DEBUG_TYPE "jit"
> #include "JIT.h"
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/ADT/Statistic.h"
>
> Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Wed Mar 5 23:51:42 2014
> @@ -146,7 +146,7 @@ ObjectBufferStream* MCJIT::emitObject(Mo
> PM.add(new DataLayoutPass(M));
>
> // The RuntimeDyld will take ownership of this shortly
> - OwningPtr<ObjectBufferStream> CompiledObject(new ObjectBufferStream());
> + std::unique_ptr<ObjectBufferStream> CompiledObject(new ObjectBufferStream());
>
> // Turn the machine code intermediate representation into bytes in memory
> // that may be executed.
> @@ -164,7 +164,7 @@ ObjectBufferStream* MCJIT::emitObject(Mo
> if (ObjCache) {
> // MemoryBuffer is a thin wrapper around the actual memory, so it's OK
> // to create a temporary object here and delete it after the call.
> - OwningPtr<MemoryBuffer> MB(CompiledObject->getMemBuffer());
> + std::unique_ptr<MemoryBuffer> MB(CompiledObject->getMemBuffer());
> ObjCache->notifyObjectCompiled(M, MB.get());
> }
>
> @@ -183,10 +183,10 @@ void MCJIT::generateCodeForModule(Module
> if (OwnedModules.hasModuleBeenLoaded(M))
> return;
>
> - OwningPtr<ObjectBuffer> ObjectToLoad;
> + std::unique_ptr<ObjectBuffer> ObjectToLoad;
> // Try to load the pre-compiled object from cache if possible
> if (0 != ObjCache) {
> - OwningPtr<MemoryBuffer> PreCompiledObject(ObjCache->getObject(M));
> + std::unique_ptr<MemoryBuffer> PreCompiledObject(ObjCache->getObject(M));
> if (0 != PreCompiledObject.get())
> ObjectToLoad.reset(new ObjectBuffer(PreCompiledObject.release()));
> }
> @@ -304,7 +304,7 @@ uint64_t MCJIT::getSymbolAddress(const s
> // Look for our symbols in each Archive
> object::Archive::child_iterator ChildIt = A->findSym(Name);
> if (ChildIt != A->child_end()) {
> - OwningPtr<object::Binary> ChildBin;
> + std::unique_ptr<object::Binary> ChildBin;
> // FIXME: Support nested archives?
> if (!ChildIt->getAsBinary(ChildBin) && ChildBin->isObject()) {
> object::ObjectFile *OF = reinterpret_cast<object::ObjectFile *>(
>
> Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h (original)
> +++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.h Wed Mar 5 23:51:42 2014
> @@ -76,7 +76,7 @@ public:
>
> private:
> MCJIT *ParentEngine;
> - OwningPtr<RTDyldMemoryManager> ClientMM;
> + std::unique_ptr<RTDyldMemoryManager> ClientMM;
> };
>
> // About Module states: added->loaded->finalized.
>
> Modified: llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp Wed Mar 5 23:51:42 2014
> @@ -18,7 +18,6 @@
> #define DEBUG_TYPE "oprofile-jit-event-listener"
> #include "llvm/IR/DebugInfo.h"
> #include "llvm/IR/Function.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/CodeGen/MachineFunction.h"
> #include "llvm/ExecutionEngine/ObjectImage.h"
> #include "llvm/ExecutionEngine/OProfileWrapper.h"
> @@ -229,7 +228,8 @@ void OProfileJITEventListener::NotifyFre
>
> namespace llvm {
> JITEventListener *JITEventListener::createOProfileJITEventListener() {
> - static OwningPtr<OProfileWrapper> JITProfilingWrapper(new OProfileWrapper);
> + static std::unique_ptr<OProfileWrapper> JITProfilingWrapper(
> + new OProfileWrapper);
> return new OProfileJITEventListener(*JITProfilingWrapper);
> }
>
>
> Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp Wed Mar 5 23:51:42 2014
> @@ -96,7 +96,7 @@ ObjectImage *RuntimeDyldImpl::loadObject
> ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
> MutexGuard locked(lock);
>
> - OwningPtr<ObjectImage> Obj(InputObject);
> + std::unique_ptr<ObjectImage> Obj(InputObject);
> if (!Obj)
> return NULL;
>
>
> Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> #include "JITRegistrar.h"
> #include "ObjectImageCommon.h"
> #include "llvm/ADT/IntervalMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/ADT/Triple.h"
>
> Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
>
> #define DEBUG_TYPE "dyld"
> #include "RuntimeDyldMachO.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/StringRef.h"
> using namespace llvm;
>
> Modified: llvm/trunk/lib/IR/AsmWriter.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IR/AsmWriter.h (original)
> +++ llvm/trunk/lib/IR/AsmWriter.h Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> #define LLVM_IR_ASSEMBLYWRITER_H
>
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/Attributes.h"
> #include "llvm/IR/Instructions.h"
> #include "llvm/IR/TypeFinder.h"
> @@ -67,7 +66,7 @@ protected:
> const Module *TheModule;
>
> private:
> - OwningPtr<SlotTracker> ModuleSlotTracker;
> + std::unique_ptr<SlotTracker> ModuleSlotTracker;
> SlotTracker &Machine;
> TypePrinting TypePrinter;
> AssemblyAnnotationWriter *AnnotationWriter;
>
> Modified: llvm/trunk/lib/IR/Core.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IR/Core.cpp (original)
> +++ llvm/trunk/lib/IR/Core.cpp Wed Mar 5 23:51:42 2014
> @@ -2536,7 +2536,7 @@ LLVMBool LLVMCreateMemoryBufferWithConte
> LLVMMemoryBufferRef *OutMemBuf,
> char **OutMessage) {
>
> - OwningPtr<MemoryBuffer> MB;
> + std::unique_ptr<MemoryBuffer> MB;
> error_code ec;
> if (!(ec = MemoryBuffer::getFile(Path, MB))) {
> *OutMemBuf = wrap(MB.release());
> @@ -2549,7 +2549,7 @@ LLVMBool LLVMCreateMemoryBufferWithConte
>
> LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
> char **OutMessage) {
> - OwningPtr<MemoryBuffer> MB;
> + std::unique_ptr<MemoryBuffer> MB;
> error_code ec;
> if (!(ec = MemoryBuffer::getSTDIN(MB))) {
> *OutMemBuf = wrap(MB.release());
>
> Modified: llvm/trunk/lib/IR/GCOV.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/GCOV.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IR/GCOV.cpp (original)
> +++ llvm/trunk/lib/IR/GCOV.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/GCOV.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/Support/Debug.h"
> #include "llvm/Support/FileSystem.h"
> @@ -472,7 +471,7 @@ void FileInfo::print(StringRef GCNOFile,
> for (StringMap<LineData>::const_iterator I = LineInfo.begin(),
> E = LineInfo.end(); I != E; ++I) {
> StringRef Filename = I->first();
> - OwningPtr<MemoryBuffer> Buff;
> + std::unique_ptr<MemoryBuffer> Buff;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
> errs() << Filename << ": " << ec.message() << "\n";
> return;
>
> Modified: llvm/trunk/lib/IR/Module.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Module.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IR/Module.cpp (original)
> +++ llvm/trunk/lib/IR/Module.cpp Wed Mar 5 23:51:42 2014
> @@ -43,7 +43,7 @@ template class llvm::SymbolTableListTrai
> //
>
> Module::Module(StringRef MID, LLVMContext &C)
> - : Context(C), Materializer(NULL), ModuleID(MID), DL("") {
> + : Context(C), Materializer(), ModuleID(MID), DL("") {
> ValSymTab = new ValueSymbolTable();
> NamedMDSymTab = new StringMap<NamedMDNode *>();
> Context.addModule(this);
>
> Modified: llvm/trunk/lib/IRReader/IRReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IRReader/IRReader.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/IRReader/IRReader.cpp (original)
> +++ llvm/trunk/lib/IRReader/IRReader.cpp Wed Mar 5 23:51:42 2014
> @@ -10,7 +10,6 @@
> #include "llvm/IRReader/IRReader.h"
> #include "llvm-c/Core.h"
> #include "llvm-c/IRReader.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/AsmParser/Parser.h"
> #include "llvm/Bitcode/ReaderWriter.h"
> #include "llvm/IR/LLVMContext.h"
> @@ -53,7 +52,7 @@ Module *llvm::getLazyIRModule(MemoryBuff
>
> Module *llvm::getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err,
> LLVMContext &Context) {
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, File)) {
> Err = SMDiagnostic(Filename, SourceMgr::DK_Error,
> "Could not open input file: " + ec.message());
> @@ -86,7 +85,7 @@ Module *llvm::ParseIR(MemoryBuffer *Buff
>
> Module *llvm::ParseIRFile(const std::string &Filename, SMDiagnostic &Err,
> LLVMContext &Context) {
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, File)) {
> Err = SMDiagnostic(Filename, SourceMgr::DK_Error,
> "Could not open input file: " + ec.message());
>
> Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
> +++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Wed Mar 5 23:51:42 2014
> @@ -264,7 +264,7 @@ const void* LTOCodeGenerator::compile(si
> delete NativeObjectFile;
>
> // read .o file into memory buffer
> - OwningPtr<MemoryBuffer> BuffPtr;
> + std::unique_ptr<MemoryBuffer> BuffPtr;
> if (error_code ec = MemoryBuffer::getFile(name, BuffPtr, -1, false)) {
> errMsg = ec.message();
> sys::fs::remove(NativeObjectPath);
>
> Modified: llvm/trunk/lib/LTO/LTOModule.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/LTO/LTOModule.cpp (original)
> +++ llvm/trunk/lib/LTO/LTOModule.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/LTO/LTOModule.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/Triple.h"
> #include "llvm/Bitcode/ReaderWriter.h"
> #include "llvm/IR/Constants.h"
> @@ -80,7 +79,7 @@ bool LTOModule::isBitcodeFileForTarget(c
>
> bool LTOModule::isBitcodeFileForTarget(const char *path,
> const char *triplePrefix) {
> - OwningPtr<MemoryBuffer> buffer;
> + std::unique_ptr<MemoryBuffer> buffer;
> if (MemoryBuffer::getFile(path, buffer))
> return false;
> return isTargetMatch(buffer.release(), triplePrefix);
> @@ -98,7 +97,7 @@ bool LTOModule::isTargetMatch(MemoryBuff
> /// the buffer.
> LTOModule *LTOModule::makeLTOModule(const char *path, TargetOptions options,
> std::string &errMsg) {
> - OwningPtr<MemoryBuffer> buffer;
> + std::unique_ptr<MemoryBuffer> buffer;
> if (error_code ec = MemoryBuffer::getFile(path, buffer)) {
> errMsg = ec.message();
> return NULL;
> @@ -117,7 +116,7 @@ LTOModule *LTOModule::makeLTOModule(int
> off_t offset,
> TargetOptions options,
> std::string &errMsg) {
> - OwningPtr<MemoryBuffer> buffer;
> + std::unique_ptr<MemoryBuffer> buffer;
> if (error_code ec =
> MemoryBuffer::getOpenFileSlice(fd, path, buffer, map_size, offset)) {
> errMsg = ec.message();
> @@ -129,7 +128,7 @@ LTOModule *LTOModule::makeLTOModule(int
> LTOModule *LTOModule::makeLTOModule(const void *mem, size_t length,
> TargetOptions options,
> std::string &errMsg, StringRef path) {
> - OwningPtr<MemoryBuffer> buffer(makeBuffer(mem, length, path));
> + std::unique_ptr<MemoryBuffer> buffer(makeBuffer(mem, length, path));
> if (!buffer)
> return NULL;
> return makeLTOModule(buffer.release(), options, errMsg);
> @@ -146,7 +145,7 @@ LTOModule *LTOModule::makeLTOModule(Memo
> delete buffer;
> return NULL;
> }
> - OwningPtr<Module> m(ModuleOrErr.get());
> + std::unique_ptr<Module> m(ModuleOrErr.get());
>
> std::string TripleStr = m->getTargetTriple();
> if (TripleStr.empty())
> @@ -725,20 +724,19 @@ bool LTOModule::addAsmGlobalSymbols(std:
> if (inlineAsm.empty())
> return false;
>
> - OwningPtr<RecordStreamer> Streamer(new RecordStreamer(_context));
> + std::unique_ptr<RecordStreamer> Streamer(new RecordStreamer(_context));
> MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm);
> SourceMgr SrcMgr;
> SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
> - OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr,
> - _context, *Streamer,
> - *_target->getMCAsmInfo()));
> + std::unique_ptr<MCAsmParser> Parser(
> + createMCAsmParser(SrcMgr, _context, *Streamer, *_target->getMCAsmInfo()));
> const Target &T = _target->getTarget();
> - OwningPtr<MCInstrInfo> MCII(T.createMCInstrInfo());
> - OwningPtr<MCSubtargetInfo>
> - STI(T.createMCSubtargetInfo(_target->getTargetTriple(),
> - _target->getTargetCPU(),
> - _target->getTargetFeatureString()));
> - OwningPtr<MCTargetAsmParser> TAP(T.createMCAsmParser(*STI, *Parser.get(), *MCII));
> + std::unique_ptr<MCInstrInfo> MCII(T.createMCInstrInfo());
> + std::unique_ptr<MCSubtargetInfo> STI(T.createMCSubtargetInfo(
> + _target->getTargetTriple(), _target->getTargetCPU(),
> + _target->getTargetFeatureString()));
> + std::unique_ptr<MCTargetAsmParser> TAP(
> + T.createMCAsmParser(*STI, *Parser.get(), *MCII));
> if (!TAP) {
> errMsg = "target " + std::string(T.getName()) +
> " does not define AsmParser.";
>
> Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
> +++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/MC/MCELFObjectWriter.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/ADT/SmallString.h"
> @@ -79,7 +78,7 @@ class ELFObjectWriter : public MCObjectW
> };
>
> /// The target specific ELF writer instance.
> - llvm::OwningPtr<MCELFObjectTargetWriter> TargetObjectWriter;
> + std::unique_ptr<MCELFObjectTargetWriter> TargetObjectWriter;
>
> SmallPtrSet<const MCSymbol *, 16> UsedInReloc;
> SmallPtrSet<const MCSymbol *, 16> WeakrefUsedInReloc;
>
> Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
> +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/MC/MCStreamer.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/StringExtras.h"
> #include "llvm/ADT/Twine.h"
> @@ -41,9 +40,9 @@ protected:
> formatted_raw_ostream &OS;
> const MCAsmInfo *MAI;
> private:
> - OwningPtr<MCInstPrinter> InstPrinter;
> - OwningPtr<MCCodeEmitter> Emitter;
> - OwningPtr<MCAsmBackend> AsmBackend;
> + std::unique_ptr<MCInstPrinter> InstPrinter;
> + std::unique_ptr<MCCodeEmitter> Emitter;
> + std::unique_ptr<MCAsmBackend> AsmBackend;
>
> SmallString<128> CommentToEmit;
> raw_svector_ostream CommentStream;
>
> Modified: llvm/trunk/lib/MC/MCDisassembler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCDisassembler.cpp (original)
> +++ llvm/trunk/lib/MC/MCDisassembler.cpp Wed Mar 5 23:51:42 2014
> @@ -16,13 +16,9 @@ using namespace llvm;
> MCDisassembler::~MCDisassembler() {
> }
>
> -void
> -MCDisassembler::setupForSymbolicDisassembly(
> - LLVMOpInfoCallback GetOpInfo,
> - LLVMSymbolLookupCallback SymbolLookUp,
> - void *DisInfo,
> - MCContext *Ctx,
> - OwningPtr<MCRelocationInfo> &RelInfo) {
> +void MCDisassembler::setupForSymbolicDisassembly(
> + LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp,
> + void *DisInfo, MCContext *Ctx, std::unique_ptr<MCRelocationInfo> &RelInfo) {
> this->GetOpInfo = GetOpInfo;
> this->SymbolLookUp = SymbolLookUp;
> this->DisInfo = DisInfo;
> @@ -33,16 +29,12 @@ MCDisassembler::setupForSymbolicDisassem
> SymbolLookUp, DisInfo));
> }
>
> -void
> -MCDisassembler::setupForSymbolicDisassembly(
> - LLVMOpInfoCallback GetOpInfo,
> - LLVMSymbolLookupCallback SymbolLookUp,
> - void *DisInfo,
> - MCContext *Ctx,
> - std::unique_ptr<MCRelocationInfo> &RelInfo) {
> - OwningPtr<MCRelocationInfo> MCRI;
> +void MCDisassembler::setupForSymbolicDisassembly(
> + LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp,
> + void *DisInfo, MCContext *Ctx, OwningPtr<MCRelocationInfo> &RelInfo) {
> + std::unique_ptr<MCRelocationInfo> MCRI;
> setupForSymbolicDisassembly(GetOpInfo, SymbolLookUp, DisInfo, Ctx, MCRI);
> - RelInfo = MCRI.take_unique();
> + RelInfo = std::move(MCRI);
> }
>
> bool MCDisassembler::tryAddingSymbolicOperand(MCInst &Inst, int64_t Value,
> @@ -63,6 +55,6 @@ void MCDisassembler::tryAddingPcLoadRefe
> Symbolizer->tryAddingPcLoadReferenceComment(cStream, Value, Address);
> }
>
> -void MCDisassembler::setSymbolizer(OwningPtr<MCSymbolizer> &Symzer) {
> +void MCDisassembler::setSymbolizer(std::unique_ptr<MCSymbolizer> &Symzer) {
> Symbolizer.reset(Symzer.release());
> }
>
> Modified: llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp (original)
> +++ llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp Wed Mar 5 23:51:42 2014
> @@ -77,14 +77,13 @@ LLVMDisasmContextRef LLVMCreateDisasmCPU
> if (!DisAsm)
> return 0;
>
> - OwningPtr<MCRelocationInfo> RelInfo(
> - TheTarget->createMCRelocationInfo(Triple, *Ctx));
> + std::unique_ptr<MCRelocationInfo> RelInfo(
> + TheTarget->createMCRelocationInfo(Triple, *Ctx));
> if (!RelInfo)
> return 0;
>
> - OwningPtr<MCSymbolizer> Symbolizer(
> - TheTarget->createMCSymbolizer(Triple, GetOpInfo, SymbolLookUp, DisInfo,
> - Ctx, RelInfo.release()));
> + std::unique_ptr<MCSymbolizer> Symbolizer(TheTarget->createMCSymbolizer(
> + Triple, GetOpInfo, SymbolLookUp, DisInfo, Ctx, RelInfo.release()));
> DisAsm->setSymbolizer(Symbolizer);
> DisAsm->setupForSymbolicDisassembly(GetOpInfo, SymbolLookUp, DisInfo,
> Ctx, RelInfo);
>
> Modified: llvm/trunk/lib/MC/MCDisassembler/Disassembler.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCDisassembler/Disassembler.h (original)
> +++ llvm/trunk/lib/MC/MCDisassembler/Disassembler.h Wed Mar 5 23:51:42 2014
> @@ -18,7 +18,6 @@
> #define LLVM_MC_DISASSEMBLER_H
>
> #include "llvm-c/Disassembler.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/Support/raw_ostream.h"
> #include <string>
> @@ -56,23 +55,23 @@ private:
> // LLVMDisasmInstruction().
> //
> // The LLVM target corresponding to the disassembler.
> - // FIXME: using llvm::OwningPtr<const llvm::Target> causes a malloc error
> + // FIXME: using std::unique_ptr<const llvm::Target> causes a malloc error
> // when this LLVMDisasmContext is deleted.
> const Target *TheTarget;
> // The assembly information for the target architecture.
> - llvm::OwningPtr<const llvm::MCAsmInfo> MAI;
> + std::unique_ptr<const llvm::MCAsmInfo> MAI;
> // The register information for the target architecture.
> - llvm::OwningPtr<const llvm::MCRegisterInfo> MRI;
> + std::unique_ptr<const llvm::MCRegisterInfo> MRI;
> // The subtarget information for the target architecture.
> - llvm::OwningPtr<const llvm::MCSubtargetInfo> MSI;
> + std::unique_ptr<const llvm::MCSubtargetInfo> MSI;
> // The instruction information for the target architecture.
> - llvm::OwningPtr<const llvm::MCInstrInfo> MII;
> + std::unique_ptr<const llvm::MCInstrInfo> MII;
> // The assembly context for creating symbols and MCExprs.
> - llvm::OwningPtr<const llvm::MCContext> Ctx;
> + std::unique_ptr<const llvm::MCContext> Ctx;
> // The disassembler for the target architecture.
> - llvm::OwningPtr<const llvm::MCDisassembler> DisAsm;
> + std::unique_ptr<const llvm::MCDisassembler> DisAsm;
> // The instruction printer for the target architecture.
> - llvm::OwningPtr<llvm::MCInstPrinter> IP;
> + std::unique_ptr<llvm::MCInstPrinter> IP;
> // The options used to set up the disassembler.
> uint64_t Options;
> // The CPU string.
>
> Modified: llvm/trunk/lib/MC/MCExternalSymbolizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExternalSymbolizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCExternalSymbolizer.cpp (original)
> +++ llvm/trunk/lib/MC/MCExternalSymbolizer.cpp Wed Mar 5 23:51:42 2014
> @@ -191,7 +191,7 @@ MCSymbolizer *createMCSymbolizer(StringR
> MCRelocationInfo *RelInfo) {
> assert(Ctx != 0 && "No MCContext given for symbolic disassembly");
>
> - OwningPtr<MCRelocationInfo> RelInfoOwingPtr(RelInfo);
> + std::unique_ptr<MCRelocationInfo> RelInfoOwingPtr(RelInfo);
> return new MCExternalSymbolizer(*Ctx, RelInfoOwingPtr, GetOpInfo,
> SymbolLookUp, DisInfo);
> }
>
> Modified: llvm/trunk/lib/MC/MCModuleYAML.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCModuleYAML.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCModuleYAML.cpp (original)
> +++ llvm/trunk/lib/MC/MCModuleYAML.cpp Wed Mar 5 23:51:42 2014
> @@ -442,7 +442,7 @@ StringRef mcmodule2yaml(raw_ostream &OS,
> return "";
> }
>
> -StringRef yaml2mcmodule(OwningPtr<MCModule> &MCM, StringRef YamlContent,
> +StringRef yaml2mcmodule(std::unique_ptr<MCModule> &MCM, StringRef YamlContent,
> const MCInstrInfo &MII, const MCRegisterInfo &MRI) {
> MCM.reset(new MCModule);
> YAML2MCModule Parser(*MCM);
>
> Modified: llvm/trunk/lib/MC/MCObjectSymbolizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectSymbolizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCObjectSymbolizer.cpp (original)
> +++ llvm/trunk/lib/MC/MCObjectSymbolizer.cpp Wed Mar 5 23:51:42 2014
> @@ -34,7 +34,8 @@ class MCMachObjectSymbolizer : public MC
> uint64_t StubsIndSymIndex;
>
> public:
> - MCMachObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
> + MCMachObjectSymbolizer(MCContext &Ctx,
> + std::unique_ptr<MCRelocationInfo> &RelInfo,
> const MachOObjectFile *MOOF);
>
> StringRef findExternalFunctionAt(uint64_t Addr) override;
> @@ -44,12 +45,11 @@ public:
> };
> } // End unnamed namespace
>
> -
> -MCMachObjectSymbolizer::
> -MCMachObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
> - const MachOObjectFile *MOOF)
> - : MCObjectSymbolizer(Ctx, RelInfo, MOOF), MOOF(MOOF),
> - StubsStart(0), StubsCount(0), StubSize(0), StubsIndSymIndex(0) {
> +MCMachObjectSymbolizer::MCMachObjectSymbolizer(
> + MCContext &Ctx, std::unique_ptr<MCRelocationInfo> &RelInfo,
> + const MachOObjectFile *MOOF)
> + : MCObjectSymbolizer(Ctx, RelInfo, MOOF), MOOF(MOOF), StubsStart(0),
> + StubsCount(0), StubSize(0), StubsIndSymIndex(0) {
>
> for (section_iterator SI = MOOF->section_begin(), SE = MOOF->section_end();
> SI != SE; ++SI) {
> @@ -120,11 +120,10 @@ tryAddingPcLoadReferenceComment(raw_ostr
>
> //===- MCObjectSymbolizer -------------------------------------------------===//
>
> -MCObjectSymbolizer::MCObjectSymbolizer(MCContext &Ctx,
> - OwningPtr<MCRelocationInfo> &RelInfo,
> - const ObjectFile *Obj)
> - : MCSymbolizer(Ctx, RelInfo), Obj(Obj), SortedSections(), AddrToReloc() {
> -}
> +MCObjectSymbolizer::MCObjectSymbolizer(
> + MCContext &Ctx, std::unique_ptr<MCRelocationInfo> &RelInfo,
> + const ObjectFile *Obj)
> + : MCSymbolizer(Ctx, RelInfo), Obj(Obj), SortedSections(), AddrToReloc() {}
>
> bool MCObjectSymbolizer::
> tryAddingSymbolicOperand(MCInst &MI, raw_ostream &cStream,
> @@ -188,10 +187,9 @@ StringRef MCObjectSymbolizer::findExtern
> return StringRef();
> }
>
> -MCObjectSymbolizer *
> -MCObjectSymbolizer::createObjectSymbolizer(MCContext &Ctx,
> - OwningPtr<MCRelocationInfo> &RelInfo,
> - const ObjectFile *Obj) {
> +MCObjectSymbolizer *MCObjectSymbolizer::createObjectSymbolizer(
> + MCContext &Ctx, std::unique_ptr<MCRelocationInfo> &RelInfo,
> + const ObjectFile *Obj) {
> if (const MachOObjectFile *MOOF = dyn_cast<MachOObjectFile>(Obj))
> return new MCMachObjectSymbolizer(Ctx, RelInfo, MOOF);
> return new MCObjectSymbolizer(Ctx, RelInfo, Obj);
>
> Modified: llvm/trunk/lib/MC/MCSymbolizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSymbolizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCSymbolizer.cpp (original)
> +++ llvm/trunk/lib/MC/MCSymbolizer.cpp Wed Mar 5 23:51:42 2014
> @@ -12,9 +12,9 @@
>
> using namespace llvm;
>
> -MCSymbolizer::MCSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo)
> - : Ctx(Ctx), RelInfo(RelInfo.release()) {
> -}
> +MCSymbolizer::MCSymbolizer(MCContext &Ctx,
> + std::unique_ptr<MCRelocationInfo> &RelInfo)
> + : Ctx(Ctx), RelInfo(RelInfo.release()) {}
>
> MCSymbolizer::~MCSymbolizer() {
> }
>
> Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
> +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
>
> #include "llvm/MC/MCWinCOFFObjectWriter.h"
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/ADT/Twine.h"
> @@ -125,7 +124,7 @@ public:
> typedef DenseMap<MCSymbol const *, COFFSymbol *> symbol_map;
> typedef DenseMap<MCSection const *, COFFSection *> section_map;
>
> - llvm::OwningPtr<MCWinCOFFObjectTargetWriter> TargetObjectWriter;
> + std::unique_ptr<MCWinCOFFObjectTargetWriter> TargetObjectWriter;
>
> // Root level file contents.
> COFF::header Header;
>
> Modified: llvm/trunk/lib/Object/Binary.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Binary.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/Binary.cpp (original)
> +++ llvm/trunk/lib/Object/Binary.cpp Wed Mar 5 23:51:42 2014
> @@ -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(M
> }
>
> 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());
>
> Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
> +++ llvm/trunk/lib/Object/COFFObjectFile.cpp Wed Mar 5 23:51:42 2014
> @@ -1068,7 +1068,8 @@ error_code ExportDirectoryEntryRef::getS
> 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();
>
> Modified: llvm/trunk/lib/Object/ELFObjectFile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFObjectFile.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/ELFObjectFile.cpp (original)
> +++ llvm/trunk/lib/Object/ELFObjectFile.cpp Wed Mar 5 23:51:42 2014
> @@ -24,7 +24,7 @@ ErrorOr<ObjectFile *> ObjectFile::create
> 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)
>
> Modified: llvm/trunk/lib/Object/IRObjectFile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/IRObjectFile.cpp (original)
> +++ llvm/trunk/lib/Object/IRObjectFile.cpp Wed Mar 5 23:51:42 2014
> @@ -144,7 +144,7 @@ basic_symbol_iterator IRObjectFile::symb
> 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;
>
> Modified: llvm/trunk/lib/Object/MachOObjectFile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOObjectFile.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/MachOObjectFile.cpp (original)
> +++ llvm/trunk/lib/Object/MachOObjectFile.cpp Wed Mar 5 23:51:42 2014
> @@ -1549,7 +1549,7 @@ ErrorOr<ObjectFile *> ObjectFile::create
> 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")
>
> Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
> +++ llvm/trunk/lib/Object/MachOUniversal.cpp Wed Mar 5 23:51:42 2014
> @@ -72,7 +72,7 @@ MachOUniversalBinary::ObjectForArch::Obj
> }
>
> 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::ArchTy
> }
> }
>
> -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;
>
> Modified: llvm/trunk/lib/Object/ObjectFile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ObjectFile.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/ObjectFile.cpp (original)
> +++ llvm/trunk/lib/Object/ObjectFile.cpp Wed Mar 5 23:51:42 2014
> @@ -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::create
> }
>
> 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());
>
> Modified: llvm/trunk/lib/Support/CommandLine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/CommandLine.cpp (original)
> +++ llvm/trunk/lib/Support/CommandLine.cpp Wed Mar 5 23:51:42 2014
> @@ -18,7 +18,6 @@
>
> #include "llvm/Support/CommandLine.h"
> #include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/StringMap.h"
> @@ -620,7 +619,7 @@ void cl::TokenizeWindowsCommandLine(Stri
> static bool ExpandResponseFile(const char *FName, StringSaver &Saver,
> TokenizerCallback Tokenizer,
> SmallVectorImpl<const char *> &NewArgv) {
> - OwningPtr<MemoryBuffer> MemBuf;
> + std::unique_ptr<MemoryBuffer> MemBuf;
> if (MemoryBuffer::getFile(FName, MemBuf))
> return false;
> StringRef Str(MemBuf->getBufferStart(), MemBuf->getBufferSize());
>
> Modified: llvm/trunk/lib/Support/Compression.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Compression.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/Compression.cpp (original)
> +++ llvm/trunk/lib/Support/Compression.cpp Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/Compression.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/Config/config.h"
> #include "llvm/Support/Compiler.h"
> @@ -48,10 +47,10 @@ static zlib::Status encodeZlibReturnValu
>
> bool zlib::isAvailable() { return true; }
> zlib::Status zlib::compress(StringRef InputBuffer,
> - OwningPtr<MemoryBuffer> &CompressedBuffer,
> + std::unique_ptr<MemoryBuffer> &CompressedBuffer,
> CompressionLevel Level) {
> unsigned long CompressedSize = ::compressBound(InputBuffer.size());
> - OwningArrayPtr<char> TmpBuffer(new char[CompressedSize]);
> + std::unique_ptr<char[]> TmpBuffer(new char[CompressedSize]);
> int CLevel = encodeZlibCompressionLevel(Level);
> Status Res = encodeZlibReturnValue(::compress2(
> (Bytef *)TmpBuffer.get(), &CompressedSize,
> @@ -66,9 +65,9 @@ zlib::Status zlib::compress(StringRef In
> }
>
> zlib::Status zlib::uncompress(StringRef InputBuffer,
> - OwningPtr<MemoryBuffer> &UncompressedBuffer,
> + std::unique_ptr<MemoryBuffer> &UncompressedBuffer,
> size_t UncompressedSize) {
> - OwningArrayPtr<char> TmpBuffer(new char[UncompressedSize]);
> + std::unique_ptr<char[]> TmpBuffer(new char[UncompressedSize]);
> Status Res = encodeZlibReturnValue(
> ::uncompress((Bytef *)TmpBuffer.get(), (uLongf *)&UncompressedSize,
> (const Bytef *)InputBuffer.data(), InputBuffer.size()));
> @@ -88,12 +87,12 @@ uint32_t zlib::crc32(StringRef Buffer) {
> #else
> bool zlib::isAvailable() { return false; }
> zlib::Status zlib::compress(StringRef InputBuffer,
> - OwningPtr<MemoryBuffer> &CompressedBuffer,
> + std::unique_ptr<MemoryBuffer> &CompressedBuffer,
> CompressionLevel Level) {
> return zlib::StatusUnsupported;
> }
> zlib::Status zlib::uncompress(StringRef InputBuffer,
> - OwningPtr<MemoryBuffer> &UncompressedBuffer,
> + std::unique_ptr<MemoryBuffer> &UncompressedBuffer,
> size_t UncompressedSize) {
> return zlib::StatusUnsupported;
> }
>
> Modified: llvm/trunk/lib/Support/FileUtilities.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/FileUtilities.cpp (original)
> +++ llvm/trunk/lib/Support/FileUtilities.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/FileUtilities.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/Support/MemoryBuffer.h"
> #include "llvm/Support/Path.h"
> @@ -177,13 +176,13 @@ int llvm::DiffFilesWithTolerance(StringR
> std::string *Error) {
> // Now its safe to mmap the files into memory because both files
> // have a non-zero size.
> - OwningPtr<MemoryBuffer> F1;
> + std::unique_ptr<MemoryBuffer> F1;
> if (error_code ec = MemoryBuffer::getFile(NameA, F1)) {
> if (Error)
> *Error = ec.message();
> return 2;
> }
> - OwningPtr<MemoryBuffer> F2;
> + std::unique_ptr<MemoryBuffer> F2;
> if (error_code ec = MemoryBuffer::getFile(NameB, F2)) {
> if (Error)
> *Error = ec.message();
>
> Modified: llvm/trunk/lib/Support/LockFileManager.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/LockFileManager.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/LockFileManager.cpp (original)
> +++ llvm/trunk/lib/Support/LockFileManager.cpp Wed Mar 5 23:51:42 2014
> @@ -36,7 +36,7 @@ LockFileManager::readLockFile(StringRef
>
> // Read the owning host and PID out of the lock file. If it appears that the
> // owning process is dead, the lock file is invalid.
> - OwningPtr<MemoryBuffer> MB;
> + std::unique_ptr<MemoryBuffer> MB;
> if (MemoryBuffer::getFile(LockFileName, MB))
> return None;
>
>
> Modified: llvm/trunk/lib/Support/SourceMgr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/SourceMgr.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/SourceMgr.cpp (original)
> +++ llvm/trunk/lib/Support/SourceMgr.cpp Wed Mar 5 23:51:42 2014
> @@ -14,7 +14,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/SourceMgr.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/Twine.h"
> #include "llvm/Support/Locale.h"
> @@ -55,7 +54,7 @@ SourceMgr::~SourceMgr() {
> size_t SourceMgr::AddIncludeFile(const std::string &Filename,
> SMLoc IncludeLoc,
> std::string &IncludedFile) {
> - OwningPtr<MemoryBuffer> NewBuf;
> + std::unique_ptr<MemoryBuffer> NewBuf;
> IncludedFile = Filename;
> MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf);
>
>
> Modified: llvm/trunk/lib/Support/StringRef.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StringRef.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/StringRef.cpp (original)
> +++ llvm/trunk/lib/Support/StringRef.cpp Wed Mar 5 23:51:42 2014
> @@ -10,7 +10,6 @@
> #include "llvm/ADT/StringRef.h"
> #include "llvm/ADT/APInt.h"
> #include "llvm/ADT/Hashing.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/edit_distance.h"
> #include <bitset>
>
>
> Modified: llvm/trunk/lib/Support/Timer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/Timer.cpp (original)
> +++ llvm/trunk/lib/Support/Timer.cpp Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/Timer.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/Debug.h"
>
> Modified: llvm/trunk/lib/Support/Windows/Program.inc
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Program.inc?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/Windows/Program.inc (original)
> +++ llvm/trunk/lib/Support/Windows/Program.inc Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "WindowsSupport.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/FileSystem.h"
> #include <cstdio>
> #include <fcntl.h>
> @@ -187,7 +186,7 @@ static bool Execute(ProcessInfo &PI, Str
> }
>
> // Now build the command line.
> - OwningArrayPtr<char> command(new char[len+1]);
> + std::unique_ptr<char[]> command(new char[len+1]);
> char *p = command.get();
>
> for (unsigned i = 0; args[i]; i++) {
>
> Modified: llvm/trunk/lib/Support/YAMLParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/YAMLParser.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Support/YAMLParser.cpp (original)
> +++ llvm/trunk/lib/Support/YAMLParser.cpp Wed Mar 5 23:51:42 2014
> @@ -1561,12 +1561,10 @@ bool Scanner::fetchMoreTokens() {
> }
>
> Stream::Stream(StringRef Input, SourceMgr &SM)
> - : scanner(new Scanner(Input, SM))
> - , CurrentDoc(0) {}
> + : scanner(new Scanner(Input, SM)), CurrentDoc() {}
>
> Stream::Stream(MemoryBuffer *InputBuffer, SourceMgr &SM)
> - : scanner(new Scanner(InputBuffer, SM))
> - , CurrentDoc(0) {}
> + : scanner(new Scanner(InputBuffer, SM)), CurrentDoc() {}
>
> Stream::~Stream() {}
>
> @@ -1601,11 +1599,9 @@ void Stream::skip() {
> i->skip();
> }
>
> -Node::Node(unsigned int Type, OwningPtr<Document> &D, StringRef A, StringRef T)
> - : Doc(D)
> - , TypeID(Type)
> - , Anchor(A)
> - , Tag(T) {
> +Node::Node(unsigned int Type, std::unique_ptr<Document> &D, StringRef A,
> + StringRef T)
> + : Doc(D), TypeID(Type), Anchor(A), Tag(T) {
> SMLoc Start = SMLoc::getFromPointer(peekNext().Range.begin());
> SourceRange = SMRange(Start, Start);
> }
>
> Modified: llvm/trunk/lib/TableGen/Main.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Main.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/TableGen/Main.cpp (original)
> +++ llvm/trunk/lib/TableGen/Main.cpp Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "TGParser.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/MemoryBuffer.h"
> #include "llvm/Support/ToolOutputFile.h"
> @@ -81,7 +80,7 @@ int TableGenMain(char *argv0, TableGenMa
> RecordKeeper Records;
>
> // Parse the input file.
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code ec =
> MemoryBuffer::getFileOrSTDIN(InputFilename, File)) {
> errs() << "Could not open input file '" << InputFilename << "': "
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Wed Mar 5 23:51:42 2014
> @@ -19,7 +19,6 @@
> #include "llvm/ADT/ArrayRef.h"
> #include "llvm/ADT/DenseMap.h"
> #include "llvm/ADT/DepthFirstIterator.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallSet.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/SmallVector.h"
> @@ -349,7 +348,7 @@ struct AddressSanitizer : public Functio
> Function *AsanHandleNoReturnFunc;
> Function *AsanCovFunction;
> Function *AsanPtrCmpFunction, *AsanPtrSubFunction;
> - OwningPtr<SpecialCaseList> BL;
> + std::unique_ptr<SpecialCaseList> BL;
> // This array is indexed by AccessIsWrite and log2(AccessSize).
> Function *AsanErrorCallback[2][kNumberOfAccessSizes];
> // This array is indexed by AccessIsWrite.
> @@ -386,7 +385,7 @@ class AddressSanitizerModule : public Mo
> bool CheckInitOrder;
> SmallString<64> BlacklistFile;
>
> - OwningPtr<SpecialCaseList> BL;
> + std::unique_ptr<SpecialCaseList> BL;
> SetOfDynamicallyInitializedGlobals DynamicallyInitializedGlobals;
> Type *IntptrTy;
> LLVMContext *C;
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp Wed Mar 5 23:51:42 2014
> @@ -190,7 +190,7 @@ class DataFlowSanitizer : public ModuleP
> Constant *DFSanSetLabelFn;
> Constant *DFSanNonzeroLabelFn;
> MDNode *ColdCallWeights;
> - OwningPtr<SpecialCaseList> ABIList;
> + std::unique_ptr<SpecialCaseList> ABIList;
> DenseMap<Value *, Function *> UnwrappedFnMap;
> AttributeSet ReadOnlyNoneAttrs;
>
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp Wed Mar 5 23:51:42 2014
> @@ -503,7 +503,7 @@ bool DebugIR::updateExtension(StringRef
> return true;
> }
>
> -void DebugIR::generateFilename(OwningPtr<int> &fd) {
> +void DebugIR::generateFilename(std::unique_ptr<int> &fd) {
> SmallVector<char, 16> PathVec;
> fd.reset(new int);
> sys::fs::createTemporaryFile("debug-ir", "ll", *fd, PathVec);
> @@ -524,7 +524,7 @@ std::string DebugIR::getPath() {
> }
>
> void DebugIR::writeDebugBitcode(const Module *M, int *fd) {
> - OwningPtr<raw_fd_ostream> Out;
> + std::unique_ptr<raw_fd_ostream> Out;
> std::string error;
>
> if (!fd) {
> @@ -542,12 +542,12 @@ void DebugIR::writeDebugBitcode(const Mo
> Out->close();
> }
>
> -void DebugIR::createDebugInfo(Module &M, OwningPtr<Module> &DisplayM) {
> +void DebugIR::createDebugInfo(Module &M, std::unique_ptr<Module> &DisplayM) {
> if (M.getFunctionList().size() == 0)
> // no functions -- no debug info needed
> return;
>
> - OwningPtr<ValueToValueMapTy> VMap;
> + std::unique_ptr<ValueToValueMapTy> VMap;
>
> if (WriteSourceToDisk && (HideDebugIntrinsics || HideDebugMetadata)) {
> VMap.reset(new ValueToValueMapTy);
> @@ -566,7 +566,7 @@ void DebugIR::createDebugInfo(Module &M,
> bool DebugIR::isMissingPath() { return Filename.empty() || Directory.empty(); }
>
> bool DebugIR::runOnModule(Module &M) {
> - OwningPtr<int> fd;
> + std::unique_ptr<int> fd;
>
> if (isMissingPath() && !getSourceInfo(M)) {
> if (!WriteSourceToDisk)
> @@ -585,7 +585,7 @@ bool DebugIR::runOnModule(Module &M) {
> // file name from the DICompileUnit descriptor.
> DebugMetadataRemover::process(M, !ParsedPath);
>
> - OwningPtr<Module> DisplayM;
> + std::unique_ptr<Module> DisplayM;
> createDebugInfo(M, DisplayM);
> if (WriteSourceToDisk) {
> Module *OutputM = DisplayM.get() ? DisplayM.get() : &M;
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.h (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.h Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_DEBUGIR_H
> #define LLVM_TRANSFORMS_INSTRUMENTATION_DEBUGIR_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Pass.h"
>
> namespace llvm {
> @@ -79,11 +78,11 @@ private:
> bool updateExtension(llvm::StringRef NewExtension);
>
> /// Generate a temporary filename and open an fd
> - void generateFilename(llvm::OwningPtr<int> &fd);
> + void generateFilename(std::unique_ptr<int> &fd);
>
> /// Creates DWARF CU/Subroutine metadata
> void createDebugInfo(llvm::Module &M,
> - llvm::OwningPtr<llvm::Module> &DisplayM);
> + std::unique_ptr<llvm::Module> &DisplayM);
>
> /// Returns true if either Directory or Filename is missing, false otherwise.
> bool isMissingPath();
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Mar 5 23:51:42 2014
> @@ -687,7 +687,7 @@ GlobalVariable *GCOVProfiler::buildEdgeL
> Type *Int64PtrTy = Type::getInt64PtrTy(*Ctx);
> ArrayType *EdgeTableTy = ArrayType::get(Int64PtrTy, TableSize);
>
> - OwningArrayPtr<Constant *> EdgeTable(new Constant*[TableSize]);
> + std::unique_ptr<Constant * []> EdgeTable(new Constant *[TableSize]);
> Constant *NullValue = Constant::getNullValue(Int64PtrTy);
> for (size_t i = 0; i != TableSize; ++i)
> EdgeTable[i] = NullValue;
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Wed Mar 5 23:51:42 2014
> @@ -272,7 +272,7 @@ class MemorySanitizer : public FunctionP
> /// \brief Path to blacklist file.
> SmallString<64> BlacklistFile;
> /// \brief The blacklist.
> - OwningPtr<SpecialCaseList> BL;
> + std::unique_ptr<SpecialCaseList> BL;
> /// \brief An empty volatile inline asm that prevents callback merge.
> InlineAsm *EmptyAsm;
>
> @@ -489,7 +489,7 @@ struct MemorySanitizerVisitor : public I
> MemorySanitizer &MS;
> SmallVector<PHINode *, 16> ShadowPHINodes, OriginPHINodes;
> ValueMap<Value*, Value*> ShadowMap, OriginMap;
> - OwningPtr<VarArgHelper> VAHelper;
> + std::unique_ptr<VarArgHelper> VAHelper;
>
> // The following flags disable parts of MSan instrumentation based on
> // blacklist contents and command-line options.
>
> Modified: llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp Wed Mar 5 23:51:42 2014
> @@ -99,7 +99,7 @@ struct ThreadSanitizer : public Function
> const DataLayout *DL;
> Type *IntptrTy;
> SmallString<64> BlacklistFile;
> - OwningPtr<SpecialCaseList> BL;
> + std::unique_ptr<SpecialCaseList> BL;
> IntegerType *OrdTy;
> // Callbacks to run-time library are computed in doInitialization.
> Function *TsanFuncEntry;
>
> Modified: llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/SampleProfile.cpp Wed Mar 5 23:51:42 2014
> @@ -26,7 +26,6 @@
>
> #include "llvm/Transforms/Scalar.h"
> #include "llvm/ADT/DenseMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/ADT/SmallSet.h"
> #include "llvm/ADT/StringMap.h"
> @@ -240,7 +239,7 @@ public:
> static char ID;
>
> SampleProfileLoader(StringRef Name = SampleProfileFile)
> - : FunctionPass(ID), Profiler(0), Filename(Name) {
> + : FunctionPass(ID), Profiler(), Filename(Name) {
> initializeSampleProfileLoaderPass(*PassRegistry::getPassRegistry());
> }
>
> @@ -261,7 +260,7 @@ public:
>
> protected:
> /// \brief Profile reader object.
> - OwningPtr<SampleModuleProfile> Profiler;
> + std::unique_ptr<SampleModuleProfile> Profiler;
>
> /// \brief Name of the profile file to load.
> StringRef Filename;
> @@ -399,7 +398,7 @@ void SampleModuleProfile::dump() {
> /// profiles for large programs, as the representation is extremely
> /// inefficient.
> void SampleModuleProfile::loadText() {
> - OwningPtr<MemoryBuffer> Buffer;
> + std::unique_ptr<MemoryBuffer> Buffer;
> error_code EC = MemoryBuffer::getFile(Filename, Buffer);
> if (EC)
> report_fatal_error("Could not open file " + Filename + ": " + EC.message());
>
> Modified: llvm/trunk/lib/Transforms/Utils/SpecialCaseList.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SpecialCaseList.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Utils/SpecialCaseList.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/SpecialCaseList.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Transforms/Utils/SpecialCaseList.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/ADT/StringExtras.h"
> @@ -55,7 +54,7 @@ SpecialCaseList *SpecialCaseList::create
> const StringRef Path, std::string &Error) {
> if (Path.empty())
> return new SpecialCaseList();
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code EC = MemoryBuffer::getFile(Path, File)) {
> Error = (Twine("Can't open file '") + Path + "': " + EC.message()).str();
> return 0;
> @@ -65,7 +64,7 @@ SpecialCaseList *SpecialCaseList::create
>
> SpecialCaseList *SpecialCaseList::create(
> const MemoryBuffer *MB, std::string &Error) {
> - OwningPtr<SpecialCaseList> SCL(new SpecialCaseList());
> + std::unique_ptr<SpecialCaseList> SCL(new SpecialCaseList());
> if (!SCL->parse(MB, Error))
> return 0;
> return SCL.release();
>
> Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original)
> +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Wed Mar 5 23:51:42 2014
> @@ -122,7 +122,7 @@ bool BugDriver::addSources(const std::ve
> outs() << "Read input file : '" << Filenames[0] << "'\n";
>
> for (unsigned i = 1, e = Filenames.size(); i != e; ++i) {
> - OwningPtr<Module> M(ParseInputFile(Filenames[i], Context));
> + std::unique_ptr<Module> M(ParseInputFile(Filenames[i], Context));
> if (M.get() == 0) return true;
>
> outs() << "Linking in input file: '" << Filenames[i] << "'\n";
>
> Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
> +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Wed Mar 5 23:51:42 2014
> @@ -128,8 +128,8 @@ ReduceMiscompilingPasses::doTest(std::ve
> // Ok, so now we know that the prefix passes work, try running the suffix
> // passes on the result of the prefix passes.
> //
> - OwningPtr<Module> PrefixOutput(ParseInputFile(BitcodeResult,
> - BD.getContext()));
> + std::unique_ptr<Module> PrefixOutput(
> + ParseInputFile(BitcodeResult, BD.getContext()));
> if (!PrefixOutput) {
> errs() << BD.getToolName() << ": Error reading bitcode file '"
> << BitcodeResult << "'!\n";
> @@ -145,7 +145,8 @@ ReduceMiscompilingPasses::doTest(std::ve
> << "' passes compile correctly after the '"
> << getPassesString(Prefix) << "' passes: ";
>
> - OwningPtr<Module> OriginalInput(BD.swapProgramIn(PrefixOutput.release()));
> + std::unique_ptr<Module> OriginalInput(
> + BD.swapProgramIn(PrefixOutput.release()));
> if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/,
> true/*quiet*/)) {
> errs() << " Error running this sequence of passes"
>
> Modified: llvm/trunk/tools/gold/gold-plugin.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/gold/gold-plugin.cpp (original)
> +++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Mar 5 23:51:42 2014
> @@ -14,7 +14,6 @@
>
> #include "llvm/Config/config.h" // plugin-api.h requires HAVE_STDINT_H
> #include "llvm-c/lto.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringSet.h"
> #include "llvm/Support/Errno.h"
> #include "llvm/Support/FileSystem.h"
> @@ -246,7 +245,7 @@ static ld_plugin_status claim_file_hook(
> int *claimed) {
> lto_module_t M;
> const void *view;
> - OwningPtr<MemoryBuffer> buffer;
> + std::unique_ptr<MemoryBuffer> buffer;
> if (get_view) {
> if (get_view(file->handle, &view) != LDPS_OK) {
> (*message)(LDPL_ERROR, "Failed to get a view of %s", file->name);
>
> Modified: llvm/trunk/tools/llc/llc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llc/llc.cpp (original)
> +++ llvm/trunk/tools/llc/llc.cpp Wed Mar 5 23:51:42 2014
> @@ -206,7 +206,7 @@ int main(int argc, char **argv) {
> static int compileModule(char **argv, LLVMContext &Context) {
> // Load the module to be compiled...
> SMDiagnostic Err;
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> Module *mod = 0;
> Triple TheTriple;
>
> @@ -266,10 +266,9 @@ static int compileModule(char **argv, LL
> TargetOptions Options = InitTargetOptionsFromCodeGenFlags();
> Options.DisableIntegratedAS = NoIntegratedAssembler;
>
> - OwningPtr<TargetMachine>
> - target(TheTarget->createTargetMachine(TheTriple.getTriple(),
> - MCPU, FeaturesStr, Options,
> - RelocModel, CMModel, OLvl));
> + std::unique_ptr<TargetMachine> target(
> + TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr,
> + Options, RelocModel, CMModel, OLvl));
> assert(target.get() && "Could not allocate target machine!");
> assert(mod && "Should have exited after outputting help!");
> TargetMachine &Target = *target.get();
> @@ -284,8 +283,8 @@ static int compileModule(char **argv, LL
> FloatABIForCalls = FloatABI::Soft;
>
> // Figure out where we are going to send the output.
> - OwningPtr<tool_output_file> Out
> - (GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0]));
> + std::unique_ptr<tool_output_file> Out(
> + GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0]));
> if (!Out) return 1;
>
> // Build up all of the passes that we want to do to the module.
>
> Modified: llvm/trunk/tools/lli/lli.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/lli/lli.cpp (original)
> +++ llvm/trunk/tools/lli/lli.cpp Wed Mar 5 23:51:42 2014
> @@ -284,7 +284,7 @@ public:
> if (!getCacheFilename(ModuleID, CacheName))
> return NULL;
> // Load the object from the cache filename
> - OwningPtr<MemoryBuffer> IRObjectBuffer;
> + std::unique_ptr<MemoryBuffer> IRObjectBuffer;
> MemoryBuffer::getFile(CacheName.c_str(), IRObjectBuffer, -1, false);
> // If the file isn't there, that's OK.
> if (!IRObjectBuffer)
> @@ -537,7 +537,7 @@ int main(int argc, char **argv, char * c
> }
>
> for (unsigned i = 0, e = ExtraArchives.size(); i != e; ++i) {
> - OwningPtr<MemoryBuffer> ArBuf;
> + std::unique_ptr<MemoryBuffer> ArBuf;
> error_code ec;
> ec = MemoryBuffer::getFileOrSTDIN(ExtraArchives[i], ArBuf);
> if (ec) {
> @@ -662,7 +662,7 @@ int main(int argc, char **argv, char * c
> // address space, assign the section addresses to resolve any relocations,
> // and send it to the target.
>
> - OwningPtr<RemoteTarget> Target;
> + std::unique_ptr<RemoteTarget> Target;
> if (!ChildExecPath.empty()) { // Remote execution on a child process
> #ifndef LLVM_ON_UNIX
> // FIXME: Remove this pointless fallback mode which causes tests to "pass"
>
> Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
> +++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Wed Mar 5 23:51:42 2014
> @@ -770,7 +770,7 @@ static void performWriteOperation(Archiv
> MemberBuffers.resize(NewMembers.size());
>
> for (unsigned I = 0, N = NewMembers.size(); I < N; ++I) {
> - OwningPtr<MemoryBuffer> MemberBuffer;
> + std::unique_ptr<MemoryBuffer> MemberBuffer;
> NewArchiveIterator &Member = NewMembers[I];
>
> if (Member.isNewMember()) {
> @@ -938,7 +938,7 @@ int ar_main(char **argv) {
>
> static int performOperation(ArchiveOperation Operation) {
> // Create or open the archive object.
> - OwningPtr<MemoryBuffer> Buf;
> + std::unique_ptr<MemoryBuffer> Buf;
> error_code EC = MemoryBuffer::getFile(ArchiveName, Buf, -1, false);
> if (EC && EC != llvm::errc::no_such_file_or_directory) {
> errs() << ToolName << ": error opening '" << ArchiveName
>
> Modified: llvm/trunk/tools/llvm-as/llvm-as.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-as/llvm-as.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-as/llvm-as.cpp (original)
> +++ llvm/trunk/tools/llvm-as/llvm-as.cpp Wed Mar 5 23:51:42 2014
> @@ -69,8 +69,8 @@ static void WriteOutputFile(const Module
> }
>
> std::string ErrorInfo;
> - OwningPtr<tool_output_file> Out(new tool_output_file(
> - OutputFilename.c_str(), ErrorInfo, sys::fs::F_None));
> + std::unique_ptr<tool_output_file> Out(
> + new tool_output_file(OutputFilename.c_str(), ErrorInfo, sys::fs::F_None));
> if (!ErrorInfo.empty()) {
> errs() << ErrorInfo << '\n';
> exit(1);
> @@ -93,7 +93,7 @@ int main(int argc, char **argv) {
>
> // Parse the file now...
> SMDiagnostic Err;
> - OwningPtr<Module> M(ParseAssemblyFile(InputFilename, Err, Context));
> + std::unique_ptr<Module> M(ParseAssemblyFile(InputFilename, Err, Context));
> if (M.get() == 0) {
> Err.print(argv[0], errs());
> return 1;
>
> Modified: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp (original)
> +++ llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Wed Mar 5 23:51:42 2014
> @@ -27,7 +27,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Bitcode/BitstreamReader.h"
> #include "llvm/Bitcode/LLVMBitCodes.h"
> #include "llvm/Bitcode/ReaderWriter.h"
> @@ -479,7 +478,7 @@ static void PrintSize(uint64_t Bits) {
> /// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename.
> static int AnalyzeBitcode() {
> // Read the input file.
> - OwningPtr<MemoryBuffer> MemBuf;
> + std::unique_ptr<MemoryBuffer> MemBuf;
>
> if (error_code ec =
> MemoryBuffer::getFileOrSTDIN(InputFilename, MemBuf))
>
> Modified: llvm/trunk/tools/llvm-cov/llvm-cov.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/llvm-cov.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-cov/llvm-cov.cpp (original)
> +++ llvm/trunk/tools/llvm-cov/llvm-cov.cpp Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/FileSystem.h"
> @@ -96,7 +95,7 @@ int main(int argc, char **argv) {
>
> GCOVFile GF;
>
> - OwningPtr<MemoryBuffer> GCNO_Buff;
> + std::unique_ptr<MemoryBuffer> GCNO_Buff;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputGCNO, GCNO_Buff)) {
> errs() << InputGCNO << ": " << ec.message() << "\n";
> return 1;
> @@ -107,7 +106,7 @@ int main(int argc, char **argv) {
> return 1;
> }
>
> - OwningPtr<MemoryBuffer> GCDA_Buff;
> + std::unique_ptr<MemoryBuffer> GCDA_Buff;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputGCDA, GCDA_Buff)) {
> if (ec != errc::no_such_file_or_directory) {
> errs() << InputGCDA << ": " << ec.message() << "\n";
>
> Modified: llvm/trunk/tools/llvm-dis/llvm-dis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dis/llvm-dis.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-dis/llvm-dis.cpp (original)
> +++ llvm/trunk/tools/llvm-dis/llvm-dis.cpp Wed Mar 5 23:51:42 2014
> @@ -123,7 +123,7 @@ int main(int argc, char **argv) {
> cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n");
>
> std::string ErrorMessage;
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
>
> // Use the bitcode streaming interface
> DataStreamer *streamer = getDataFileStreamer(InputFilename, &ErrorMessage);
> @@ -171,14 +171,14 @@ int main(int argc, char **argv) {
> }
>
> std::string ErrorInfo;
> - OwningPtr<tool_output_file> Out(new tool_output_file(
> - OutputFilename.c_str(), ErrorInfo, sys::fs::F_None));
> + std::unique_ptr<tool_output_file> Out(
> + new tool_output_file(OutputFilename.c_str(), ErrorInfo, sys::fs::F_None));
> if (!ErrorInfo.empty()) {
> errs() << ErrorInfo << '\n';
> return 1;
> }
>
> - OwningPtr<AssemblyAnnotationWriter> Annotator;
> + std::unique_ptr<AssemblyAnnotationWriter> Annotator;
> if (ShowAnnotations)
> Annotator.reset(new CommentWriter());
>
>
> Modified: llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp (original)
> +++ llvm/trunk/tools/llvm-dwarfdump/llvm-dwarfdump.cpp Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/Triple.h"
> #include "llvm/DebugInfo/DIContext.h"
> @@ -87,7 +86,7 @@ static void PrintDILineInfo(DILineInfo d
> }
>
> static void DumpInput(const StringRef &Filename) {
> - OwningPtr<MemoryBuffer> Buff;
> + std::unique_ptr<MemoryBuffer> Buff;
>
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
> errs() << Filename << ": " << ec.message() << "\n";
> @@ -99,9 +98,9 @@ static void DumpInput(const StringRef &F
> errs() << Filename << ": " << EC.message() << '\n';
> return;
> }
> - OwningPtr<ObjectFile> Obj(ObjOrErr.get());
> + std::unique_ptr<ObjectFile> Obj(ObjOrErr.get());
>
> - OwningPtr<DIContext> DICtx(DIContext::getDWARFContext(Obj.get()));
> + std::unique_ptr<DIContext> DICtx(DIContext::getDWARFContext(Obj.get()));
>
> if (Address == -1ULL) {
> outs() << Filename
>
> Modified: llvm/trunk/tools/llvm-extract/llvm-extract.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-extract/llvm-extract.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-extract/llvm-extract.cpp (original)
> +++ llvm/trunk/tools/llvm-extract/llvm-extract.cpp Wed Mar 5 23:51:42 2014
> @@ -100,7 +100,7 @@ int main(int argc, char **argv) {
>
> // Use lazy loading, since we only care about selected global values.
> SMDiagnostic Err;
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> M.reset(getLazyIRFileModule(InputFilename, Err, Context));
>
> if (M.get() == 0) {
>
> Modified: llvm/trunk/tools/llvm-jitlistener/llvm-jitlistener.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-jitlistener/llvm-jitlistener.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-jitlistener/llvm-jitlistener.cpp (original)
> +++ llvm/trunk/tools/llvm-jitlistener/llvm-jitlistener.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
>
> #include "llvm/IR/LLVMContext.h"
> #include "../../lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/Triple.h"
> #include "llvm/ExecutionEngine/JITEventListener.h"
> #include "llvm/ExecutionEngine/JITMemoryManager.h"
> @@ -163,16 +162,15 @@ protected:
> LLVMContext Context; // Global ownership
> Module *TheModule; // Owned by ExecutionEngine.
> JITMemoryManager *JMM; // Owned by ExecutionEngine.
> - OwningPtr<ExecutionEngine> TheJIT;
> + std::unique_ptr<ExecutionEngine> TheJIT;
>
> public:
> void ProcessInput(const std::string &Filename) {
> InitEE(Filename);
>
> - llvm::OwningPtr<llvm::JITEventListener> Listener(JITEventListener::createIntelJITEventListener(
> - new IntelJITEventsWrapper(NotifyEvent, 0,
> - IsProfilingActive, 0, 0,
> - GetNewMethodID)));
> + std::unique_ptr<llvm::JITEventListener> Listener(
> + JITEventListener::createIntelJITEventListener(new IntelJITEventsWrapper(
> + NotifyEvent, 0, IsProfilingActive, 0, 0, GetNewMethodID)));
>
> TheJIT->RegisterJITEventListener(Listener.get());
>
>
> Modified: llvm/trunk/tools/llvm-link/llvm-link.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-link/llvm-link.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-link/llvm-link.cpp (original)
> +++ llvm/trunk/tools/llvm-link/llvm-link.cpp Wed Mar 5 23:51:42 2014
> @@ -82,8 +82,8 @@ int main(int argc, char **argv) {
> unsigned BaseArg = 0;
> std::string ErrorMessage;
>
> - OwningPtr<Module> Composite(LoadFile(argv[0],
> - InputFilenames[BaseArg], Context));
> + std::unique_ptr<Module> Composite(
> + LoadFile(argv[0], InputFilenames[BaseArg], Context));
> if (Composite.get() == 0) {
> errs() << argv[0] << ": error loading file '"
> << InputFilenames[BaseArg] << "'\n";
> @@ -92,7 +92,7 @@ int main(int argc, char **argv) {
>
> Linker L(Composite.get(), SuppressWarnings);
> for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) {
> - OwningPtr<Module> M(LoadFile(argv[0], InputFilenames[i], Context));
> + std::unique_ptr<Module> M(LoadFile(argv[0], InputFilenames[i], Context));
> if (M.get() == 0) {
> errs() << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n";
> return 1;
>
> Modified: llvm/trunk/tools/llvm-lto/llvm-lto.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-lto/llvm-lto.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-lto/llvm-lto.cpp (original)
> +++ llvm/trunk/tools/llvm-lto/llvm-lto.cpp Wed Mar 5 23:51:42 2014
> @@ -95,8 +95,8 @@ int main(int argc, char **argv) {
>
> for (unsigned i = BaseArg; i < InputFilenames.size(); ++i) {
> std::string error;
> - OwningPtr<LTOModule> Module(LTOModule::makeLTOModule(InputFilenames[i].c_str(),
> - Options, error));
> + std::unique_ptr<LTOModule> Module(
> + LTOModule::makeLTOModule(InputFilenames[i].c_str(), Options, error));
> if (!error.empty()) {
> errs() << argv[0] << ": error loading file '" << InputFilenames[i]
> << "': " << error << "\n";
>
> Modified: llvm/trunk/tools/llvm-mc/Disassembler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/Disassembler.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-mc/Disassembler.cpp (original)
> +++ llvm/trunk/tools/llvm-mc/Disassembler.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "Disassembler.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/Triple.h"
> #include "llvm/MC/MCDisassembler.h"
> #include "llvm/MC/MCInst.h"
> @@ -159,7 +158,7 @@ int Disassembler::disassemble(const Targ
> MemoryBuffer &Buffer,
> SourceMgr &SM,
> raw_ostream &Out) {
> - OwningPtr<const MCDisassembler> DisAsm(T.createMCDisassembler(STI));
> + std::unique_ptr<const MCDisassembler> DisAsm(T.createMCDisassembler(STI));
> if (!DisAsm) {
> errs() << "error: no disassembler for target " << Triple << "\n";
> return -1;
>
> Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
> +++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "Disassembler.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/MC/MCAsmBackend.h"
> #include "llvm/MC/MCAsmInfo.h"
> #include "llvm/MC/MCContext.h"
> @@ -320,9 +319,9 @@ static int AsLexInput(SourceMgr &SrcMgr,
> static int AssembleInput(const char *ProgName, const Target *TheTarget,
> SourceMgr &SrcMgr, MCContext &Ctx, MCStreamer &Str,
> MCAsmInfo &MAI, MCSubtargetInfo &STI, MCInstrInfo &MCII) {
> - OwningPtr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, Ctx,
> - Str, MAI));
> - OwningPtr<MCTargetAsmParser> TAP(TheTarget->createMCAsmParser(STI, *Parser, MCII));
> + std::unique_ptr<MCAsmParser> Parser(createMCAsmParser(SrcMgr, Ctx, Str, MAI));
> + std::unique_ptr<MCTargetAsmParser> TAP(
> + TheTarget->createMCAsmParser(STI, *Parser, MCII));
> if (!TAP) {
> errs() << ProgName
> << ": error: this target does not support assembly parsing.\n";
> @@ -363,7 +362,7 @@ int main(int argc, char **argv) {
> if (!TheTarget)
> return 1;
>
> - OwningPtr<MemoryBuffer> BufferPtr;
> + std::unique_ptr<MemoryBuffer> BufferPtr;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr)) {
> errs() << ProgName << ": " << ec.message() << '\n';
> return 1;
> @@ -379,15 +378,15 @@ int main(int argc, char **argv) {
> // it later.
> SrcMgr.setIncludeDirs(IncludeDirs);
>
> - llvm::OwningPtr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
> + std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
> assert(MRI && "Unable to create target register info!");
>
> - llvm::OwningPtr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
> + std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
> assert(MAI && "Unable to create target asm info!");
>
> // FIXME: This is not pretty. MCContext has a ptr to MCObjectFileInfo and
> // MCObjectFileInfo needs a MCContext reference in order to initialize itself.
> - OwningPtr<MCObjectFileInfo> MOFI(new MCObjectFileInfo());
> + std::unique_ptr<MCObjectFileInfo> MOFI(new MCObjectFileInfo());
> MCContext Ctx(MAI.get(), MRI.get(), MOFI.get(), &SrcMgr);
> MOFI->InitMCObjectFileInfo(TripleName, RelocModel, CMModel, Ctx);
>
> @@ -413,16 +412,16 @@ int main(int argc, char **argv) {
> FeaturesStr = Features.getString();
> }
>
> - OwningPtr<tool_output_file> Out(GetOutputStream());
> + std::unique_ptr<tool_output_file> Out(GetOutputStream());
> if (!Out)
> return 1;
>
> formatted_raw_ostream FOS(Out->os());
> - OwningPtr<MCStreamer> Str;
> + std::unique_ptr<MCStreamer> Str;
>
> - OwningPtr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
> - OwningPtr<MCSubtargetInfo>
> - STI(TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr));
> + std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
> + std::unique_ptr<MCSubtargetInfo> STI(
> + TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr));
>
> MCInstPrinter *IP = NULL;
> if (FileType == OFT_AssemblyFile) {
>
> Modified: llvm/trunk/tools/llvm-mcmarkup/llvm-mcmarkup.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mcmarkup/llvm-mcmarkup.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-mcmarkup/llvm-mcmarkup.cpp (original)
> +++ llvm/trunk/tools/llvm-mcmarkup/llvm-mcmarkup.cpp Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/Format.h"
> #include "llvm/Support/ManagedStatic.h"
> @@ -136,7 +135,7 @@ MarkupTag MarkupParser::parseTag() {
> }
>
> static void parseMCMarkup(StringRef Filename) {
> - OwningPtr<MemoryBuffer> BufferPtr;
> + std::unique_ptr<MemoryBuffer> BufferPtr;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, BufferPtr)) {
> errs() << ToolName << ": " << ec.message() << '\n';
> return;
>
> Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
> +++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Wed Mar 5 23:51:42 2014
> @@ -518,7 +518,7 @@ static void dumpSymbolNamesFromObject(Sy
> }
>
> static void dumpSymbolNamesFromFile(std::string &Filename) {
> - OwningPtr<MemoryBuffer> Buffer;
> + std::unique_ptr<MemoryBuffer> Buffer;
> if (error(MemoryBuffer::getFileOrSTDIN(Filename, Buffer), Filename))
> return;
>
> @@ -526,7 +526,7 @@ static void dumpSymbolNamesFromFile(std:
> ErrorOr<Binary *> BinaryOrErr = createBinary(Buffer.release(), &Context);
> if (error(BinaryOrErr.getError(), Filename))
> return;
> - OwningPtr<Binary> Bin(BinaryOrErr.get());
> + std::unique_ptr<Binary> Bin(BinaryOrErr.get());
>
> if (Archive *A = dyn_cast<Archive>(Bin.get())) {
> if (ArchiveMap) {
> @@ -552,7 +552,7 @@ static void dumpSymbolNamesFromFile(std:
>
> for (Archive::child_iterator I = A->child_begin(), E = A->child_end();
> I != E; ++I) {
> - OwningPtr<Binary> Child;
> + std::unique_ptr<Binary> Child;
> if (I->getAsBinary(Child, &Context))
> continue;
> if (SymbolicFile *O = dyn_cast<SymbolicFile>(Child.get())) {
> @@ -566,7 +566,7 @@ static void dumpSymbolNamesFromFile(std:
> for (MachOUniversalBinary::object_iterator I = UB->begin_objects(),
> E = UB->end_objects();
> I != E; ++I) {
> - OwningPtr<ObjectFile> Obj;
> + std::unique_ptr<ObjectFile> Obj;
> if (!I->getAsObjectFile(Obj)) {
> outs() << Obj->getFileName() << ":\n";
> dumpSymbolNamesFromObject(Obj.get());
>
> Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
> +++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm-objdump.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/StringExtras.h"
> #include "llvm/ADT/Triple.h"
> @@ -201,14 +200,14 @@ static void DisassembleInputMachO2(Strin
> MachOObjectFile *MachOOF);
>
> void llvm::DisassembleInputMachO(StringRef Filename) {
> - OwningPtr<MemoryBuffer> Buff;
> + std::unique_ptr<MemoryBuffer> Buff;
>
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buff)) {
> errs() << "llvm-objdump: " << Filename << ": " << ec.message() << "\n";
> return;
> }
>
> - OwningPtr<MachOObjectFile> MachOOF(static_cast<MachOObjectFile *>(
> + std::unique_ptr<MachOObjectFile> MachOOF(static_cast<MachOObjectFile *>(
> ObjectFile::createMachOObjectFile(Buff.release()).get()));
>
> DisassembleInputMachO2(Filename, MachOOF.get());
> @@ -221,21 +220,22 @@ static void DisassembleInputMachO2(Strin
> // GetTarget prints out stuff.
> return;
> }
> - OwningPtr<const MCInstrInfo> InstrInfo(TheTarget->createMCInstrInfo());
> - OwningPtr<MCInstrAnalysis>
> - InstrAnalysis(TheTarget->createMCInstrAnalysis(InstrInfo.get()));
> + std::unique_ptr<const MCInstrInfo> InstrInfo(TheTarget->createMCInstrInfo());
> + std::unique_ptr<MCInstrAnalysis> InstrAnalysis(
> + TheTarget->createMCInstrAnalysis(InstrInfo.get()));
>
> // Set up disassembler.
> - OwningPtr<const MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
> - OwningPtr<const MCAsmInfo> AsmInfo(
> + std::unique_ptr<const MCRegisterInfo> MRI(
> + TheTarget->createMCRegInfo(TripleName));
> + std::unique_ptr<const MCAsmInfo> AsmInfo(
> TheTarget->createMCAsmInfo(*MRI, TripleName));
> - OwningPtr<const MCSubtargetInfo>
> - STI(TheTarget->createMCSubtargetInfo(TripleName, "", ""));
> - OwningPtr<const MCDisassembler> DisAsm(TheTarget->createMCDisassembler(*STI));
> + std::unique_ptr<const MCSubtargetInfo> STI(
> + TheTarget->createMCSubtargetInfo(TripleName, "", ""));
> + std::unique_ptr<const MCDisassembler> DisAsm(
> + TheTarget->createMCDisassembler(*STI));
> int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
> - OwningPtr<MCInstPrinter>
> - IP(TheTarget->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *InstrInfo,
> - *MRI, *STI));
> + std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
> + AsmPrinterVariant, *AsmInfo, *InstrInfo, *MRI, *STI));
>
> if (!InstrAnalysis || !AsmInfo || !STI || !DisAsm || !IP) {
> errs() << "error: couldn't initialize disassembler for target "
> @@ -285,14 +285,14 @@ static void DisassembleInputMachO2(Strin
> raw_ostream &DebugOut = nulls();
> #endif
>
> - OwningPtr<DIContext> diContext;
> + std::unique_ptr<DIContext> diContext;
> ObjectFile *DbgObj = MachOOF;
> // Try to find debug info and set up the DIContext for it.
> if (UseDbg) {
> // A separate DSym file path was specified, parse it as a macho file,
> // get the sections and supply it to the section name parsing machinery.
> if (!DSYMFile.empty()) {
> - OwningPtr<MemoryBuffer> Buf;
> + std::unique_ptr<MemoryBuffer> Buf;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(DSYMFile, Buf)) {
> errs() << "llvm-objdump: " << Filename << ": " << ec.message() << '\n';
> return;
>
> Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
> +++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Wed Mar 5 23:51:42 2014
> @@ -17,7 +17,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm-objdump.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/StringExtras.h"
> #include "llvm/ADT/Triple.h"
> @@ -282,60 +281,61 @@ static void DisassembleObject(const Obje
> FeaturesStr = Features.getString();
> }
>
> - OwningPtr<const MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
> + std::unique_ptr<const MCRegisterInfo> MRI(
> + TheTarget->createMCRegInfo(TripleName));
> if (!MRI) {
> errs() << "error: no register info for target " << TripleName << "\n";
> return;
> }
>
> // Set up disassembler.
> - OwningPtr<const MCAsmInfo> AsmInfo(
> - TheTarget->createMCAsmInfo(*MRI, TripleName));
> + std::unique_ptr<const MCAsmInfo> AsmInfo(
> + TheTarget->createMCAsmInfo(*MRI, TripleName));
> if (!AsmInfo) {
> errs() << "error: no assembly info for target " << TripleName << "\n";
> return;
> }
>
> - OwningPtr<const MCSubtargetInfo> STI(
> - TheTarget->createMCSubtargetInfo(TripleName, "", FeaturesStr));
> + std::unique_ptr<const MCSubtargetInfo> STI(
> + TheTarget->createMCSubtargetInfo(TripleName, "", FeaturesStr));
> if (!STI) {
> errs() << "error: no subtarget info for target " << TripleName << "\n";
> return;
> }
>
> - OwningPtr<const MCInstrInfo> MII(TheTarget->createMCInstrInfo());
> + std::unique_ptr<const MCInstrInfo> MII(TheTarget->createMCInstrInfo());
> if (!MII) {
> errs() << "error: no instruction info for target " << TripleName << "\n";
> return;
> }
>
> - OwningPtr<MCDisassembler> DisAsm(TheTarget->createMCDisassembler(*STI));
> + std::unique_ptr<MCDisassembler> DisAsm(TheTarget->createMCDisassembler(*STI));
> if (!DisAsm) {
> errs() << "error: no disassembler for target " << TripleName << "\n";
> return;
> }
>
> - OwningPtr<const MCObjectFileInfo> MOFI;
> - OwningPtr<MCContext> Ctx;
> + std::unique_ptr<const MCObjectFileInfo> MOFI;
> + std::unique_ptr<MCContext> Ctx;
>
> if (Symbolize) {
> MOFI.reset(new MCObjectFileInfo);
> Ctx.reset(new MCContext(AsmInfo.get(), MRI.get(), MOFI.get()));
> - OwningPtr<MCRelocationInfo> RelInfo(
> - TheTarget->createMCRelocationInfo(TripleName, *Ctx.get()));
> + std::unique_ptr<MCRelocationInfo> RelInfo(
> + TheTarget->createMCRelocationInfo(TripleName, *Ctx.get()));
> if (RelInfo) {
> - OwningPtr<MCSymbolizer> Symzer(
> - MCObjectSymbolizer::createObjectSymbolizer(*Ctx.get(), RelInfo, Obj));
> + std::unique_ptr<MCSymbolizer> Symzer(
> + MCObjectSymbolizer::createObjectSymbolizer(*Ctx.get(), RelInfo, Obj));
> if (Symzer)
> DisAsm->setSymbolizer(Symzer);
> }
> }
>
> - OwningPtr<const MCInstrAnalysis>
> - MIA(TheTarget->createMCInstrAnalysis(MII.get()));
> + std::unique_ptr<const MCInstrAnalysis> MIA(
> + TheTarget->createMCInstrAnalysis(MII.get()));
>
> int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
> - OwningPtr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
> + std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
> AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
> if (!IP) {
> errs() << "error: no instruction printer for target " << TripleName
> @@ -344,9 +344,9 @@ static void DisassembleObject(const Obje
> }
>
> if (CFG || !YAMLCFG.empty()) {
> - OwningPtr<MCObjectDisassembler> OD(
> - new MCObjectDisassembler(*Obj, *DisAsm, *MIA));
> - OwningPtr<MCModule> Mod(OD->buildModule(/* withCFG */ true));
> + std::unique_ptr<MCObjectDisassembler> OD(
> + new MCObjectDisassembler(*Obj, *DisAsm, *MIA));
> + std::unique_ptr<MCModule> Mod(OD->buildModule(/* withCFG */ true));
> for (MCModule::const_atom_iterator AI = Mod->atom_begin(),
> AE = Mod->atom_end();
> AI != AE; ++AI) {
> @@ -814,7 +814,7 @@ static void DumpObject(const ObjectFile
> static void DumpArchive(const Archive *a) {
> for (Archive::child_iterator i = a->child_begin(), e = a->child_end(); i != e;
> ++i) {
> - OwningPtr<Binary> child;
> + std::unique_ptr<Binary> child;
> if (error_code EC = i->getAsBinary(child)) {
> // Ignore non-object files.
> if (EC != object_error::invalid_file_type)
> @@ -849,7 +849,7 @@ static void DumpInput(StringRef file) {
> errs() << ToolName << ": '" << file << "': " << EC.message() << ".\n";
> return;
> }
> - OwningPtr<Binary> binary(BinaryOrErr.get());
> + std::unique_ptr<Binary> binary(BinaryOrErr.get());
>
> if (Archive *a = dyn_cast<Archive>(binary.get()))
> DumpArchive(a);
>
> Modified: llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp (original)
> +++ llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/ManagedStatic.h"
> @@ -101,8 +100,8 @@ int main(int argc, char **argv) {
>
> cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n");
>
> - OwningPtr<MemoryBuffer> File1;
> - OwningPtr<MemoryBuffer> File2;
> + std::unique_ptr<MemoryBuffer> File1;
> + std::unique_ptr<MemoryBuffer> File2;
> if (error_code ec = MemoryBuffer::getFile(Filename1, File1))
> exitWithError(ec.message(), Filename1);
> if (error_code ec = MemoryBuffer::getFile(Filename2, File2))
>
> Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
> +++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Wed Mar 5 23:51:42 2014
> @@ -104,9 +104,8 @@ private:
>
> namespace llvm {
>
> -error_code createCOFFDumper(const object::ObjectFile *Obj,
> - StreamWriter& Writer,
> - OwningPtr<ObjDumper> &Result) {
> +error_code createCOFFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result) {
> const COFFObjectFile *COFFObj = dyn_cast<COFFObjectFile>(Obj);
> if (!COFFObj)
> return readobj_error::unsupported_obj_file_format;
>
> Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
> +++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Wed Mar 5 23:51:42 2014
> @@ -83,14 +83,13 @@ namespace llvm {
> template <class ELFT>
> static error_code createELFDumper(const ELFFile<ELFT> *Obj,
> StreamWriter &Writer,
> - OwningPtr<ObjDumper> &Result) {
> + std::unique_ptr<ObjDumper> &Result) {
> Result.reset(new ELFDumper<ELFT>(Obj, Writer));
> return readobj_error::success;
> }
>
> -error_code createELFDumper(const object::ObjectFile *Obj,
> - StreamWriter& Writer,
> - OwningPtr<ObjDumper> &Result) {
> +error_code createELFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result) {
> // Little-endian 32-bit
> if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
> return createELFDumper(ELFObj->getELFFile(), Writer, Result);
>
> Modified: llvm/trunk/tools/llvm-readobj/MachODumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/MachODumper.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/MachODumper.cpp (original)
> +++ llvm/trunk/tools/llvm-readobj/MachODumper.cpp Wed Mar 5 23:51:42 2014
> @@ -56,8 +56,8 @@ private:
> namespace llvm {
>
> error_code createMachODumper(const object::ObjectFile *Obj,
> - StreamWriter& Writer,
> - OwningPtr<ObjDumper> &Result) {
> + StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result) {
> const MachOObjectFile *MachOObj = dyn_cast<MachOObjectFile>(Obj);
> if (!MachOObj)
> return readobj_error::unsupported_obj_file_format;
>
> Modified: llvm/trunk/tools/llvm-readobj/ObjDumper.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ObjDumper.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/ObjDumper.h (original)
> +++ llvm/trunk/tools/llvm-readobj/ObjDumper.h Wed Mar 5 23:51:42 2014
> @@ -10,6 +10,8 @@
> #ifndef LLVM_READOBJ_OBJDUMPER_H
> #define LLVM_READOBJ_OBJDUMPER_H
>
> +#include <memory>
> +
> namespace llvm {
>
> namespace object {
> @@ -18,9 +20,6 @@ namespace object {
>
> class error_code;
>
> -template<typename T>
> -class OwningPtr;
> -
> class StreamWriter;
>
> class ObjDumper {
> @@ -47,17 +46,15 @@ protected:
> StreamWriter& W;
> };
>
> -error_code createCOFFDumper(const object::ObjectFile *Obj,
> - StreamWriter& Writer,
> - OwningPtr<ObjDumper> &Result);
> -
> -error_code createELFDumper(const object::ObjectFile *Obj,
> - StreamWriter& Writer,
> - OwningPtr<ObjDumper> &Result);
> +error_code createCOFFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result);
> +
> +error_code createELFDumper(const object::ObjectFile *Obj, StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result);
>
> error_code createMachODumper(const object::ObjectFile *Obj,
> - StreamWriter& Writer,
> - OwningPtr<ObjDumper> &Result);
> + StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result);
>
> } // namespace llvm
>
>
> Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp (original)
> +++ llvm/trunk/tools/llvm-readobj/llvm-readobj.cpp Wed Mar 5 23:51:42 2014
> @@ -179,9 +179,8 @@ static void reportError(StringRef Input,
> }
>
> /// @brief Creates an format-specific object file dumper.
> -static error_code createDumper(const ObjectFile *Obj,
> - StreamWriter &Writer,
> - OwningPtr<ObjDumper> &Result) {
> +static error_code createDumper(const ObjectFile *Obj, StreamWriter &Writer,
> + std::unique_ptr<ObjDumper> &Result) {
> if (!Obj)
> return readobj_error::unsupported_file_format;
>
> @@ -199,7 +198,7 @@ static error_code createDumper(const Obj
> /// @brief Dumps the specified object file.
> static void dumpObject(const ObjectFile *Obj) {
> StreamWriter Writer(outs());
> - OwningPtr<ObjDumper> Dumper;
> + std::unique_ptr<ObjDumper> Dumper;
> if (error_code EC = createDumper(Obj, Writer, Dumper)) {
> reportError(Obj->getFileName(), EC);
> return;
> @@ -244,7 +243,7 @@ static void dumpArchive(const Archive *A
> for (Archive::child_iterator ArcI = Arc->child_begin(),
> ArcE = Arc->child_end();
> ArcI != ArcE; ++ArcI) {
> - OwningPtr<Binary> child;
> + std::unique_ptr<Binary> child;
> if (error_code EC = ArcI->getAsBinary(child)) {
> // Ignore non-object files.
> if (EC != object_error::invalid_file_type)
> @@ -274,7 +273,7 @@ static void dumpInput(StringRef File) {
> reportError(File, EC);
> return;
> }
> - OwningPtr<Binary> Binary(BinaryOrErr.get());
> + std::unique_ptr<Binary> Binary(BinaryOrErr.get());
>
> if (Archive *Arc = dyn_cast<Archive>(Binary.get()))
> dumpArchive(Arc);
>
> Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
> +++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringMap.h"
> #include "llvm/DebugInfo/DIContext.h"
> #include "llvm/ExecutionEngine/ObjectBuffer.h"
> @@ -133,8 +132,8 @@ static int printLineInfoForInput() {
> RuntimeDyld Dyld(&MemMgr);
>
> // Load the input memory buffer.
> - OwningPtr<MemoryBuffer> InputBuffer;
> - OwningPtr<ObjectImage> LoadedObject;
> + std::unique_ptr<MemoryBuffer> InputBuffer;
> + std::unique_ptr<ObjectImage> LoadedObject;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFileList[i],
> InputBuffer))
> return Error("unable to read input: '" + ec.message() + "'");
> @@ -148,7 +147,8 @@ static int printLineInfoForInput() {
> // Resolve all the relocations we can.
> Dyld.resolveRelocations();
>
> - OwningPtr<DIContext> Context(DIContext::getDWARFContext(LoadedObject->getObjectFile()));
> + std::unique_ptr<DIContext> Context(
> + DIContext::getDWARFContext(LoadedObject->getObjectFile()));
>
> // Use symbol info to iterate functions in the object.
> for (object::symbol_iterator I = LoadedObject->begin_symbols(),
> @@ -191,8 +191,8 @@ static int executeInput() {
> InputFileList.push_back("-");
> for(unsigned i = 0, e = InputFileList.size(); i != e; ++i) {
> // Load the input memory buffer.
> - OwningPtr<MemoryBuffer> InputBuffer;
> - OwningPtr<ObjectImage> LoadedObject;
> + std::unique_ptr<MemoryBuffer> InputBuffer;
> + std::unique_ptr<ObjectImage> LoadedObject;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFileList[i],
> InputBuffer))
> return Error("unable to read input: '" + ec.message() + "'");
>
> Modified: llvm/trunk/tools/llvm-size/llvm-size.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-size/llvm-size.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-size/llvm-size.cpp (original)
> +++ llvm/trunk/tools/llvm-size/llvm-size.cpp Wed Mar 5 23:51:42 2014
> @@ -236,13 +236,13 @@ static void PrintFileSectionSizes(String
> errs() << ToolName << ": " << file << ": " << EC.message() << ".\n";
> return;
> }
> - OwningPtr<Binary> binary(BinaryOrErr.get());
> + std::unique_ptr<Binary> binary(BinaryOrErr.get());
>
> if (Archive *a = dyn_cast<Archive>(binary.get())) {
> // This is an archive. Iterate over each member and display its sizes.
> for (object::Archive::child_iterator i = a->child_begin(),
> e = a->child_end(); i != e; ++i) {
> - OwningPtr<Binary> child;
> + std::unique_ptr<Binary> child;
> if (error_code ec = i->getAsBinary(child)) {
> errs() << ToolName << ": " << file << ": " << ec.message() << ".\n";
> continue;
>
> Modified: llvm/trunk/tools/llvm-stress/llvm-stress.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-stress/llvm-stress.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-stress/llvm-stress.cpp (original)
> +++ llvm/trunk/tools/llvm-stress/llvm-stress.cpp Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,7 @@
> // different components in LLVM.
> //
> //===----------------------------------------------------------------------===//
> -#include "llvm/ADT/OwningPtr.h"
> +
> #include "llvm/Analysis/CallGraphSCCPass.h"
> #include "llvm/IR/Constants.h"
> #include "llvm/IR/IRPrintingPasses.h"
> @@ -625,15 +625,15 @@ static void FillFunction(Function *F, Ra
>
> // List of modifiers which add new random instructions.
> std::vector<Modifier*> Modifiers;
> - OwningPtr<Modifier> LM(new LoadModifier(BB, &PT, &R));
> - OwningPtr<Modifier> SM(new StoreModifier(BB, &PT, &R));
> - OwningPtr<Modifier> EE(new ExtractElementModifier(BB, &PT, &R));
> - OwningPtr<Modifier> SHM(new ShuffModifier(BB, &PT, &R));
> - OwningPtr<Modifier> IE(new InsertElementModifier(BB, &PT, &R));
> - OwningPtr<Modifier> BM(new BinModifier(BB, &PT, &R));
> - OwningPtr<Modifier> CM(new CastModifier(BB, &PT, &R));
> - OwningPtr<Modifier> SLM(new SelectModifier(BB, &PT, &R));
> - OwningPtr<Modifier> PM(new CmpModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> LM(new LoadModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> SM(new StoreModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> EE(new ExtractElementModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> SHM(new ShuffModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> IE(new InsertElementModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> BM(new BinModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> CM(new CastModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> SLM(new SelectModifier(BB, &PT, &R));
> + std::unique_ptr<Modifier> PM(new CmpModifier(BB, &PT, &R));
> Modifiers.push_back(LM.get());
> Modifiers.push_back(SM.get());
> Modifiers.push_back(EE.get());
> @@ -687,7 +687,7 @@ int main(int argc, char **argv) {
> cl::ParseCommandLineOptions(argc, argv, "llvm codegen stress-tester\n");
> llvm_shutdown_obj Y;
>
> - OwningPtr<Module> M(new Module("/tmp/autogen.bc", getGlobalContext()));
> + std::unique_ptr<Module> M(new Module("/tmp/autogen.bc", getGlobalContext()));
> Function *F = GenEmptyFunction(M.get());
>
> // Pick an initial seed value
> @@ -698,7 +698,7 @@ int main(int argc, char **argv) {
> IntroduceControlFlow(F, R);
>
> // Figure out what stream we are supposed to write to...
> - OwningPtr<tool_output_file> Out;
> + std::unique_ptr<tool_output_file> Out;
> // Default to standard output.
> if (OutputFilename.empty())
> OutputFilename = "-";
>
> Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp (original)
> +++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp Wed Mar 5 23:51:42 2014
> @@ -231,7 +231,7 @@ static std::string getDarwinDWARFResourc
> }
>
> static bool checkFileCRC(StringRef Path, uint32_t CRCHash) {
> - OwningPtr<MemoryBuffer> MB;
> + std::unique_ptr<MemoryBuffer> MB;
> if (MemoryBuffer::getFileOrSTDIN(Path, MB))
> return false;
> return !zlib::isAvailable() || CRCHash == zlib::crc32(MB->getBuffer());
> @@ -313,7 +313,7 @@ LLVMSymbolizer::getOrCreateBinary(const
> Binary *DbgBin = 0;
> ErrorOr<Binary *> BinaryOrErr = createBinary(Path);
> if (!error(BinaryOrErr.getError())) {
> - OwningPtr<Binary> ParsedBinary(BinaryOrErr.get());
> + std::unique_ptr<Binary> ParsedBinary(BinaryOrErr.get());
> // Check if it's a universal binary.
> Bin = ParsedBinary.release();
> ParsedBinariesAndObjects.push_back(Bin);
> @@ -361,7 +361,7 @@ LLVMSymbolizer::getObjectFileFromBinary(
> std::make_pair(UB, ArchName));
> if (I != ObjectFileForArch.end())
> return I->second;
> - OwningPtr<ObjectFile> ParsedObj;
> + std::unique_ptr<ObjectFile> ParsedObj;
> if (!UB->getObjectForArch(Triple(ArchName).getArch(), ParsedObj)) {
> Res = ParsedObj.release();
> ParsedBinariesAndObjects.push_back(Res);
>
> Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h (original)
> +++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.h Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> #ifndef LLVM_SYMBOLIZE_H
> #define LLVM_SYMBOLIZE_H
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/DebugInfo/DIContext.h"
> #include "llvm/Object/MachOUniversal.h"
> @@ -104,7 +103,7 @@ private:
> uint64_t &Size) const;
> void addSymbol(const symbol_iterator &Sym);
> ObjectFile *Module;
> - OwningPtr<DIContext> DebugInfoContext;
> + std::unique_ptr<DIContext> DebugInfoContext;
>
> struct SymbolDesc {
> uint64_t Addr;
>
> Modified: llvm/trunk/tools/macho-dump/macho-dump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/macho-dump/macho-dump.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/macho-dump/macho-dump.cpp (original)
> +++ llvm/trunk/tools/macho-dump/macho-dump.cpp Wed Mar 5 23:51:42 2014
> @@ -381,7 +381,7 @@ int main(int argc, char **argv) {
> ErrorOr<Binary *> BinaryOrErr = createBinary(InputFile);
> if (error_code EC = BinaryOrErr.getError())
> return Error("unable to read input: '" + EC.message() + "'");
> - OwningPtr<Binary> Binary(BinaryOrErr.get());
> + std::unique_ptr<Binary> Binary(BinaryOrErr.get());
>
> const MachOObjectFile *InputObject = dyn_cast<MachOObjectFile>(Binary.get());
> if (!InputObject)
>
> Modified: llvm/trunk/tools/obj2yaml/obj2yaml.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/obj2yaml.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/obj2yaml/obj2yaml.cpp (original)
> +++ llvm/trunk/tools/obj2yaml/obj2yaml.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "obj2yaml.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Object/Archive.h"
> #include "llvm/Object/COFF.h"
> #include "llvm/Support/CommandLine.h"
> @@ -38,7 +37,7 @@ int main(int argc, char *argv[]) {
> llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
>
> // Process the input file
> - OwningPtr<MemoryBuffer> buf;
> + std::unique_ptr<MemoryBuffer> buf;
>
> // TODO: If this is an archive, then burst it and dump each entry
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, buf)) {
>
> Modified: llvm/trunk/tools/opt/opt.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/opt/opt.cpp (original)
> +++ llvm/trunk/tools/opt/opt.cpp Wed Mar 5 23:51:42 2014
> @@ -356,7 +356,7 @@ int main(int argc, char **argv) {
> SMDiagnostic Err;
>
> // Load the input module...
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> M.reset(ParseIRFile(InputFilename, Err, Context));
>
> if (M.get() == 0) {
> @@ -369,7 +369,7 @@ int main(int argc, char **argv) {
> M->setTargetTriple(Triple::normalize(TargetTriple));
>
> // Figure out what stream we are supposed to write to...
> - OwningPtr<tool_output_file> Out;
> + std::unique_ptr<tool_output_file> Out;
> if (NoOutput) {
> if (!OutputFilename.empty())
> errs() << "WARNING: The -o (output filename) option is ignored when\n"
> @@ -442,13 +442,13 @@ int main(int argc, char **argv) {
> TargetMachine *Machine = 0;
> if (ModuleTriple.getArch())
> Machine = GetTargetMachine(Triple(ModuleTriple));
> - OwningPtr<TargetMachine> TM(Machine);
> + std::unique_ptr<TargetMachine> TM(Machine);
>
> // Add internal analysis passes from the target machine.
> if (TM.get())
> TM->addAnalysisPasses(Passes);
>
> - OwningPtr<FunctionPassManager> FPasses;
> + std::unique_ptr<FunctionPassManager> FPasses;
> if (OptLevelO1 || OptLevelO2 || OptLevelOs || OptLevelOz || OptLevelO3) {
> FPasses.reset(new FunctionPassManager(M.get()));
> if (DL)
>
> Modified: llvm/trunk/tools/yaml2obj/yaml2obj.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2obj.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/tools/yaml2obj/yaml2obj.cpp (original)
> +++ llvm/trunk/tools/yaml2obj/yaml2obj.cpp Wed Mar 5 23:51:42 2014
> @@ -15,7 +15,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "yaml2obj.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/ManagedStatic.h"
> #include "llvm/Support/MemoryBuffer.h"
> @@ -57,7 +56,7 @@ int main(int argc, char **argv) {
> PrettyStackTraceProgram X(argc, argv);
> llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
>
> - OwningPtr<MemoryBuffer> Buf;
> + std::unique_ptr<MemoryBuffer> Buf;
> if (MemoryBuffer::getFileOrSTDIN(Input, Buf))
> return 1;
> if (Format == YOF_COFF) {
>
> Modified: llvm/trunk/unittests/Analysis/CFGTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/CFGTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Analysis/CFGTest.cpp (original)
> +++ llvm/trunk/unittests/Analysis/CFGTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Analysis/CFG.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Analysis/LoopInfo.h"
> #include "llvm/AsmParser/Parser.h"
> #include "llvm/IR/Dominators.h"
> @@ -116,7 +115,7 @@ protected:
> PM.run(*M);
> }
>
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> Instruction *A, *B;
> };
>
>
> Modified: llvm/trunk/unittests/Bitcode/BitReaderTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Bitcode/BitReaderTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Bitcode/BitReaderTest.cpp (original)
> +++ llvm/trunk/unittests/Bitcode/BitReaderTest.cpp Wed Mar 5 23:51:42 2014
> @@ -45,7 +45,7 @@ static Module *makeLLVMModule() {
> }
>
> static void writeModuleToBuffer(SmallVectorImpl<char> &Buffer) {
> - OwningPtr<Module> Mod(makeLLVMModule());
> + std::unique_ptr<Module> Mod(makeLLVMModule());
> raw_svector_ostream OS(Buffer);
> WriteBitcodeToFile(Mod.get(), OS);
> }
> @@ -56,7 +56,7 @@ TEST(BitReaderTest, MaterializeFunctions
> MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(Mem.str(), "test", false);
> ErrorOr<Module *> ModuleOrErr =
> getLazyBitcodeModule(Buffer, getGlobalContext());
> - OwningPtr<Module> m(ModuleOrErr.get());
> + std::unique_ptr<Module> m(ModuleOrErr.get());
> PassManager passes;
> passes.add(createVerifierPass());
> passes.run(*m);
>
> Modified: llvm/trunk/unittests/ExecutionEngine/ExecutionEngineTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/ExecutionEngineTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/ExecutionEngineTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/ExecutionEngineTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/ExecutionEngine/Interpreter.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/DerivedTypes.h"
> #include "llvm/IR/GlobalVariable.h"
> #include "llvm/IR/LLVMContext.h"
> @@ -38,7 +37,7 @@ protected:
>
> Module *const M;
> std::string Error;
> - const OwningPtr<ExecutionEngine> Engine;
> + const std::unique_ptr<ExecutionEngine> Engine;
> };
>
> TEST_F(ExecutionEngineTest, ForwardGlobalMapping) {
>
> Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/ExecutionEngine/JITEventListener.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/CodeGen/MachineCodeInfo.h"
> #include "llvm/ExecutionEngine/JIT.h"
> #include "llvm/IR/Instructions.h"
> @@ -69,7 +68,7 @@ class JITEventListenerTest : public test
> }
>
> Module *M;
> - const OwningPtr<ExecutionEngine> EE;
> + const std::unique_ptr<ExecutionEngine> EE;
> };
>
> // Tests on SystemZ disabled as we're running the old JIT
>
> Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h (original)
> +++ llvm/trunk/unittests/ExecutionEngine/JIT/JITEventListenerTestCommon.h Wed Mar 5 23:51:42 2014
> @@ -53,8 +53,8 @@ inline const char* getFilename() {
> template<typename WrapperT>
> class JITEventListenerTestBase : public testing::Test {
> protected:
> - llvm::OwningPtr<WrapperT> MockWrapper;
> - llvm::OwningPtr<llvm::JITEventListener> Listener;
> + std::unique_ptr<WrapperT> MockWrapper;
> + std::unique_ptr<llvm::JITEventListener> Listener;
>
> public:
> llvm::Module* M;
>
> Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp Wed Mar 5 23:51:42 2014
> @@ -9,7 +9,6 @@
>
> #include "llvm/ExecutionEngine/JITMemoryManager.h"
> #include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/DerivedTypes.h"
> #include "llvm/IR/Function.h"
> #include "llvm/IR/GlobalValue.h"
> @@ -31,27 +30,27 @@ Function *makeFakeFunction() {
> // the code in the case that we don't have to allocate more memory to store the
> // function bodies.
> TEST(JITMemoryManagerTest, NoAllocations) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> uintptr_t size;
> std::string Error;
>
> // Allocate the functions.
> - OwningPtr<Function> F1(makeFakeFunction());
> + std::unique_ptr<Function> F1(makeFakeFunction());
> size = 1024;
> uint8_t *FunctionBody1 = MemMgr->startFunctionBody(F1.get(), size);
> memset(FunctionBody1, 0xFF, 1024);
> MemMgr->endFunctionBody(F1.get(), FunctionBody1, FunctionBody1 + 1024);
> EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
>
> - OwningPtr<Function> F2(makeFakeFunction());
> + std::unique_ptr<Function> F2(makeFakeFunction());
> size = 1024;
> uint8_t *FunctionBody2 = MemMgr->startFunctionBody(F2.get(), size);
> memset(FunctionBody2, 0xFF, 1024);
> MemMgr->endFunctionBody(F2.get(), FunctionBody2, FunctionBody2 + 1024);
> EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
>
> - OwningPtr<Function> F3(makeFakeFunction());
> + std::unique_ptr<Function> F3(makeFakeFunction());
> size = 1024;
> uint8_t *FunctionBody3 = MemMgr->startFunctionBody(F3.get(), size);
> memset(FunctionBody3, 0xFF, 1024);
> @@ -70,7 +69,7 @@ TEST(JITMemoryManagerTest, NoAllocations
> // Make three large functions that take up most of the space in the slab. Then
> // try allocating three smaller functions that don't require additional slabs.
> TEST(JITMemoryManagerTest, TestCodeAllocation) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> uintptr_t size;
> std::string Error;
> @@ -81,7 +80,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> smallFuncSize * 2);
>
> // Allocate big functions
> - OwningPtr<Function> F1(makeFakeFunction());
> + std::unique_ptr<Function> F1(makeFakeFunction());
> size = bigFuncSize;
> uint8_t *FunctionBody1 = MemMgr->startFunctionBody(F1.get(), size);
> ASSERT_LE(bigFuncSize, size);
> @@ -89,7 +88,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> MemMgr->endFunctionBody(F1.get(), FunctionBody1, FunctionBody1 + bigFuncSize);
> EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
>
> - OwningPtr<Function> F2(makeFakeFunction());
> + std::unique_ptr<Function> F2(makeFakeFunction());
> size = bigFuncSize;
> uint8_t *FunctionBody2 = MemMgr->startFunctionBody(F2.get(), size);
> ASSERT_LE(bigFuncSize, size);
> @@ -97,7 +96,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> MemMgr->endFunctionBody(F2.get(), FunctionBody2, FunctionBody2 + bigFuncSize);
> EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
>
> - OwningPtr<Function> F3(makeFakeFunction());
> + std::unique_ptr<Function> F3(makeFakeFunction());
> size = bigFuncSize;
> uint8_t *FunctionBody3 = MemMgr->startFunctionBody(F3.get(), size);
> ASSERT_LE(bigFuncSize, size);
> @@ -109,7 +108,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> EXPECT_EQ(3U, MemMgr->GetNumCodeSlabs());
>
> // Allocate small functions
> - OwningPtr<Function> F4(makeFakeFunction());
> + std::unique_ptr<Function> F4(makeFakeFunction());
> size = smallFuncSize;
> uint8_t *FunctionBody4 = MemMgr->startFunctionBody(F4.get(), size);
> ASSERT_LE(smallFuncSize, size);
> @@ -118,7 +117,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> FunctionBody4 + smallFuncSize);
> EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
>
> - OwningPtr<Function> F5(makeFakeFunction());
> + std::unique_ptr<Function> F5(makeFakeFunction());
> size = smallFuncSize;
> uint8_t *FunctionBody5 = MemMgr->startFunctionBody(F5.get(), size);
> ASSERT_LE(smallFuncSize, size);
> @@ -127,7 +126,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> FunctionBody5 + smallFuncSize);
> EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
>
> - OwningPtr<Function> F6(makeFakeFunction());
> + std::unique_ptr<Function> F6(makeFakeFunction());
> size = smallFuncSize;
> uint8_t *FunctionBody6 = MemMgr->startFunctionBody(F6.get(), size);
> ASSERT_LE(smallFuncSize, size);
> @@ -157,7 +156,7 @@ TEST(JITMemoryManagerTest, TestCodeAlloc
> // Allocate five global ints of varying widths and alignment, and check their
> // alignment and overlap.
> TEST(JITMemoryManagerTest, TestSmallGlobalInts) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> uint8_t *a = (uint8_t *)MemMgr->allocateGlobal(8, 0);
> uint16_t *b = (uint16_t*)MemMgr->allocateGlobal(16, 2);
> @@ -204,7 +203,7 @@ TEST(JITMemoryManagerTest, TestSmallGlob
> // Allocate a small global, a big global, and a third global, and make sure we
> // only use two slabs for that.
> TEST(JITMemoryManagerTest, TestLargeGlobalArray) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> size_t Size = 4 * MemMgr->GetDefaultDataSlabSize();
> uint64_t *a = (uint64_t*)MemMgr->allocateGlobal(64, 8);
> @@ -234,7 +233,7 @@ TEST(JITMemoryManagerTest, TestLargeGlob
> // Allocate lots of medium globals so that we can test moving the bump allocator
> // to a new slab.
> TEST(JITMemoryManagerTest, TestManyGlobals) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> size_t SlabSize = MemMgr->GetDefaultDataSlabSize();
> size_t Size = 128;
> @@ -257,7 +256,7 @@ TEST(JITMemoryManagerTest, TestManyGloba
> // Allocate lots of function stubs so that we can test moving the stub bump
> // allocator to a new slab.
> TEST(JITMemoryManagerTest, TestManyStubs) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> size_t SlabSize = MemMgr->GetDefaultStubSlabSize();
> size_t Size = 128;
> @@ -279,7 +278,7 @@ TEST(JITMemoryManagerTest, TestManyStubs
>
> // Check section allocation and alignment
> TEST(JITMemoryManagerTest, AllocateSection) {
> - OwningPtr<JITMemoryManager> MemMgr(
> + std::unique_ptr<JITMemoryManager> MemMgr(
> JITMemoryManager::CreateDefaultMemManager());
> uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1, StringRef());
> uint8_t *data1 = MemMgr->allocateDataSection(256, 16, 2, StringRef(), true);
>
> Modified: llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/JIT/JITTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/ExecutionEngine/JIT.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallPtrSet.h"
> #include "llvm/AsmParser/Parser.h"
> #include "llvm/Bitcode/ReaderWriter.h"
> @@ -77,7 +76,8 @@ std::string DumpFunction(const Function
> }
>
> class RecordingJITMemoryManager : public JITMemoryManager {
> - const OwningPtr<JITMemoryManager> Base;
> + const std::unique_ptr<JITMemoryManager> Base;
> +
> public:
> RecordingJITMemoryManager()
> : Base(JITMemoryManager::CreateDefaultMemManager()) {
> @@ -203,7 +203,7 @@ class JITTest : public testing::Test {
> LLVMContext Context;
> Module *M; // Owned by ExecutionEngine.
> RecordingJITMemoryManager *RJMM;
> - OwningPtr<ExecutionEngine> TheJIT;
> + std::unique_ptr<ExecutionEngine> TheJIT;
> };
>
> // Regression test for a bug. The JIT used to allocate globals inside the same
> @@ -220,13 +220,13 @@ TEST(JIT, GlobalInFunction) {
> // memory is more easily tested.
> MemMgr->setPoisonMemory(true);
> std::string Error;
> - OwningPtr<ExecutionEngine> JIT(EngineBuilder(M)
> - .setEngineKind(EngineKind::JIT)
> - .setErrorStr(&Error)
> - .setJITMemoryManager(MemMgr)
> - // The next line enables the fix:
> - .setAllocateGVsWithCode(false)
> - .create());
> + std::unique_ptr<ExecutionEngine> JIT(EngineBuilder(M)
> + .setEngineKind(EngineKind::JIT)
> + .setErrorStr(&Error)
> + .setJITMemoryManager(MemMgr)
> + // The next line enables the fix:
> + .setAllocateGVsWithCode(false)
> + .create());
> ASSERT_EQ(Error, "");
>
> // Create a global variable.
> @@ -669,7 +669,8 @@ TEST(LazyLoadedJITTest, MaterializableAv
> "} ");
> ASSERT_FALSE(Bitcode.empty()) << "Assembling failed";
> Module *M;
> - OwningPtr<ExecutionEngine> TheJIT(getJITFromBitcode(Context, Bitcode, M));
> + std::unique_ptr<ExecutionEngine> TheJIT(
> + getJITFromBitcode(Context, Bitcode, M));
> ASSERT_TRUE(TheJIT.get()) << "Failed to create JIT.";
> TheJIT->DisableLazyCompilation(true);
>
> @@ -708,7 +709,8 @@ TEST(LazyLoadedJITTest, EagerCompiledRec
> "} ");
> ASSERT_FALSE(Bitcode.empty()) << "Assembling failed";
> Module *M;
> - OwningPtr<ExecutionEngine> TheJIT(getJITFromBitcode(Context, Bitcode, M));
> + std::unique_ptr<ExecutionEngine> TheJIT(
> + getJITFromBitcode(Context, Bitcode, M));
> ASSERT_TRUE(TheJIT.get()) << "Failed to create JIT.";
> TheJIT->DisableLazyCompilation(true);
>
>
> Modified: llvm/trunk/unittests/ExecutionEngine/JIT/MultiJITTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/JIT/MultiJITTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/JIT/MultiJITTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/JIT/MultiJITTest.cpp Wed Mar 5 23:51:42 2014
> @@ -81,9 +81,9 @@ TEST(MultiJitTest, EagerMode) {
> createModule2(Context2, M2, FooF2);
>
> // Now we create the JIT in eager mode
> - OwningPtr<ExecutionEngine> EE1(EngineBuilder(M1).create());
> + std::unique_ptr<ExecutionEngine> EE1(EngineBuilder(M1).create());
> EE1->DisableLazyCompilation(true);
> - OwningPtr<ExecutionEngine> EE2(EngineBuilder(M2).create());
> + std::unique_ptr<ExecutionEngine> EE2(EngineBuilder(M2).create());
> EE2->DisableLazyCompilation(true);
>
> // Call the `foo' function with no arguments:
> @@ -111,9 +111,9 @@ TEST(MultiJitTest, LazyMode) {
> createModule2(Context2, M2, FooF2);
>
> // Now we create the JIT in lazy mode
> - OwningPtr<ExecutionEngine> EE1(EngineBuilder(M1).create());
> + std::unique_ptr<ExecutionEngine> EE1(EngineBuilder(M1).create());
> EE1->DisableLazyCompilation(false);
> - OwningPtr<ExecutionEngine> EE2(EngineBuilder(M2).create());
> + std::unique_ptr<ExecutionEngine> EE2(EngineBuilder(M2).create());
> EE2->DisableLazyCompilation(false);
>
> // Call the `foo' function with no arguments:
> @@ -145,8 +145,8 @@ TEST(MultiJitTest, JitPool) {
> createModule2(Context2, M2, FooF2);
>
> // Now we create two JITs
> - OwningPtr<ExecutionEngine> EE1(EngineBuilder(M1).create());
> - OwningPtr<ExecutionEngine> EE2(EngineBuilder(M2).create());
> + std::unique_ptr<ExecutionEngine> EE1(EngineBuilder(M1).create());
> + std::unique_ptr<ExecutionEngine> EE2(EngineBuilder(M2).create());
>
> Function *F1 = EE1->FindFunctionNamed("foo1");
> void *foo1 = EE1->getPointerToFunction(F1);
>
> Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMemoryManagerTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/ExecutionEngine/SectionMemoryManager.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ExecutionEngine/JIT.h"
> #include "gtest/gtest.h"
>
> @@ -17,7 +16,7 @@ using namespace llvm;
> namespace {
>
> TEST(MCJITMemoryManagerTest, BasicAllocations) {
> - OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
> + std::unique_ptr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
>
> uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1, "");
> uint8_t *data1 = MemMgr->allocateDataSection(256, 0, 2, "", true);
> @@ -50,7 +49,7 @@ TEST(MCJITMemoryManagerTest, BasicAlloca
> }
>
> TEST(MCJITMemoryManagerTest, LargeAllocations) {
> - OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
> + std::unique_ptr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
>
> uint8_t *code1 = MemMgr->allocateCodeSection(0x100000, 0, 1, "");
> uint8_t *data1 = MemMgr->allocateDataSection(0x100000, 0, 2, "", true);
> @@ -83,7 +82,7 @@ TEST(MCJITMemoryManagerTest, LargeAlloca
> }
>
> TEST(MCJITMemoryManagerTest, ManyAllocations) {
> - OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
> + std::unique_ptr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
>
> uint8_t* code[10000];
> uint8_t* data[10000];
> @@ -118,7 +117,7 @@ TEST(MCJITMemoryManagerTest, ManyAllocat
> }
>
> TEST(MCJITMemoryManagerTest, ManyVariedAllocations) {
> - OwningPtr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
> + std::unique_ptr<SectionMemoryManager> MemMgr(new SectionMemoryManager());
>
> uint8_t* code[10000];
> uint8_t* data[10000];
>
> Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp Wed Mar 5 23:51:42 2014
> @@ -90,7 +90,7 @@ TEST_F(MCJITMultipleModuleTest, multiple
> TEST_F(MCJITMultipleModuleTest, two_module_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB;
> createTwoModuleCase(A, FA, B, FB);
>
> @@ -110,7 +110,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
> TEST_F(MCJITMultipleModuleTest, two_module_reverse_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB;
> createTwoModuleCase(A, FA, B, FB);
>
> @@ -131,7 +131,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
> TEST_F(MCJITMultipleModuleTest, two_module_extern_reverse_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB;
> createTwoModuleExternCase(A, FA, B, FB);
>
> @@ -152,7 +152,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
> TEST_F(MCJITMultipleModuleTest, two_module_extern_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB;
> createTwoModuleExternCase(A, FA, B, FB);
>
> @@ -172,7 +172,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
> TEST_F(MCJITMultipleModuleTest, two_module_consecutive_call_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA1, *FA2, *FB;
> createTwoModuleExternCase(A, FA1, B, FB);
> FA2 = insertSimpleCallFunction<int32_t(int32_t, int32_t)>(A.get(), FA1);
> @@ -199,7 +199,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
> TEST_F(MCJITMultipleModuleTest, two_module_global_variables_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB;
> GlobalVariable *GVA, *GVB;
> A.reset(createEmptyModule("A"));
> @@ -237,7 +237,7 @@ TEST_F(MCJITMultipleModuleTest, two_modu
> TEST_F(MCJITMultipleModuleTest, three_module_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B, C;
> + std::unique_ptr<Module> A, B, C;
> Function *FA, *FB, *FC;
> createThreeModuleCase(A, FA, B, FB, C, FC);
>
> @@ -262,7 +262,7 @@ TEST_F(MCJITMultipleModuleTest, three_mo
> TEST_F(MCJITMultipleModuleTest, three_module_case_reverse_order) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B, C;
> + std::unique_ptr<Module> A, B, C;
> Function *FA, *FB, *FC;
> createThreeModuleCase(A, FA, B, FB, C, FC);
>
> @@ -287,7 +287,7 @@ TEST_F(MCJITMultipleModuleTest, three_mo
> TEST_F(MCJITMultipleModuleTest, three_module_chain_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B, C;
> + std::unique_ptr<Module> A, B, C;
> Function *FA, *FB, *FC;
> createThreeModuleChainedCallsCase(A, FA, B, FB, C, FC);
>
> @@ -312,7 +312,7 @@ TEST_F(MCJITMultipleModuleTest, three_mo
> TEST_F(MCJITMultipleModuleTest, three_modules_chain_case_reverse_order) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B, C;
> + std::unique_ptr<Module> A, B, C;
> Function *FA, *FB, *FC;
> createThreeModuleChainedCallsCase(A, FA, B, FB, C, FC);
>
> @@ -337,7 +337,7 @@ TEST_F(MCJITMultipleModuleTest, three_mo
> TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB1, *FB2;
> createCrossModuleRecursiveCase(A, FA, B, FB1, FB2);
>
> @@ -358,7 +358,7 @@ TEST_F(MCJITMultipleModuleTest, cross_mo
> TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case_reverse_order) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB1, *FB2;
> createCrossModuleRecursiveCase(A, FA, B, FB1, FB2);
>
> @@ -379,7 +379,7 @@ TEST_F(MCJITMultipleModuleTest, cross_mo
> TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case3) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<Module> A, B;
> + std::unique_ptr<Module> A, B;
> Function *FA, *FB1, *FB2;
> createCrossModuleRecursiveCase(A, FA, B, FB1, FB2);
>
>
> Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp (original)
> +++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp Wed Mar 5 23:51:42 2014
> @@ -7,7 +7,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "MCJITTestBase.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/ADT/StringMap.h"
> @@ -101,7 +100,7 @@ protected:
>
> void compileAndRun(int ExpectedRC = OriginalRC) {
> // This function shouldn't be called until after SetUp.
> - ASSERT_TRUE(TheJIT.isValid());
> + ASSERT_TRUE(bool(TheJIT));
> ASSERT_TRUE(0 != Main);
>
> // We may be using a null cache, so ensure compilation is valid.
> @@ -133,7 +132,7 @@ TEST_F(MCJITObjectCacheTest, SetNullObje
> TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<TestObjectCache> Cache(new TestObjectCache);
> + std::unique_ptr<TestObjectCache> Cache(new TestObjectCache);
>
> // Save a copy of the module pointer before handing it off to MCJIT.
> const Module * SavedModulePointer = M.get();
> @@ -162,7 +161,7 @@ TEST_F(MCJITObjectCacheTest, VerifyBasic
> TEST_F(MCJITObjectCacheTest, VerifyLoadFromCache) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<TestObjectCache> Cache(new TestObjectCache);
> + std::unique_ptr<TestObjectCache> Cache(new TestObjectCache);
>
> // Compile this module with an MCJIT engine
> createJIT(M.release());
> @@ -196,7 +195,7 @@ TEST_F(MCJITObjectCacheTest, VerifyLoadF
> TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) {
> SKIP_UNSUPPORTED_PLATFORM;
>
> - OwningPtr<TestObjectCache> Cache(new TestObjectCache);
> + std::unique_ptr<TestObjectCache> Cache(new TestObjectCache);
>
> // Compile this module with an MCJIT engine
> createJIT(M.release());
>
> Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h (original)
> +++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestBase.h Wed Mar 5 23:51:42 2014
> @@ -185,11 +185,9 @@ protected:
> // Populates Modules A and B:
> // Module A { Extern FB1, Function FA which calls FB1 },
> // Module B { Extern FA, Function FB1, Function FB2 which calls FA },
> - void createCrossModuleRecursiveCase(OwningPtr<Module> &A,
> - Function *&FA,
> - OwningPtr<Module> &B,
> - Function *&FB1,
> - Function *&FB2) {
> + void createCrossModuleRecursiveCase(std::unique_ptr<Module> &A, Function *&FA,
> + std::unique_ptr<Module> &B,
> + Function *&FB1, Function *&FB2) {
> // Define FB1 in B.
> B.reset(createEmptyModule("B"));
> FB1 = insertAccumulateFunction(B.get(), 0, "FB1");
> @@ -211,12 +209,10 @@ protected:
> // Module A { Function FA },
> // Module B { Extern FA, Function FB which calls FA },
> // Module C { Extern FB, Function FC which calls FB },
> - void createThreeModuleChainedCallsCase(OwningPtr<Module> &A,
> - Function *&FA,
> - OwningPtr<Module> &B,
> - Function *&FB,
> - OwningPtr<Module> &C,
> - Function *&FC) {
> + void
> + createThreeModuleChainedCallsCase(std::unique_ptr<Module> &A, Function *&FA,
> + std::unique_ptr<Module> &B, Function *&FB,
> + std::unique_ptr<Module> &C, Function *&FC) {
> A.reset(createEmptyModule("A"));
> FA = insertAddFunction(A.get());
>
> @@ -233,8 +229,8 @@ protected:
> // Module A { Function FA },
> // Populates Modules A and B:
> // Module B { Function FB }
> - void createTwoModuleCase(OwningPtr<Module> &A, Function *&FA,
> - OwningPtr<Module> &B, Function *&FB) {
> + void createTwoModuleCase(std::unique_ptr<Module> &A, Function *&FA,
> + std::unique_ptr<Module> &B, Function *&FB) {
> A.reset(createEmptyModule("A"));
> FA = insertAddFunction(A.get());
>
> @@ -244,8 +240,8 @@ protected:
>
> // Module A { Function FA },
> // Module B { Extern FA, Function FB which calls FA }
> - void createTwoModuleExternCase(OwningPtr<Module> &A, Function *&FA,
> - OwningPtr<Module> &B, Function *&FB) {
> + void createTwoModuleExternCase(std::unique_ptr<Module> &A, Function *&FA,
> + std::unique_ptr<Module> &B, Function *&FB) {
> A.reset(createEmptyModule("A"));
> FA = insertAddFunction(A.get());
>
> @@ -258,12 +254,9 @@ protected:
> // Module A { Function FA },
> // Module B { Extern FA, Function FB which calls FA },
> // Module C { Extern FB, Function FC which calls FA },
> - void createThreeModuleCase(OwningPtr<Module> &A,
> - Function *&FA,
> - OwningPtr<Module> &B,
> - Function *&FB,
> - OwningPtr<Module> &C,
> - Function *&FC) {
> + void createThreeModuleCase(std::unique_ptr<Module> &A, Function *&FA,
> + std::unique_ptr<Module> &B, Function *&FB,
> + std::unique_ptr<Module> &C, Function *&FC) {
> A.reset(createEmptyModule("A"));
> FA = insertAddFunction(A.get());
>
> @@ -342,10 +335,10 @@ protected:
> CodeModel::Model CodeModel;
> StringRef MArch;
> SmallVector<std::string, 1> MAttrs;
> - OwningPtr<ExecutionEngine> TheJIT;
> + std::unique_ptr<ExecutionEngine> TheJIT;
> RTDyldMemoryManager *MM;
>
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> };
>
> } // namespace llvm
>
> Modified: llvm/trunk/unittests/IR/ConstantsTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ConstantsTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/ConstantsTest.cpp (original)
> +++ llvm/trunk/unittests/IR/ConstantsTest.cpp Wed Mar 5 23:51:42 2014
> @@ -162,7 +162,7 @@ TEST(ConstantsTest, PointerCast) {
> }
>
> TEST(ConstantsTest, AsInstructionsTest) {
> - OwningPtr<Module> M(new Module("MyModule", getGlobalContext()));
> + std::unique_ptr<Module> M(new Module("MyModule", getGlobalContext()));
>
> Type *Int64Ty = Type::getInt64Ty(getGlobalContext());
> Type *Int32Ty = Type::getInt32Ty(getGlobalContext());
>
> Modified: llvm/trunk/unittests/IR/DominatorTreeTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/DominatorTreeTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/DominatorTreeTest.cpp (original)
> +++ llvm/trunk/unittests/IR/DominatorTreeTest.cpp Wed Mar 5 23:51:42 2014
> @@ -218,7 +218,7 @@ namespace llvm {
>
> TEST(DominatorTree, Unreachable) {
> DPass *P = new DPass();
> - OwningPtr<Module> M(makeLLVMModule(P));
> + std::unique_ptr<Module> M(makeLLVMModule(P));
> PassManager Passes;
> Passes.add(P);
> Passes.run(*M);
>
> Modified: llvm/trunk/unittests/IR/IRBuilderTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/IRBuilderTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/IRBuilderTest.cpp (original)
> +++ llvm/trunk/unittests/IR/IRBuilderTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/IR/IRBuilder.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/BasicBlock.h"
> #include "llvm/IR/DataLayout.h"
> #include "llvm/IR/Function.h"
> @@ -41,7 +40,7 @@ protected:
> }
>
> LLVMContext Ctx;
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> Function *F;
> BasicBlock *BB;
> GlobalVariable *GV;
> @@ -109,7 +108,7 @@ TEST_F(IRBuilderTest, LandingPadName) {
> }
>
> TEST_F(IRBuilderTest, DataLayout) {
> - OwningPtr<Module> M(new Module("test", Ctx));
> + std::unique_ptr<Module> M(new Module("test", Ctx));
> M->setDataLayout("e-n32");
> EXPECT_TRUE(M->getDataLayout()->isLegalInteger(32));
> M->setDataLayout("e");
>
> Modified: llvm/trunk/unittests/IR/LegacyPassManagerTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/LegacyPassManagerTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/LegacyPassManagerTest.cpp (original)
> +++ llvm/trunk/unittests/IR/LegacyPassManagerTest.cpp Wed Mar 5 23:51:42 2014
> @@ -346,7 +346,7 @@ namespace llvm {
>
> template<typename T>
> void MemoryTestHelper(int run) {
> - OwningPtr<Module> M(makeLLVMModule());
> + std::unique_ptr<Module> M(makeLLVMModule());
> T *P = new T();
> PassManager Passes;
> Passes.add(new DataLayoutPass(M.get()));
>
> Modified: llvm/trunk/unittests/IR/PassManagerTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/PassManagerTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/PassManagerTest.cpp (original)
> +++ llvm/trunk/unittests/IR/PassManagerTest.cpp Wed Mar 5 23:51:42 2014
> @@ -175,7 +175,7 @@ Module *parseIR(const char *IR) {
>
> class PassManagerTest : public ::testing::Test {
> protected:
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
>
> public:
> PassManagerTest()
>
> Modified: llvm/trunk/unittests/IR/PatternMatch.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/PatternMatch.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/PatternMatch.cpp (original)
> +++ llvm/trunk/unittests/IR/PatternMatch.cpp Wed Mar 5 23:51:42 2014
> @@ -32,7 +32,7 @@ namespace {
>
> struct PatternMatchTest : ::testing::Test {
> LLVMContext Ctx;
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> Function *F;
> BasicBlock *BB;
> IRBuilder<true, NoFolder> IRB;
>
> Modified: llvm/trunk/unittests/IR/ValueHandleTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ValueHandleTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/ValueHandleTest.cpp (original)
> +++ llvm/trunk/unittests/IR/ValueHandleTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/IR/ValueHandle.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/Constants.h"
> #include "llvm/IR/Instructions.h"
> #include "llvm/IR/LLVMContext.h"
> @@ -336,7 +335,7 @@ TEST_F(ValueHandle, DestroyingOtherVHOnS
>
> class DestroyingVH : public CallbackVH {
> public:
> - OwningPtr<WeakVH> ToClear[2];
> + std::unique_ptr<WeakVH> ToClear[2];
> DestroyingVH(Value *V) {
> ToClear[0].reset(new WeakVH(V));
> setValPtr(V);
>
> Modified: llvm/trunk/unittests/IR/ValueMapTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ValueMapTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/ValueMapTest.cpp (original)
> +++ llvm/trunk/unittests/IR/ValueMapTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/IR/ValueMap.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Config/llvm-config.h"
> #include "llvm/IR/Constants.h"
> #include "llvm/IR/Instructions.h"
> @@ -24,8 +23,8 @@ template<typename T>
> class ValueMapTest : public testing::Test {
> protected:
> Constant *ConstantV;
> - OwningPtr<BitCastInst> BitcastV;
> - OwningPtr<BinaryOperator> AddV;
> + std::unique_ptr<BitCastInst> BitcastV;
> + std::unique_ptr<BinaryOperator> AddV;
>
> ValueMapTest() :
> ConstantV(ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 0)),
>
> Modified: llvm/trunk/unittests/IR/ValueTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/ValueTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/ValueTest.cpp (original)
> +++ llvm/trunk/unittests/IR/ValueTest.cpp Wed Mar 5 23:51:42 2014
> @@ -45,7 +45,7 @@ TEST(ValueTest, UsedInBasicBlock) {
>
> TEST(GlobalTest, CreateAddressSpace) {
> LLVMContext &Ctx = getGlobalContext();
> - OwningPtr<Module> M(new Module("TestModule", Ctx));
> + std::unique_ptr<Module> M(new Module("TestModule", Ctx));
> Type *Int8Ty = Type::getInt8Ty(Ctx);
> Type *Int32Ty = Type::getInt32Ty(Ctx);
>
>
> Modified: llvm/trunk/unittests/IR/VerifierTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/VerifierTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/IR/VerifierTest.cpp (original)
> +++ llvm/trunk/unittests/IR/VerifierTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/IR/Verifier.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/IR/Constants.h"
> #include "llvm/IR/DerivedTypes.h"
> #include "llvm/IR/Function.h"
>
> Modified: llvm/trunk/unittests/Linker/LinkModulesTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Linker/LinkModulesTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Linker/LinkModulesTest.cpp (original)
> +++ llvm/trunk/unittests/Linker/LinkModulesTest.cpp Wed Mar 5 23:51:42 2014
> @@ -62,7 +62,7 @@ protected:
> M.reset();
> }
>
> - OwningPtr<Module> M;
> + std::unique_ptr<Module> M;
> Function *F;
> GlobalVariable *GV;
> BasicBlock *EntryBB;
>
> Modified: llvm/trunk/unittests/Option/OptionParsingTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Option/OptionParsingTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Option/OptionParsingTest.cpp (original)
> +++ llvm/trunk/unittests/Option/OptionParsingTest.cpp Wed Mar 5 23:51:42 2014
> @@ -7,7 +7,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/Option/Arg.h"
> #include "llvm/Option/ArgList.h"
> @@ -68,7 +67,8 @@ const char *Args[] = {
> TEST(Option, OptionParsing) {
> TestOptTable T;
> unsigned MAI, MAC;
> - OwningPtr<InputArgList> AL(T.ParseArgs(Args, array_endof(Args), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(Args, array_endof(Args), MAI, MAC));
>
> // Check they all exist.
> EXPECT_TRUE(AL->hasArg(OPT_A));
> @@ -111,7 +111,7 @@ TEST(Option, OptionParsing) {
> TEST(Option, ParseWithFlagExclusions) {
> TestOptTable T;
> unsigned MAI, MAC;
> - OwningPtr<InputArgList> AL;
> + std::unique_ptr<InputArgList> AL;
>
> // Exclude flag3 to avoid parsing as OPT_SLASH_C.
> AL.reset(T.ParseArgs(Args, array_endof(Args), MAI, MAC,
> @@ -142,7 +142,8 @@ TEST(Option, ParseAliasInGroup) {
> unsigned MAI, MAC;
>
> const char *MyArgs[] = { "-I" };
> - OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> EXPECT_TRUE(AL->hasArg(OPT_H));
> }
>
> @@ -151,7 +152,8 @@ TEST(Option, AliasArgs) {
> unsigned MAI, MAC;
>
> const char *MyArgs[] = { "-J", "-Joo" };
> - OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> EXPECT_TRUE(AL->hasArg(OPT_B));
> EXPECT_EQ(AL->getAllArgValues(OPT_B)[0], "foo");
> EXPECT_EQ(AL->getAllArgValues(OPT_B)[1], "bar");
> @@ -162,7 +164,8 @@ TEST(Option, IgnoreCase) {
> unsigned MAI, MAC;
>
> const char *MyArgs[] = { "-a", "-joo" };
> - OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> EXPECT_TRUE(AL->hasArg(OPT_A));
> EXPECT_TRUE(AL->hasArg(OPT_B));
> }
> @@ -172,7 +175,8 @@ TEST(Option, DoNotIgnoreCase) {
> unsigned MAI, MAC;
>
> const char *MyArgs[] = { "-a", "-joo" };
> - OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> EXPECT_FALSE(AL->hasArg(OPT_A));
> EXPECT_FALSE(AL->hasArg(OPT_B));
> }
> @@ -182,7 +186,8 @@ TEST(Option, SlurpEmpty) {
> unsigned MAI, MAC;
>
> const char *MyArgs[] = { "-A", "-slurp" };
> - OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> EXPECT_TRUE(AL->hasArg(OPT_A));
> EXPECT_TRUE(AL->hasArg(OPT_Slurp));
> EXPECT_EQ(AL->getAllArgValues(OPT_Slurp).size(), 0U);
> @@ -193,7 +198,8 @@ TEST(Option, Slurp) {
> unsigned MAI, MAC;
>
> const char *MyArgs[] = { "-A", "-slurp", "-B", "--", "foo" };
> - OwningPtr<InputArgList> AL(T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> + std::unique_ptr<InputArgList> AL(
> + T.ParseArgs(MyArgs, array_endof(MyArgs), MAI, MAC));
> EXPECT_EQ(AL->size(), 2U);
> EXPECT_TRUE(AL->hasArg(OPT_A));
> EXPECT_FALSE(AL->hasArg(OPT_B));
>
> Modified: llvm/trunk/unittests/Support/CompressionTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CompressionTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Support/CompressionTest.cpp (original)
> +++ llvm/trunk/unittests/Support/CompressionTest.cpp Wed Mar 5 23:51:42 2014
> @@ -12,7 +12,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/Compression.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/Config/config.h"
> #include "llvm/Support/MemoryBuffer.h"
> @@ -25,8 +24,8 @@ namespace {
> #if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ
>
> void TestZlibCompression(StringRef Input, zlib::CompressionLevel Level) {
> - OwningPtr<MemoryBuffer> Compressed;
> - OwningPtr<MemoryBuffer> Uncompressed;
> + std::unique_ptr<MemoryBuffer> Compressed;
> + std::unique_ptr<MemoryBuffer> Uncompressed;
> EXPECT_EQ(zlib::StatusOK, zlib::compress(Input, Compressed, Level));
> // Check that uncompressed buffer is the same as original.
> EXPECT_EQ(zlib::StatusOK, zlib::uncompress(Compressed->getBuffer(),
>
> Modified: llvm/trunk/unittests/Support/LineIteratorTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/LineIteratorTest.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Support/LineIteratorTest.cpp (original)
> +++ llvm/trunk/unittests/Support/LineIteratorTest.cpp Wed Mar 5 23:51:42 2014
> @@ -8,7 +8,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "llvm/Support/LineIterator.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/MemoryBuffer.h"
> #include "gtest/gtest.h"
>
> @@ -18,9 +17,9 @@ using namespace llvm::sys;
> namespace {
>
> TEST(LineIteratorTest, Basic) {
> - OwningPtr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer("line 1\n"
> - "line 2\n"
> - "line 3"));
> + std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer("line 1\n"
> + "line 2\n"
> + "line 3"));
>
> line_iterator I = line_iterator(*Buffer), E;
>
> @@ -42,11 +41,12 @@ TEST(LineIteratorTest, Basic) {
> }
>
> TEST(LineIteratorTest, CommentSkipping) {
> - OwningPtr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer("line 1\n"
> - "line 2\n"
> - "# Comment 1\n"
> - "line 4\n"
> - "# Comment 2"));
> + std::unique_ptr<MemoryBuffer> Buffer(
> + MemoryBuffer::getMemBuffer("line 1\n"
> + "line 2\n"
> + "# Comment 1\n"
> + "line 4\n"
> + "# Comment 2"));
>
> line_iterator I = line_iterator(*Buffer, '#'), E;
>
> @@ -68,11 +68,11 @@ TEST(LineIteratorTest, CommentSkipping)
> }
>
> TEST(LineIteratorTest, BlankSkipping) {
> - OwningPtr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer("\n\n\n"
> - "line 1\n"
> - "\n\n\n"
> - "line 2\n"
> - "\n\n\n"));
> + std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer("\n\n\n"
> + "line 1\n"
> + "\n\n\n"
> + "line 2\n"
> + "\n\n\n"));
>
> line_iterator I = line_iterator(*Buffer), E;
>
> @@ -91,7 +91,7 @@ TEST(LineIteratorTest, BlankSkipping) {
> }
>
> TEST(LineIteratorTest, EmptyBuffers) {
> - OwningPtr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer(""));
> + std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer(""));
> EXPECT_TRUE(line_iterator(*Buffer).is_at_eof());
> EXPECT_EQ(line_iterator(), line_iterator(*Buffer));
>
>
> Modified: llvm/trunk/unittests/Support/Path.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Support/Path.cpp (original)
> +++ llvm/trunk/unittests/Support/Path.cpp Wed Mar 5 23:51:42 2014
> @@ -555,7 +555,7 @@ TEST_F(FileSystemTest, CarriageReturn) {
> File << '\n';
> }
> {
> - OwningPtr<MemoryBuffer> Buf;
> + std::unique_ptr<MemoryBuffer> Buf;
> MemoryBuffer::getFile(FilePathname.c_str(), Buf);
> EXPECT_EQ(Buf->getBuffer(), "\r\n");
> }
> @@ -566,7 +566,7 @@ TEST_F(FileSystemTest, CarriageReturn) {
> File << '\n';
> }
> {
> - OwningPtr<MemoryBuffer> Buf;
> + std::unique_ptr<MemoryBuffer> Buf;
> MemoryBuffer::getFile(FilePathname.c_str(), Buf);
> EXPECT_EQ(Buf->getBuffer(), "\n");
> }
>
> Modified: llvm/trunk/unittests/Transforms/DebugIR/DebugIR.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Transforms/DebugIR/DebugIR.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Transforms/DebugIR/DebugIR.cpp (original)
> +++ llvm/trunk/unittests/Transforms/DebugIR/DebugIR.cpp Wed Mar 5 23:51:42 2014
> @@ -90,8 +90,8 @@ protected:
>
> LLVMContext Context;
> char *cwd;
> - OwningPtr<Module> M;
> - OwningPtr<DebugIR> D;
> + std::unique_ptr<Module> M;
> + std::unique_ptr<DebugIR> D;
> };
>
> // Test empty named Module that is not supposed to be output to disk.
>
> Modified: llvm/trunk/unittests/Transforms/Utils/SpecialCaseList.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Transforms/Utils/SpecialCaseList.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/Transforms/Utils/SpecialCaseList.cpp (original)
> +++ llvm/trunk/unittests/Transforms/Utils/SpecialCaseList.cpp Wed Mar 5 23:51:42 2014
> @@ -40,7 +40,7 @@ protected:
> }
>
> SpecialCaseList *makeSpecialCaseList(StringRef List, std::string &Error) {
> - OwningPtr<MemoryBuffer> MB(MemoryBuffer::getMemBuffer(List));
> + std::unique_ptr<MemoryBuffer> MB(MemoryBuffer::getMemBuffer(List));
> return SpecialCaseList::create(MB.get(), Error);
> }
>
> @@ -60,9 +60,10 @@ TEST_F(SpecialCaseListTest, ModuleIsIn)
> Function *F = makeFunction("foo", M);
> GlobalVariable *GV = makeGlobal("bar", "t", M);
>
> - OwningPtr<SpecialCaseList> SCL(makeSpecialCaseList("# This is a comment.\n"
> - "\n"
> - "src:hello\n"));
> + std::unique_ptr<SpecialCaseList> SCL(
> + makeSpecialCaseList("# This is a comment.\n"
> + "\n"
> + "src:hello\n"));
> EXPECT_TRUE(SCL->isIn(M));
> EXPECT_TRUE(SCL->isIn(*F));
> EXPECT_TRUE(SCL->isIn(*GV));
> @@ -83,7 +84,7 @@ TEST_F(SpecialCaseListTest, FunctionIsIn
> Function *Foo = makeFunction("foo", M);
> Function *Bar = makeFunction("bar", M);
>
> - OwningPtr<SpecialCaseList> SCL(makeSpecialCaseList("fun:foo\n"));
> + std::unique_ptr<SpecialCaseList> SCL(makeSpecialCaseList("fun:foo\n"));
> EXPECT_TRUE(SCL->isIn(*Foo));
> EXPECT_FALSE(SCL->isIn(*Bar));
>
> @@ -107,7 +108,7 @@ TEST_F(SpecialCaseListTest, GlobalIsIn)
> GlobalVariable *Foo = makeGlobal("foo", "t1", M);
> GlobalVariable *Bar = makeGlobal("bar", "t2", M);
>
> - OwningPtr<SpecialCaseList> SCL(makeSpecialCaseList("global:foo\n"));
> + std::unique_ptr<SpecialCaseList> SCL(makeSpecialCaseList("global:foo\n"));
> EXPECT_TRUE(SCL->isIn(*Foo));
> EXPECT_FALSE(SCL->isIn(*Bar));
> EXPECT_FALSE(SCL->isIn(*Foo, "init"));
> @@ -157,7 +158,7 @@ TEST_F(SpecialCaseListTest, AliasIsIn) {
> GlobalAlias *FooAlias = makeAlias("fooalias", Foo);
> GlobalAlias *BarAlias = makeAlias("baralias", Bar);
>
> - OwningPtr<SpecialCaseList> SCL(makeSpecialCaseList("fun:foo\n"));
> + std::unique_ptr<SpecialCaseList> SCL(makeSpecialCaseList("fun:foo\n"));
> EXPECT_FALSE(SCL->isIn(*FooAlias));
> EXPECT_FALSE(SCL->isIn(*BarAlias));
>
> @@ -193,9 +194,9 @@ TEST_F(SpecialCaseListTest, Substring) {
> GlobalAlias *GA1 = makeAlias("buffoonery", F);
> GlobalAlias *GA2 = makeAlias("foobar", GV);
>
> - OwningPtr<SpecialCaseList> SCL(makeSpecialCaseList("src:hello\n"
> - "fun:foo\n"
> - "global:bar\n"));
> + std::unique_ptr<SpecialCaseList> SCL(makeSpecialCaseList("src:hello\n"
> + "fun:foo\n"
> + "global:bar\n"));
> EXPECT_FALSE(SCL->isIn(M));
> EXPECT_FALSE(SCL->isIn(*F));
> EXPECT_FALSE(SCL->isIn(*GV));
> @@ -224,7 +225,7 @@ TEST_F(SpecialCaseListTest, InvalidSpeci
> }
>
> TEST_F(SpecialCaseListTest, EmptySpecialCaseList) {
> - OwningPtr<SpecialCaseList> SCL(makeSpecialCaseList(""));
> + std::unique_ptr<SpecialCaseList> SCL(makeSpecialCaseList(""));
> Module M("foo", Ctx);
> EXPECT_FALSE(SCL->isIn(M));
> }
>
> Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
> +++ llvm/trunk/utils/FileCheck/FileCheck.cpp Wed Mar 5 23:51:42 2014
> @@ -16,7 +16,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallString.h"
> #include "llvm/ADT/StringExtras.h"
> #include "llvm/ADT/StringMap.h"
> @@ -821,7 +820,7 @@ static StringRef FindFirstMatchingPrefix
> /// Returns true in case of an error, false otherwise.
> static bool ReadCheckFile(SourceMgr &SM,
> std::vector<CheckString> &CheckStrings) {
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code ec =
> MemoryBuffer::getFileOrSTDIN(CheckFilename, File)) {
> errs() << "Could not open check file '" << CheckFilename << "': "
> @@ -1218,7 +1217,7 @@ int main(int argc, char **argv) {
> return 2;
>
> // Open the file to check and add it to SourceMgr.
> - OwningPtr<MemoryBuffer> File;
> + std::unique_ptr<MemoryBuffer> File;
> if (error_code ec =
> MemoryBuffer::getFileOrSTDIN(InputFilename, File)) {
> errs() << "Could not open input file '" << InputFilename << "': "
>
> Modified: llvm/trunk/utils/FileUpdate/FileUpdate.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileUpdate/FileUpdate.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/utils/FileUpdate/FileUpdate.cpp (original)
> +++ llvm/trunk/utils/FileUpdate/FileUpdate.cpp Wed Mar 5 23:51:42 2014
> @@ -13,7 +13,6 @@
> //
> //===----------------------------------------------------------------------===//
>
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/Support/CommandLine.h"
> #include "llvm/Support/MemoryBuffer.h"
> #include "llvm/Support/PrettyStackTrace.h"
> @@ -44,7 +43,7 @@ int main(int argc, char **argv) {
> }
>
> // Get the input data.
> - OwningPtr<MemoryBuffer> In;
> + std::unique_ptr<MemoryBuffer> In;
> if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, In)) {
> errs() << argv[0] << ": error: Unable to get input '"
> << InputFilename << "': " << ec.message() << '\n';
> @@ -52,7 +51,7 @@ int main(int argc, char **argv) {
> }
>
> // Get the output data.
> - OwningPtr<MemoryBuffer> Out;
> + std::unique_ptr<MemoryBuffer> Out;
> MemoryBuffer::getFile(OutputFilename.c_str(), Out);
>
> // If the output exists and the contents match, we are done.
>
> Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Wed Mar 5 23:51:42 2014
> @@ -97,7 +97,6 @@
> //===----------------------------------------------------------------------===//
>
> #include "CodeGenTarget.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/PointerUnion.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/ADT/SmallPtrSet.h"
> @@ -1350,7 +1349,7 @@ void AsmMatcherInfo::buildInfo() {
> if (CGI.TheDef->getValueAsBit("isCodeGenOnly"))
> continue;
>
> - OwningPtr<MatchableInfo> II(new MatchableInfo(CGI));
> + std::unique_ptr<MatchableInfo> II(new MatchableInfo(CGI));
>
> II->initialize(*this, SingletonRegisters, AsmVariantNo, RegisterPrefix);
>
> @@ -1383,7 +1382,7 @@ void AsmMatcherInfo::buildInfo() {
> .startswith( MatchPrefix))
> continue;
>
> - OwningPtr<MatchableInfo> II(new MatchableInfo(Alias));
> + std::unique_ptr<MatchableInfo> II(new MatchableInfo(Alias));
>
> II->initialize(*this, SingletonRegisters, AsmVariantNo, RegisterPrefix);
>
> @@ -1455,7 +1454,7 @@ void AsmMatcherInfo::buildInfo() {
> II->TheDef->getValueAsString("TwoOperandAliasConstraint");
> if (Constraint != "") {
> // Start by making a copy of the original matchable.
> - OwningPtr<MatchableInfo> AliasII(new MatchableInfo(*II));
> + std::unique_ptr<MatchableInfo> AliasII(new MatchableInfo(*II));
>
> // Adjust it to be a two-operand alias.
> AliasII->formTwoOperandAlias(Constraint);
>
> Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.h?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/DAGISelMatcher.h (original)
> +++ llvm/trunk/utils/TableGen/DAGISelMatcher.h Wed Mar 5 23:51:42 2014
> @@ -11,7 +11,6 @@
> #define TBLGEN_DAGISELMATCHER_H
>
> #include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/OwningPtr.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/ADT/StringRef.h"
> #include "llvm/CodeGen/ValueTypes.h"
> @@ -41,7 +40,7 @@ void EmitMatcherTable(const Matcher *Mat
> class Matcher {
> // The next matcher node that is executed after this one. Null if this is the
> // last stage of a match.
> - OwningPtr<Matcher> Next;
> + std::unique_ptr<Matcher> Next;
> virtual void anchor();
> public:
> enum KindTy {
> @@ -100,7 +99,7 @@ public:
> void setNext(Matcher *C) { Next.reset(C); }
> Matcher *takeNext() { return Next.release(); }
>
> - OwningPtr<Matcher> &getNextPtr() { return Next; }
> + std::unique_ptr<Matcher> &getNextPtr() { return Next; }
>
> bool isEqual(const Matcher *M) const {
> if (getKind() != M->getKind()) return false;
>
> Modified: llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp (original)
> +++ llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp Wed Mar 5 23:51:42 2014
> @@ -22,7 +22,7 @@ using namespace llvm;
>
> /// ContractNodes - Turn multiple matcher node patterns like 'MoveChild+Record'
> /// into single compound nodes like RecordChild.
> -static void ContractNodes(OwningPtr<Matcher> &MatcherPtr,
> +static void ContractNodes(std::unique_ptr<Matcher> &MatcherPtr,
> const CodeGenDAGPatterns &CGP) {
> // If we reached the end of the chain, we're done.
> Matcher *N = MatcherPtr.get();
> @@ -31,7 +31,7 @@ static void ContractNodes(OwningPtr<Matc
> // If we have a scope node, walk down all of the children.
> if (ScopeMatcher *Scope = dyn_cast<ScopeMatcher>(N)) {
> for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) {
> - OwningPtr<Matcher> Child(Scope->takeChild(i));
> + std::unique_ptr<Matcher> Child(Scope->takeChild(i));
> ContractNodes(Child, CGP);
> Scope->resetChild(i, Child.release());
> }
> @@ -187,7 +187,7 @@ static void ContractNodes(OwningPtr<Matc
> /// run a the complex pattern if the pattern predicate will fail. For this
> /// reason, we refuse to sink the pattern predicate past a ComplexPattern.
> ///
> -static void SinkPatternPredicates(OwningPtr<Matcher> &MatcherPtr) {
> +static void SinkPatternPredicates(std::unique_ptr<Matcher> &MatcherPtr) {
> // Recursively scan for a PatternPredicate.
> // If we reached the end of the chain, we're done.
> Matcher *N = MatcherPtr.get();
> @@ -196,7 +196,7 @@ static void SinkPatternPredicates(Owning
> // Walk down all members of a scope node.
> if (ScopeMatcher *Scope = dyn_cast<ScopeMatcher>(N)) {
> for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) {
> - OwningPtr<Matcher> Child(Scope->takeChild(i));
> + std::unique_ptr<Matcher> Child(Scope->takeChild(i));
> SinkPatternPredicates(Child);
> Scope->resetChild(i, Child.release());
> }
> @@ -252,7 +252,7 @@ static Matcher *FindNodeWithKind(Matcher
> /// ABC
> /// XYZ
> ///
> -static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) {
> +static void FactorNodes(std::unique_ptr<Matcher> &MatcherPtr) {
> // If we reached the end of the chain, we're done.
> Matcher *N = MatcherPtr.get();
> if (N == 0) return;
> @@ -269,7 +269,7 @@ static void FactorNodes(OwningPtr<Matche
>
> for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) {
> // Factor the subexpression.
> - OwningPtr<Matcher> Child(Scope->takeChild(i));
> + std::unique_ptr<Matcher> Child(Scope->takeChild(i));
> FactorNodes(Child);
>
> if (Matcher *N = Child.release())
> @@ -512,7 +512,7 @@ static void FactorNodes(OwningPtr<Matche
>
> Matcher *llvm::OptimizeMatcher(Matcher *TheMatcher,
> const CodeGenDAGPatterns &CGP) {
> - OwningPtr<Matcher> MatcherPtr(TheMatcher);
> + std::unique_ptr<Matcher> MatcherPtr(TheMatcher);
> ContractNodes(MatcherPtr, CGP);
> SinkPatternPredicates(MatcherPtr);
> FactorNodes(MatcherPtr);
>
> Modified: llvm/trunk/utils/yaml-bench/YAMLBench.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/yaml-bench/YAMLBench.cpp?rev=203083&r1=203082&r2=203083&view=diff
> ==============================================================================
> --- llvm/trunk/utils/yaml-bench/YAMLBench.cpp (original)
> +++ llvm/trunk/utils/yaml-bench/YAMLBench.cpp Wed Mar 5 23:51:42 2014
> @@ -188,7 +188,7 @@ static std::string createJSONText(size_t
> int main(int argc, char **argv) {
> llvm::cl::ParseCommandLineOptions(argc, argv);
> if (Input.getNumOccurrences()) {
> - OwningPtr<MemoryBuffer> Buf;
> + std::unique_ptr<MemoryBuffer> Buf;
> if (MemoryBuffer::getFileOrSTDIN(Input, Buf))
> return 1;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list