diff options
43 files changed, 117 insertions, 117 deletions
diff --git a/include/llvm/MC/MCObjectDisassembler.h b/include/llvm/MC/MCObjectDisassembler.h index fedc9b03089..10cc04b945b 100644 --- a/include/llvm/MC/MCObjectDisassembler.h +++ b/include/llvm/MC/MCObjectDisassembler.h @@ -68,7 +68,7 @@ public: /// somewhere not accessible in the object file. /// This is used for dynamic disassembly (see RawMemoryObject). void setFallbackRegion(OwningPtr<MemoryObject> &Region) { - FallbackRegion.reset(Region.take()); + FallbackRegion.reset(Region.release()); } /// \brief Set the symbolizer to use to get information on external functions. diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp index 5cd2515a580..67e9c256ebc 100644 --- a/lib/AsmParser/Parser.cpp +++ b/lib/AsmParser/Parser.cpp @@ -37,7 +37,7 @@ Module *llvm::ParseAssembly(MemoryBuffer *F, OwningPtr<Module> M2(new Module(F->getBufferIdentifier(), Context)); if (LLParser(F, SM, Err, M2.get()).Run()) return 0; - return M2.take(); + return M2.release(); } Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err, @@ -49,7 +49,7 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err, return 0; } - return ParseAssembly(File.take(), 0, Err, Context); + return ParseAssembly(File.release(), 0, Err, Context); } Module *llvm::ParseAssemblyString(const char *AsmString, Module *M, diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp index 6c217cd232e..e77acce74f4 100644 --- a/lib/CodeGen/LLVMTargetMachine.cpp +++ b/lib/CodeGen/LLVMTargetMachine.cpp @@ -227,7 +227,7 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, return true; // If successful, createAsmPrinter took ownership of AsmStreamer. - AsmStreamer.take(); + AsmStreamer.release(); PM.add(Printer); @@ -292,7 +292,7 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM, return true; // If successful, createAsmPrinter took ownership of AsmStreamer. - AsmStreamer.take(); + AsmStreamer.release(); PM.add(Printer); diff --git a/lib/CodeGen/RegAllocPBQP.cpp b/lib/CodeGen/RegAllocPBQP.cpp index 83dbcecab0f..c9588db738c 100644 --- a/lib/CodeGen/RegAllocPBQP.cpp +++ b/lib/CodeGen/RegAllocPBQP.cpp @@ -89,7 +89,7 @@ public: /// Construct a PBQP register allocator. RegAllocPBQP(OwningPtr<PBQPBuilder> &b, char *cPassID=0) - : MachineFunctionPass(ID), builder(b.take()), customPassID(cPassID) { + : MachineFunctionPass(ID), builder(b.release()), customPassID(cPassID) { initializeSlotIndexesPass(*PassRegistry::getPassRegistry()); initializeLiveIntervalsPass(*PassRegistry::getPassRegistry()); initializeLiveStacksPass(*PassRegistry::getPassRegistry()); @@ -280,7 +280,7 @@ PBQPRAProblem *PBQPBuilder::build(MachineFunction *mf, const LiveIntervals *lis, } } - return p.take(); + return p.release(); } void PBQPBuilder::addSpillCosts(PBQP::Vector &costVec, @@ -391,7 +391,7 @@ PBQPRAProblem *PBQPBuilderWithCoalescing::build(MachineFunction *mf, } } - return p.take(); + return p.release(); } void PBQPBuilderWithCoalescing::addPhysRegCoalesce(PBQP::Vector &costVec, diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index e17387b31d3..5cce8df5210 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -308,7 +308,7 @@ void DWARFContext::parseCompileUnits() { if (!CU->extract(DIData, &offset)) { break; } - CUs.push_back(CU.take()); + CUs.push_back(CU.release()); offset = CUs.back()->getNextUnitOffset(); } } @@ -327,7 +327,7 @@ void DWARFContext::parseTypeUnits() { &I->second.Relocs, isLittleEndian())); if (!TU->extract(DIData, &offset)) break; - TUs.push_back(TU.take()); + TUs.push_back(TU.release()); offset = TUs.back()->getNextUnitOffset(); } } @@ -346,7 +346,7 @@ void DWARFContext::parseDWOCompileUnits() { if (!DWOCU->extract(DIData, &offset)) { break; } - DWOCUs.push_back(DWOCU.take()); + DWOCUs.push_back(DWOCU.release()); offset = DWOCUs.back()->getNextUnitOffset(); } } @@ -366,7 +366,7 @@ void DWARFContext::parseDWOTypeUnits() { isLittleEndian())); if (!TU->extract(DIData, &offset)) break; - DWOTUs.push_back(TU.take()); + DWOTUs.push_back(TU.release()); offset = DWOTUs.back()->getNextUnitOffset(); } } @@ -636,7 +636,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) : // Make data point to uncompressed section contents and save its contents. name = name.substr(1); data = UncompressedSection->getBuffer(); - UncompressedSections.push_back(UncompressedSection.take()); + UncompressedSections.push_back(UncompressedSection.release()); } StringRef *Section = diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 062c13f2789..fee15267803 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -486,12 +486,12 @@ ExecutionEngine *EngineBuilder::create(TargetMachine *TM) { if (UseMCJIT && ExecutionEngine::MCJITCtor) { ExecutionEngine *EE = ExecutionEngine::MCJITCtor(M, ErrorStr, MCJMM ? MCJMM : JMM, - AllocateGVsWithCode, TheTM.take()); + AllocateGVsWithCode, TheTM.release()); if (EE) return EE; } else if (ExecutionEngine::JITCtor) { ExecutionEngine *EE = ExecutionEngine::JITCtor(M, ErrorStr, JMM, - AllocateGVsWithCode, TheTM.take()); + AllocateGVsWithCode, TheTM.release()); if (EE) return EE; } } diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index a0dfbef51f3..ce746a546bf 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -168,7 +168,7 @@ ObjectBufferStream* MCJIT::emitObject(Module *M) { ObjCache->notifyObjectCompiled(M, MB.get()); } - return CompiledObject.take(); + return CompiledObject.release(); } void MCJIT::generateCodeForModule(Module *M) { @@ -188,7 +188,7 @@ void MCJIT::generateCodeForModule(Module *M) { if (0 != ObjCache) { OwningPtr<MemoryBuffer> PreCompiledObject(ObjCache->getObject(M)); if (0 != PreCompiledObject.get()) - ObjectToLoad.reset(new ObjectBuffer(PreCompiledObject.take())); + ObjectToLoad.reset(new ObjectBuffer(PreCompiledObject.release())); } // If the cache did not contain a suitable object, compile the object @@ -199,7 +199,7 @@ void MCJIT::generateCodeForModule(Module *M) { // Load the object into the dynamic linker. // MCJIT now owns the ObjectImage pointer (via its LoadedObjects list). - ObjectImage *LoadedObject = Dyld.loadObject(ObjectToLoad.take()); + ObjectImage *LoadedObject = Dyld.loadObject(ObjectToLoad.release()); LoadedObjects.push_back(LoadedObject); if (!LoadedObject) report_fatal_error(Dyld.getErrorString()); @@ -308,7 +308,7 @@ uint64_t MCJIT::getSymbolAddress(const std::string &Name, // FIXME: Support nested archives? if (!ChildIt->getAsBinary(ChildBin) && ChildBin->isObject()) { object::ObjectFile *OF = reinterpret_cast<object::ObjectFile *>( - ChildBin.take()); + ChildBin.release()); // This causes the object file to be loaded. addObjectFile(OF); // The address should be here now. diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index 3c88aea7a20..6055ffe823b 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -205,7 +205,7 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) { // Give the subclasses a chance to tie-up any loose ends. finalizeLoad(LocalSections); - return Obj.take(); + return Obj.release(); } // A helper method for computeTotalAllocSize. diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index f63263fd1f5..efca2bffbf6 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -2539,7 +2539,7 @@ LLVMBool LLVMCreateMemoryBufferWithContentsOfFile( OwningPtr<MemoryBuffer> MB; error_code ec; if (!(ec = MemoryBuffer::getFile(Path, MB))) { - *OutMemBuf = wrap(MB.take()); + *OutMemBuf = wrap(MB.release()); return 0; } @@ -2552,7 +2552,7 @@ LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, OwningPtr<MemoryBuffer> MB; error_code ec; if (!(ec = MemoryBuffer::getSTDIN(MB))) { - *OutMemBuf = wrap(MB.take()); + *OutMemBuf = wrap(MB.release()); return 0; } diff --git a/lib/IRReader/IRReader.cpp b/lib/IRReader/IRReader.cpp index 70801c43f1a..29a70403ae7 100644 --- a/lib/IRReader/IRReader.cpp +++ b/lib/IRReader/IRReader.cpp @@ -60,7 +60,7 @@ Module *llvm::getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err return 0; } - return getLazyIRModule(File.take(), Err, Context); + return getLazyIRModule(File.release(), Err, Context); } Module *llvm::ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err, @@ -93,7 +93,7 @@ Module *llvm::ParseIRFile(const std::string &Filename, SMDiagnostic &Err, return 0; } - return ParseIR(File.take(), Err, Context); + return ParseIR(File.release(), Err, Context); } //===----------------------------------------------------------------------===// diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index 87ea01f9261..d6ca41b8df8 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -270,7 +270,7 @@ const void* LTOCodeGenerator::compile(size_t* length, sys::fs::remove(NativeObjectPath); return NULL; } - NativeObjectFile = BuffPtr.take(); + NativeObjectFile = BuffPtr.release(); // remove temp files sys::fs::remove(NativeObjectPath); diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index fb208066348..4e71be8b4bc 100644 --- a/lib/LTO/LTOModule.cpp +++ b/lib/LTO/LTOModule.cpp @@ -83,7 +83,7 @@ bool LTOModule::isBitcodeFileForTarget(const char *path, OwningPtr<MemoryBuffer> buffer; if (MemoryBuffer::getFile(path, buffer)) return false; - return isTargetMatch(buffer.take(), triplePrefix); + return isTargetMatch(buffer.release(), triplePrefix); } /// isTargetMatch - Returns 'true' if the memory buffer is for the specified @@ -103,7 +103,7 @@ LTOModule *LTOModule::makeLTOModule(const char *path, TargetOptions options, errMsg = ec.message(); return NULL; } - return makeLTOModule(buffer.take(), options, errMsg); + return makeLTOModule(buffer.release(), options, errMsg); } LTOModule *LTOModule::makeLTOModule(int fd, const char *path, @@ -123,7 +123,7 @@ LTOModule *LTOModule::makeLTOModule(int fd, const char *path, errMsg = ec.message(); return NULL; } - return makeLTOModule(buffer.take(), options, errMsg); + return makeLTOModule(buffer.release(), options, errMsg); } LTOModule *LTOModule::makeLTOModule(const void *mem, size_t length, @@ -132,7 +132,7 @@ LTOModule *LTOModule::makeLTOModule(const void *mem, size_t length, OwningPtr<MemoryBuffer> buffer(makeBuffer(mem, length, path)); if (!buffer) return NULL; - return makeLTOModule(buffer.take(), options, errMsg); + return makeLTOModule(buffer.release(), options, errMsg); } LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer, @@ -175,7 +175,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer, options); m->materializeAllPermanently(); - LTOModule *Ret = new LTOModule(m.take(), target); + LTOModule *Ret = new LTOModule(m.release(), target); // We need a MCContext set up in order to get mangled names of private // symbols. It is a bit odd that we need to report uses and definitions diff --git a/lib/MC/MCDisassembler.cpp b/lib/MC/MCDisassembler.cpp index bfd51ab1af9..7c29fd36a3b 100644 --- a/lib/MC/MCDisassembler.cpp +++ b/lib/MC/MCDisassembler.cpp @@ -52,5 +52,5 @@ void MCDisassembler::tryAddingPcLoadReferenceComment(int64_t Value, } void MCDisassembler::setSymbolizer(OwningPtr<MCSymbolizer> &Symzer) { - Symbolizer.reset(Symzer.take()); + Symbolizer.reset(Symzer.release()); } diff --git a/lib/MC/MCDisassembler/Disassembler.cpp b/lib/MC/MCDisassembler/Disassembler.cpp index b0b8138e711..3302f8c8abc 100644 --- a/lib/MC/MCDisassembler/Disassembler.cpp +++ b/lib/MC/MCDisassembler/Disassembler.cpp @@ -84,7 +84,7 @@ LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, OwningPtr<MCSymbolizer> Symbolizer( TheTarget->createMCSymbolizer(Triple, GetOpInfo, SymbolLookUp, DisInfo, - Ctx, RelInfo.take())); + Ctx, RelInfo.release())); DisAsm->setSymbolizer(Symbolizer); DisAsm->setupForSymbolicDisassembly(GetOpInfo, SymbolLookUp, DisInfo, Ctx, RelInfo); diff --git a/lib/MC/MCSymbolizer.cpp b/lib/MC/MCSymbolizer.cpp index 1020b74b342..d3c7311e015 100644 --- a/lib/MC/MCSymbolizer.cpp +++ b/lib/MC/MCSymbolizer.cpp @@ -13,7 +13,7 @@ using namespace llvm; MCSymbolizer::MCSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo) - : Ctx(Ctx), RelInfo(RelInfo.take()) { + : Ctx(Ctx), RelInfo(RelInfo.release()) { } MCSymbolizer::~MCSymbolizer() { diff --git a/lib/Object/Binary.cpp b/lib/Object/Binary.cpp index c7f868fcdd1..673a34e98a6 100644 --- a/lib/Object/Binary.cpp +++ b/lib/Object/Binary.cpp @@ -48,7 +48,7 @@ ErrorOr<Binary *> object::createBinary(MemoryBuffer *Source, switch (Type) { case sys::fs::file_magic::archive: - return Archive::create(scopedSource.take()); + return Archive::create(scopedSource.release()); case sys::fs::file_magic::elf_relocatable: case sys::fs::file_magic::elf_executable: case sys::fs::file_magic::elf_shared_object: @@ -67,10 +67,10 @@ ErrorOr<Binary *> object::createBinary(MemoryBuffer *Source, case sys::fs::file_magic::coff_import_library: case sys::fs::file_magic::pecoff_executable: case sys::fs::file_magic::bitcode: - return ObjectFile::createSymbolicFile(scopedSource.take(), true, Type, + return ObjectFile::createSymbolicFile(scopedSource.release(), true, Type, Context); case sys::fs::file_magic::macho_universal_binary: - return MachOUniversalBinary::create(scopedSource.take()); + return MachOUniversalBinary::create(scopedSource.release()); case sys::fs::file_magic::unknown: case sys::fs::file_magic::windows_resource: // Unrecognized object file format. @@ -83,5 +83,5 @@ ErrorOr<Binary *> object::createBinary(StringRef Path) { OwningPtr<MemoryBuffer> File; if (error_code EC = MemoryBuffer::getFileOrSTDIN(Path, File)) return EC; - return createBinary(File.take()); + return createBinary(File.release()); } diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index 0c79506f419..95faa13256c 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -1071,5 +1071,5 @@ ErrorOr<ObjectFile *> ObjectFile::createCOFFObjectFile(MemoryBuffer *Object, OwningPtr<COFFObjectFile> Ret(new COFFObjectFile(Object, EC, BufferOwned)); if (EC) return EC; - return Ret.take(); + return Ret.release(); } diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index 0d90c906ccb..17b615e0170 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -79,7 +79,7 @@ ErrorOr<ObjectFile *> ObjectFile::createELFObjectFile(MemoryBuffer *Obj, if (EC) return EC; - return R.take(); + return R.release(); } } // end namespace llvm diff --git a/lib/Object/IRObjectFile.cpp b/lib/Object/IRObjectFile.cpp index b3a5668fc20..e8d51ecbf67 100644 --- a/lib/Object/IRObjectFile.cpp +++ b/lib/Object/IRObjectFile.cpp @@ -148,5 +148,5 @@ ErrorOr<SymbolicFile *> llvm::object::SymbolicFile::createIRObjectFile( new IRObjectFile(Object, EC, Context, BufferOwned)); if (EC) return EC; - return Ret.take(); + return Ret.release(); } diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index 09fe6a7571e..00599efce05 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -1565,7 +1565,7 @@ ErrorOr<ObjectFile *> ObjectFile::createMachOObjectFile(MemoryBuffer *Buffer, if (EC) return EC; - return Ret.take(); + return Ret.release(); } } // end namespace object diff --git a/lib/Object/MachOUniversal.cpp b/lib/Object/MachOUniversal.cpp index 0fe06b46b50..3975a18c601 100644 --- a/lib/Object/MachOUniversal.cpp +++ b/lib/Object/MachOUniversal.cpp @@ -98,7 +98,7 @@ MachOUniversalBinary::create(MemoryBuffer *Source) { OwningPtr<MachOUniversalBinary> Ret(new MachOUniversalBinary(Source, EC)); if (EC) return EC; - return Ret.take(); + return Ret.release(); } MachOUniversalBinary::MachOUniversalBinary(MemoryBuffer *Source, diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp index 69f47a77a42..058bc3436a6 100644 --- a/lib/Object/ObjectFile.cpp +++ b/lib/Object/ObjectFile.cpp @@ -90,5 +90,5 @@ ErrorOr<ObjectFile *> ObjectFile::createObjectFile(StringRef ObjectPath) { OwningPtr<MemoryBuffer> File; if (error_code EC = MemoryBuffer::getFile(ObjectPath, File)) return EC; - return createObjectFile(File.take()); + return createObjectFile(File.release()); } diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index d4b94f8cd5d..f9aef6dba60 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -67,7 +67,7 @@ size_t SourceMgr::AddIncludeFile(const std::string &Filename, if (!NewBuf) return ~0U; - return AddNewSourceBuffer(NewBuf.take(), IncludeLoc); + return AddNewSourceBuffer(NewBuf.release(), IncludeLoc); } diff --git a/lib/TableGen/Main.cpp b/lib/TableGen/Main.cpp index 6532268263c..e45679b0603 100644 --- a/lib/TableGen/Main.cpp +++ b/lib/TableGen/Main.cpp @@ -88,7 +88,7 @@ int TableGenMain(char *argv0, TableGenMainFn *MainFn) { << ec.message() <<"\n"; return 1; } - MemoryBuffer *F = File.take(); + MemoryBuffer *F = File.release(); // Tell SrcMgr about this buffer, which is what TGParser will pick up. SrcMgr.AddNewSourceBuffer(F, SMLoc()); diff --git a/lib/Transforms/Utils/SpecialCaseList.cpp b/lib/Transforms/Utils/SpecialCaseList.cpp index 3d5eb064860..a177c829313 100644 --- a/lib/Transforms/Utils/SpecialCaseList.cpp +++ b/lib/Transforms/Utils/SpecialCaseList.cpp @@ -68,7 +68,7 @@ SpecialCaseList *SpecialCaseList::create( OwningPtr<SpecialCaseList> SCL(new SpecialCaseList()); if (!SCL->parse(MB, Error)) return 0; - return SCL.take(); + return SCL.release(); } SpecialCaseList *SpecialCaseList::createOrDie(const StringRef Path) { diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index df7c480e70b..069a32af0fd 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -145,7 +145,7 @@ ReduceMiscompilingPasses::doTest(std::vector<std::string> &Prefix, << "' passes compile correctly after the '" << getPassesString(Prefix) << "' passes: "; - OwningPtr<Module> OriginalInput(BD.swapProgramIn(PrefixOutput.take())); + OwningPtr<Module> OriginalInput(BD.swapProgramIn(PrefixOutput.release())); if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) { errs() << " Error running this sequence of passes" @@ -168,7 +168,7 @@ ReduceMiscompilingPasses::doTest(std::vector<std::string> &Prefix, // Otherwise, we must not be running the bad pass anymore. outs() << " yup.\n"; // No miscompilation! // Restore orig program & free test. - delete BD.swapProgramIn(OriginalInput.take()); + delete BD.swapProgramIn(OriginalInput.release()); return NoFailure; } diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 448db84d1c9..7bbc5dc97bf 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -544,7 +544,7 @@ int main(int argc, char **argv, char * const *envp) { Err.print(argv[0], errs()); return 1; } - object::Archive *Ar = new object::Archive(ArBuf.take(), ec); + object::Archive *Ar = new object::Archive(ArBuf.release(), ec); if (ec || !Ar) { Err.print(argv[0], errs()); return 1; diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index f30eb082085..e1987b107fe 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -785,7 +785,7 @@ static void performWriteOperation(ArchiveOperation Operation, object::Archive::child_iterator OldMember = Member.getOld(); failIfError(OldMember->getMemoryBuffer(MemberBuffer)); } - MemberBuffers[I] = MemberBuffer.take(); + MemberBuffers[I] = MemberBuffer.release(); } if (Symtab) { @@ -947,7 +947,7 @@ static int performOperation(ArchiveOperation Operation) { } if (!EC) { - object::Archive Archive(Buf.take(), EC); + object::Archive Archive(Buf.release(), EC); if (EC) { errs() << ToolName << ": error loading '" << ArchiveName diff --git a/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index 103779eafdc..05e8d630d98 100644 --- a/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -94,7 +94,7 @@ static void DumpInput(const StringRef &Filename) { return; } - ErrorOr<ObjectFile*> ObjOrErr(ObjectFile::createObjectFile(Buff.take())); + ErrorOr<ObjectFile*> ObjOrErr(ObjectFile::createObjectFile(Buff.release())); if (error_code EC = ObjOrErr.getError()) { errs() << Filename << ": " << EC.message() << '\n'; return; diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 9c7e76cd330..9061f1d1b38 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -368,7 +368,7 @@ int main(int argc, char **argv) { errs() << ProgName << ": " << ec.message() << '\n'; return 1; } - MemoryBuffer *Buffer = BufferPtr.take(); + MemoryBuffer *Buffer = BufferPtr.release(); SourceMgr SrcMgr; diff --git a/tools/llvm-mcmarkup/llvm-mcmarkup.cpp b/tools/llvm-mcmarkup/llvm-mcmarkup.cpp index 888761f10f0..72a075c50d5 100644 --- a/tools/llvm-mcmarkup/llvm-mcmarkup.cpp +++ b/tools/llvm-mcmarkup/llvm-mcmarkup.cpp @@ -141,7 +141,7 @@ static void parseMCMarkup(StringRef Filename) { errs() << ToolName << ": " << ec.message() << '\n'; return; } - MemoryBuffer *Buffer = BufferPtr.take(); + MemoryBuffer *Buffer = BufferPtr.release(); SourceMgr SrcMgr; diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index 35b2276048a..7053b363400 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -523,7 +523,7 @@ static void dumpSymbolNamesFromFile(std::string &Filename) { return; LLVMContext &Context = getGlobalContext(); - ErrorOr<Binary *> BinaryOrErr = createBinary(Buffer.take(), &Context); + ErrorOr<Binary *> BinaryOrErr = createBinary(Buffer.release(), &Context); if (error(BinaryOrErr.getError(), Filename)) return; OwningPtr<Binary> Bin(BinaryOrErr.get()); diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 35e424d60b4..d67b3c63ad8 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -209,7 +209,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) { } OwningPtr<MachOObjectFile> MachOOF(static_cast<MachOObjectFile *>( - ObjectFile::createMachOObjectFile(Buff.take()).get())); + ObjectFile::createMachOObjectFile(Buff.release()).get())); DisassembleInputMachO2(Filename, MachOOF.get()); } @@ -297,7 +297,7 @@ static void DisassembleInputMachO2(StringRef Filename, errs() << "llvm-objdump: " << Filename << ": " << ec.message() << '\n'; return; } - DbgObj = ObjectFile::createMachOObjectFile(Buf.take()).get(); + DbgObj = ObjectFile::createMachOObjectFile(Buf.release()).get(); } // Setup the DIContext diff --git a/tools/llvm-rtdyld/llvm-rtdyld.cpp b/tools/llvm-rtdyld/llvm-rtdyld.cpp index 65c0ab72553..d9e640fc353 100644 --- a/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -140,7 +140,7 @@ static int printLineInfoForInput() { return Error("unable to read input: '" + ec.message() + "'"); // Load the object file - LoadedObject.reset(Dyld.loadObject(new ObjectBuffer(InputBuffer.take()))); + LoadedObject.reset(Dyld.loadObject(new ObjectBuffer(InputBuffer.release()))); if (!LoadedObject) { return Error(Dyld.getErrorString()); } @@ -198,7 +198,7 @@ static int executeInput() { return Error("unable to read input: '" + ec.message() + "'"); // Load the object file - LoadedObject.reset(Dyld.loadObject(new ObjectBuffer(InputBuffer.take()))); + LoadedObject.reset(Dyld.loadObject(new ObjectBuffer(InputBuffer.release()))); if (!LoadedObject) { return Error(Dyld.getErrorString()); } diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp index 3adf2972593..91abe46e095 100644 --- a/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -315,7 +315,7 @@ LLVMSymbolizer::getOrCreateBinary(const std::string &Path) { if (!error(BinaryOrErr.getError())) { OwningPtr<Binary> ParsedBinary(BinaryOrErr.get()); // Check if it's a universal binary. - Bin = ParsedBinary.take(); + Bin = ParsedBinary.release(); ParsedBinariesAndObjects.push_back(Bin); if (Bin->isMachO() || Bin->isMachOUniversalBinary()) { // On Darwin we may find DWARF in separate object file in @@ -363,7 +363,7 @@ LLVMSymbolizer::getObjectFileFromBinary(Binary *Bin, const std::string &ArchName return I->second; OwningPtr<ObjectFile> ParsedObj; if (!UB->getObjectForArch(Triple(ArchName).getArch(), ParsedObj)) { - Res = ParsedObj.take(); + Res = ParsedObj.release(); ParsedBinariesAndObjects.push_back(Res); } ObjectFileForArch[std::make_pair(UB, ArchName)] = Res; diff --git a/tools/obj2yaml/obj2yaml.cpp b/tools/obj2yaml/obj2yaml.cpp index 8d128b35394..d675f59cf48 100644 --- a/tools/obj2yaml/obj2yaml.cpp +++ b/tools/obj2yaml/obj2yaml.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) { errs() << "Error: '" << ec.message() << "' opening file '" << InputFilename << "'\n"; } else { - ec = coff2yaml(outs(), buf.take()); + ec = coff2yaml(outs(), buf.release()); if (ec) errs() << "Error: " << ec.message() << " dumping COFF file\n"; } diff --git a/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp index 7c3239ea259..62ed0a8cb11 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITMultipleModuleTest.cpp @@ -94,8 +94,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_case) { Function *FA, *FB; createTwoModuleCase(A, FA, B, FB); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str()); checkAdd(ptr); @@ -114,8 +114,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_reverse_case) { Function *FA, *FB; createTwoModuleCase(A, FA, B, FB); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FB->getName().str()); TheJIT->finalizeObject(); @@ -135,8 +135,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_extern_reverse_case) { Function *FA, *FB; createTwoModuleExternCase(A, FA, B, FB); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FB->getName().str()); TheJIT->finalizeObject(); @@ -156,8 +156,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_extern_case) { Function *FA, *FB; createTwoModuleExternCase(A, FA, B, FB); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str()); checkAdd(ptr); @@ -177,8 +177,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_consecutive_call_case) { createTwoModuleExternCase(A, FA1, B, FB); FA2 = insertSimpleCallFunction<int32_t(int32_t, int32_t)>(A.get(), FA1); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FB->getName().str()); TheJIT->finalizeObject(); @@ -213,8 +213,8 @@ TEST_F(MCJITMultipleModuleTest, two_module_global_variables_case) { FB = startFunction<int32_t(void)>(B.get(), "FB"); endFunctionWithRet(FB, Builder.CreateLoad(GVB)); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t FBPtr = TheJIT->getFunctionAddress(FB->getName().str()); TheJIT->finalizeObject(); @@ -241,9 +241,9 @@ TEST_F(MCJITMultipleModuleTest, three_module_case) { Function *FA, *FB, *FC; createThreeModuleCase(A, FA, B, FB, C, FC); - createJIT(A.take()); - TheJIT->addModule(B.take()); - TheJIT->addModule(C.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); + TheJIT->addModule(C.release()); uint64_t ptr = TheJIT->getFunctionAddress(FC->getName().str()); checkAdd(ptr); @@ -266,9 +266,9 @@ TEST_F(MCJITMultipleModuleTest, three_module_case_reverse_order) { Function *FA, *FB, *FC; createThreeModuleCase(A, FA, B, FB, C, FC); - createJIT(A.take()); - TheJIT->addModule(B.take()); - TheJIT->addModule(C.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); + TheJIT->addModule(C.release()); uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str()); checkAdd(ptr); @@ -291,9 +291,9 @@ TEST_F(MCJITMultipleModuleTest, three_module_chain_case) { Function *FA, *FB, *FC; createThreeModuleChainedCallsCase(A, FA, B, FB, C, FC); - createJIT(A.take()); - TheJIT->addModule(B.take()); - TheJIT->addModule(C.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); + TheJIT->addModule(C.release()); uint64_t ptr = TheJIT->getFunctionAddress(FC->getName().str()); checkAdd(ptr); @@ -316,9 +316,9 @@ TEST_F(MCJITMultipleModuleTest, three_modules_chain_case_reverse_order) { Function *FA, *FB, *FC; createThreeModuleChainedCallsCase(A, FA, B, FB, C, FC); - createJIT(A.take()); - TheJIT->addModule(B.take()); - TheJIT->addModule(C.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); + TheJIT->addModule(C.release()); uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str()); checkAdd(ptr); @@ -341,8 +341,8 @@ TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case) { Function *FA, *FB1, *FB2; createCrossModuleRecursiveCase(A, FA, B, FB1, FB2); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FA->getName().str()); checkAccumulate(ptr); @@ -362,8 +362,8 @@ TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case_reverse_order) { Function *FA, *FB1, *FB2; createCrossModuleRecursiveCase(A, FA, B, FB1, FB2); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FB1->getName().str()); checkAccumulate(ptr); @@ -383,8 +383,8 @@ TEST_F(MCJITMultipleModuleTest, cross_module_dependency_case3) { Function *FA, *FB1, *FB2; createCrossModuleRecursiveCase(A, FA, B, FB1, FB2); - createJIT(A.take()); - TheJIT->addModule(B.take()); + createJIT(A.release()); + TheJIT->addModule(B.release()); uint64_t ptr = TheJIT->getFunctionAddress(FB1->getName().str()); checkAccumulate(ptr); diff --git a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp index ba7f933671a..f16928b7a96 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITObjectCacheTest.cpp @@ -122,7 +122,7 @@ protected: TEST_F(MCJITObjectCacheTest, SetNullObjectCache) { SKIP_UNSUPPORTED_PLATFORM; - createJIT(M.take()); + createJIT(M.release()); TheJIT->setObjectCache(NULL); @@ -138,7 +138,7 @@ TEST_F(MCJITObjectCacheTest, VerifyBasicObjectCaching) { // Save a copy of the module pointer before handing it off to MCJIT. const Module * SavedModulePointer = M.get(); - createJIT(M.take()); + createJIT(M.release()); TheJIT->setObjectCache(Cache.get()); @@ -165,7 +165,7 @@ TEST_F(MCJITObjectCacheTest, VerifyLoadFromCache) { OwningPtr<TestObjectCache> Cache(new TestObjectCache); // Compile this module with an MCJIT engine - createJIT(M.take()); + createJIT(M.release()); TheJIT->setObjectCache(Cache.get()); TheJIT->finalizeObject(); @@ -182,7 +182,7 @@ TEST_F(MCJITObjectCacheTest, VerifyLoadFromCache) { const Module * SecondModulePointer = M.get(); // Create a new MCJIT instance to load this module then execute it. - createJIT(M.take()); + createJIT(M.release()); TheJIT->setObjectCache(Cache.get()); compileAndRun(); @@ -199,7 +199,7 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) { OwningPtr<TestObjectCache> Cache(new TestObjectCache); // Compile this module with an MCJIT engine - createJIT(M.take()); + createJIT(M.release()); TheJIT->setObjectCache(Cache.get()); TheJIT->finalizeObject(); @@ -217,7 +217,7 @@ TEST_F(MCJITObjectCacheTest, VerifyNonLoadFromCache) { const Module * SecondModulePointer = M.get(); // Create a new MCJIT instance to load this module then execute it. - createJIT(M.take()); + createJIT(M.release()); TheJIT->setObjectCache(Cache.get()); // Verify that our object cache does not contain the module yet. diff --git a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp index fab81551fa5..a439508af0c 100644 --- a/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp +++ b/unittests/ExecutionEngine/MCJIT/MCJITTest.cpp @@ -49,7 +49,7 @@ TEST_F(MCJITTest, global_variable) { int initialValue = 5; GlobalValue *Global = insertGlobalInt32(M.get(), "test_global", initialValue); - createJIT(M.take()); + createJIT(M.release()); void *globalPtr = TheJIT->getPointerToGlobal(Global); EXPECT_TRUE(0 != globalPtr) << "Unable to get pointer to global value from JIT"; @@ -62,7 +62,7 @@ TEST_F(MCJITTest, add_function) { SKIP_UNSUPPORTED_PLATFORM; Function *F = insertAddFunction(M.get()); - createJIT(M.take()); + createJIT(M.release()); uint64_t addPtr = TheJIT->getFunctionAddress(F->getName().str()); EXPECT_TRUE(0 != addPtr) << "Unable to get pointer to function from JIT"; @@ -83,7 +83,7 @@ TEST_F(MCJITTest, run_main) { int rc = 6; Function *Main = insertMainFunction(M.get(), 6); - createJIT(M.take()); + createJIT(M.release()); uint64_t ptr = TheJIT->getFunctionAddress(Main->getName().str()); EXPECT_TRUE(0 != ptr) << "Unable to get pointer to main() from JIT"; @@ -104,7 +104,7 @@ TEST_F(MCJITTest, return_global) { Value *ReadGlobal = Builder.CreateLoad(GV); endFunctionWithRet(ReturnGlobal, ReadGlobal); - createJIT(M.take()); + createJIT(M.release()); uint64_t rgvPtr = TheJIT->getFunctionAddress(ReturnGlobal->getName().str()); EXPECT_TRUE(0 != rgvPtr); @@ -175,7 +175,7 @@ TEST_F(MCJITTest, multiple_functions) { Inner = Outer; } - createJIT(M.take()); + createJIT(M.release()); uint64_t ptr = TheJIT->getFunctionAddress(Outer->getName().str()); EXPECT_TRUE(0 != ptr) << "Unable to get pointer to outer function from JIT"; diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index d33db18cb86..b0196f7fa8e 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/utils/FileCheck/FileCheck.cpp @@ -832,7 +832,7 @@ static bool ReadCheckFile(SourceMgr &SM, // If we want to canonicalize whitespace, strip excess whitespace from the // buffer containing the CHECK lines. Remove DOS style line endings. MemoryBuffer *F = - CanonicalizeInputFile(File.take(), NoCanonicalizeWhiteSpace); + CanonicalizeInputFile(File.release(), NoCanonicalizeWhiteSpace); SM.AddNewSourceBuffer(F, SMLoc()); @@ -1234,7 +1234,7 @@ int main(int argc, char **argv) { // Remove duplicate spaces in the input file if requested. // Remove DOS style line endings. MemoryBuffer *F = - CanonicalizeInputFile(File.take(), NoCanonicalizeWhiteSpace); + CanonicalizeInputFile(File.release(), NoCanonicalizeWhiteSpace); SM.AddNewSourceBuffer(F, SMLoc()); diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index cf4580f659a..e9760625f6f 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -1366,7 +1366,7 @@ void AsmMatcherInfo::buildInfo() { StringRef(II->TheDef->getName()).endswith("_Int")) continue; - Matchables.push_back(II.take()); + Matchables.push_back(II.release()); } // Parse all of the InstAlias definitions and stick them in the list of @@ -1390,7 +1390,7 @@ void AsmMatcherInfo::buildInfo() { // Validate the alias definitions. II->validate(CommentDelimiter, false); - Matchables.push_back(II.take()); + Matchables.push_back(II.release()); } } @@ -1461,7 +1461,7 @@ void AsmMatcherInfo::buildInfo() { AliasII->formTwoOperandAlias(Constraint); // Add the alias to the matchables list. - NewMatchables.push_back(AliasII.take()); + NewMatchables.push_back(AliasII.release()); } } else II->buildAliasResultOperands(); diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h index bf760d5034d..441acd56b20 100644 --- a/utils/TableGen/DAGISelMatcher.h +++ b/utils/TableGen/DAGISelMatcher.h @@ -98,7 +98,7 @@ public: Matcher *getNext() { return Next.get(); } const Matcher *getNext() const { return Next.get(); } void setNext(Matcher *C) { Next.reset(C); } - Matcher *takeNext() { return Next.take(); } + Matcher *takeNext() { return Next.release(); } OwningPtr<Matcher> &getNextPtr() { return Next; } diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp index 682b27c097a..bde864aa0ff 100644 --- a/utils/TableGen/DAGISelMatcherOpt.cpp +++ b/utils/TableGen/DAGISelMatcherOpt.cpp @@ -33,7 +33,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) { OwningPtr<Matcher> Child(Scope->takeChild(i)); ContractNodes(Child, CGP); - Scope->resetChild(i, Child.take()); + Scope->resetChild(i, Child.release()); } return; } @@ -62,7 +62,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, if (New) { // Insert the new node. - New->setNext(MatcherPtr.take()); + New->setNext(MatcherPtr.release()); MatcherPtr.reset(New); // Remove the old one. MC->setNext(MC->getNext()->takeNext()); @@ -85,7 +85,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, if (isa<EmitNodeMatcher>(N) && isa<MarkGlueResultsMatcher>(N->getNext()) && isa<CompleteMatchMatcher>(N->getNext()->getNext())) { // Unlink the two nodes from the list. - Matcher *EmitNode = MatcherPtr.take(); + Matcher *EmitNode = MatcherPtr.release(); Matcher *MFR = EmitNode->takeNext(); Matcher *Tail = MFR->takeNext(); @@ -164,7 +164,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr, isa<RecordMatcher>(N)) && isa<CheckOpcodeMatcher>(N->getNext())) { // Unlink the two nodes from the list. - Matcher *CheckType = MatcherPtr.take(); + Matcher *CheckType = MatcherPtr.release(); Matcher *CheckOpcode = CheckType->takeNext(); Matcher *Tail = CheckOpcode->takeNext(); @@ -198,7 +198,7 @@ static void SinkPatternPredicates(OwningPtr<Matcher> &MatcherPtr) { for (unsigned i = 0, e = Scope->getNumChildren(); i != e; ++i) { OwningPtr<Matcher> Child(Scope->takeChild(i)); SinkPatternPredicates(Child); - Scope->resetChild(i, Child.take()); + Scope->resetChild(i, Child.release()); } return; } @@ -217,7 +217,7 @@ static void SinkPatternPredicates(OwningPtr<Matcher> &MatcherPtr) { // Okay, we know we can sink it past at least one node. Unlink it from the // chain and scan for the new insertion point. - MatcherPtr.take(); // Don't delete CPPM. + MatcherPtr.release(); // Don't delete CPPM. MatcherPtr.reset(CPPM->takeNext()); N = MatcherPtr.get(); @@ -272,7 +272,7 @@ static void FactorNodes(OwningPtr<Matcher> &MatcherPtr) { OwningPtr<Matcher> Child(Scope->takeChild(i)); FactorNodes(Child); - if (Matcher *N = Child.take()) + if (Matcher *N = Child.release()) OptionsToMatch.push_back(N); } @@ -516,5 +516,5 @@ Matcher *llvm::OptimizeMatcher(Matcher *TheMatcher, ContractNodes(MatcherPtr, CGP); SinkPatternPredicates(MatcherPtr); FactorNodes(MatcherPtr); - return MatcherPtr.take(); + return MatcherPtr.release(); } |