Index: llvm/include/llvm/ProfileData/InstrProfReader.h =================================================================== --- llvm/include/llvm/ProfileData/InstrProfReader.h +++ llvm/include/llvm/ProfileData/InstrProfReader.h @@ -257,7 +257,7 @@ InstrProfSymtab &getSymtab() override { assert(Symtab.get()); - return *Symtab.get(); + return *Symtab; } }; @@ -700,10 +700,10 @@ ProfileSummary &getSummary(bool UseCS) { if (UseCS) { assert(CS_Summary && "No context sensitive summary"); - return *(CS_Summary.get()); + return *CS_Summary; } else { assert(Summary && "No profile summary"); - return *(Summary.get()); + return *Summary; } } }; Index: llvm/include/llvm/Support/YAMLParser.h =================================================================== --- llvm/include/llvm/Support/YAMLParser.h +++ llvm/include/llvm/Support/YAMLParser.h @@ -610,7 +610,7 @@ return *this; } - Document &operator*() { return *Doc->get(); } + Document &operator*() { return **Doc; } std::unique_ptr &operator->() { return *Doc; } Index: llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -591,7 +591,7 @@ bool DWARFUnit::parseDWO(StringRef DWOAlternativeLocation) { if (IsDWO) return false; - if (DWO.get()) + if (DWO) return false; DWARFDie UnitDie = getUnitDIE(); if (!UnitDie) Index: llvm/lib/DebugInfo/LogicalView/Core/LVElement.cpp =================================================================== --- llvm/lib/DebugInfo/LogicalView/Core/LVElement.cpp +++ llvm/lib/DebugInfo/LogicalView/Core/LVElement.cpp @@ -332,7 +332,7 @@ "Extra double spaces in name."); LLVM_DEBUG({ dbgs() << "Fullname = '" << Fullname << "'\n"; }); - setName(Fullname.c_str()); + setName(Fullname); } void LVElement::setFile(LVElement *Reference) { Index: llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp =================================================================== --- llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp +++ llvm/lib/DebugInfo/LogicalView/Core/LVScope.cpp @@ -503,7 +503,7 @@ // Encode the arguments as part of the template name and update the // template name, to reflect the encoded parameters. encodeTemplateArguments(EncodedArgs, &Params); - setEncodedArgs(EncodedArgs.c_str()); + setEncodedArgs(EncodedArgs); } } } @@ -1970,7 +1970,7 @@ Name.append(")"); // Update the scope name, to reflect the encoded parameters. - setName(Name.c_str()); + setName(Name); } //===----------------------------------------------------------------------===// Index: llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp =================================================================== --- llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp +++ llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp @@ -404,7 +404,7 @@ std::string Buffer; raw_string_ostream Stream(Buffer); StringRef AnnotationsStr = Annotations.str(); - MIP.get()->printInst(&Instruction, Address, AnnotationsStr, *STI, Stream); + MIP->printInst(&Instruction, Address, AnnotationsStr, *STI, Stream); LLVM_DEBUG({ std::string BufferCodes; raw_string_ostream StreamCodes(BufferCodes); Index: llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp =================================================================== --- llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp +++ llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp @@ -348,7 +348,7 @@ SecName.str().c_str()); assert(FoundSec->get()->CanonicalName == (SegName + "," + SecName).str()); - return *FoundSec->get(); + return **FoundSec; } static Error updateSection(const NewSectionInfo &NewSection, Object &O) { Index: llvm/lib/Target/BPF/BTFDebug.cpp =================================================================== --- llvm/lib/Target/BPF/BTFDebug.cpp +++ llvm/lib/Target/BPF/BTFDebug.cpp @@ -1356,7 +1356,7 @@ OS.emitLabel(LineSym); // Construct the lineinfo. - auto SP = DL.get()->getScope()->getSubprogram(); + auto SP = DL->getScope()->getSubprogram(); constructLineInfo(SP, LineSym, DL.getLine(), DL.getCol()); LineInfoGenerated = true; Index: llvm/tools/dsymutil/BinaryHolder.cpp =================================================================== --- llvm/tools/dsymutil/BinaryHolder.cpp +++ llvm/tools/dsymutil/BinaryHolder.cpp @@ -173,7 +173,7 @@ // Try the cache first. std::lock_guard Lock(MemberCacheMutex); if (MemberCache.count(Key)) - return *MemberCache[Key].get(); + return *MemberCache[Key]; // Create a new ObjectEntry, but don't add it to the cache yet. Loading of // the archive members might fail and we don't want to lock the whole archive Index: llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp =================================================================== --- llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp +++ llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp @@ -365,7 +365,7 @@ void FileAnalysis::printInstruction(const Instr &InstrMeta, raw_ostream &OS) const { - Printer->printInst(&InstrMeta.Instruction, 0, "", *SubtargetInfo.get(), OS); + Printer->printInst(&InstrMeta.Instruction, 0, "", *SubtargetInfo, OS); } Error FileAnalysis::initialiseDisassemblyMembers() { Index: llvm/tools/llvm-cov/CodeCoverage.cpp =================================================================== --- llvm/tools/llvm-cov/CodeCoverage.cpp +++ llvm/tools/llvm-cov/CodeCoverage.cpp @@ -1075,7 +1075,7 @@ FilenameFunctionMap; for (const auto &SourceFile : SourceFiles) for (const auto &Function : Coverage->getCoveredFunctions(SourceFile)) - if (Filters.matches(*Coverage.get(), Function)) + if (Filters.matches(*Coverage, Function)) FilenameFunctionMap[SourceFile].push_back(&Function); // Only print filter matching functions for each file. @@ -1164,7 +1164,7 @@ if (!Coverage) return 1; - CoverageReport Report(ViewOpts, *Coverage.get()); + CoverageReport Report(ViewOpts, *Coverage); if (!ShowFunctionSummaries) { if (SourceFiles.empty()) Report.renderFileReports(llvm::outs(), IgnoreFilenameFilters); @@ -1230,16 +1230,16 @@ switch (ViewOpts.Format) { case CoverageViewOptions::OutputFormat::Text: - Exporter = std::make_unique(*Coverage.get(), - ViewOpts, outs()); + Exporter = + std::make_unique(*Coverage, ViewOpts, outs()); break; case CoverageViewOptions::OutputFormat::HTML: // Unreachable because we should have gracefully terminated with an error // above. llvm_unreachable("Export in HTML is not supported!"); case CoverageViewOptions::OutputFormat::Lcov: - Exporter = std::make_unique(*Coverage.get(), - ViewOpts, outs()); + Exporter = + std::make_unique(*Coverage, ViewOpts, outs()); break; } Index: llvm/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/ELFDumper.cpp +++ llvm/tools/llvm-readobj/ELFDumper.cpp @@ -6964,7 +6964,7 @@ W.printFlags("Flags", D.Flags, makeArrayRef(SymVersionFlags)); W.printNumber("Index", D.Ndx); W.printNumber("Hash", D.Hash); - W.printString("Name", D.Name.c_str()); + W.printString("Name", D.Name); W.printList( "Predecessors", D.AuxV, [](raw_ostream &OS, const VerdAux &Aux) { OS << Aux.Name.c_str(); }); @@ -6988,7 +6988,7 @@ DictScope Entry(W, "Dependency"); W.printNumber("Version", VN.Version); W.printNumber("Count", VN.Cnt); - W.printString("FileName", VN.File.c_str()); + W.printString("FileName", VN.File); ListScope L(W, "Entries"); for (const VernAux &Aux : VN.AuxV) { @@ -6996,7 +6996,7 @@ W.printNumber("Hash", Aux.Hash); W.printFlags("Flags", Aux.Flags, makeArrayRef(SymVersionFlags)); W.printNumber("Index", Aux.Other); - W.printString("Name", Aux.Name.c_str()); + W.printString("Name", Aux.Name); } } } Index: llvm/tools/obj2yaml/elf2yaml.cpp =================================================================== --- llvm/tools/obj2yaml/elf2yaml.cpp +++ llvm/tools/obj2yaml/elf2yaml.cpp @@ -402,10 +402,10 @@ } llvm::erase_if(Chunks, [this, &Y](const std::unique_ptr &C) { - if (isa(*C.get())) + if (isa(*C)) return false; - const ELFYAML::Section &S = cast(*C.get()); + const ELFYAML::Section &S = cast(*C); return !shouldPrintSection(S, Sections[S.OriginalSecNdx], Y->DWARF); }); @@ -495,7 +495,7 @@ // It is not possible to have a non-Section chunk, because // obj2yaml does not create Fill chunks. for (const std::unique_ptr &C : Chunks) { - ELFYAML::Section &S = cast(*C.get()); + ELFYAML::Section &S = cast(*C); if (isInSegment(S, Sections[S.OriginalSecNdx], Phdr)) { if (!PH.FirstSec) PH.FirstSec = S.Name; @@ -530,13 +530,13 @@ cantFail(std::move(Err)); if (RawSec->Name == ".debug_aranges") - Err = dumpDebugARanges(*DWARFCtx.get(), DWARF); + Err = dumpDebugARanges(*DWARFCtx, DWARF); else if (RawSec->Name == ".debug_str") - Err = dumpDebugStrings(*DWARFCtx.get(), DWARF); + Err = dumpDebugStrings(*DWARFCtx, DWARF); else if (RawSec->Name == ".debug_ranges") - Err = dumpDebugRanges(*DWARFCtx.get(), DWARF); + Err = dumpDebugRanges(*DWARFCtx, DWARF); else if (RawSec->Name == ".debug_addr") - Err = dumpDebugAddr(*DWARFCtx.get(), DWARF); + Err = dumpDebugAddr(*DWARFCtx, DWARF); else continue; Index: llvm/tools/obj2yaml/macho2yaml.cpp =================================================================== --- llvm/tools/obj2yaml/macho2yaml.cpp +++ llvm/tools/obj2yaml/macho2yaml.cpp @@ -192,7 +192,7 @@ if (SecName.startswith("__debug_")) { // If the DWARF section cannot be successfully parsed, emit raw content // instead of an entry in the DWARF section of the YAML. - if (Error Err = dumpDebugSection(SecName, *DWARFCtx.get(), Y.DWARF)) + if (Error Err = dumpDebugSection(SecName, *DWARFCtx, Y.DWARF)) consumeError(std::move(Err)); else S->content.reset(); @@ -326,8 +326,7 @@ if (Obj.isLittleEndian() != sys::IsLittleEndianHost) MachO::swapStruct(LC.Data.load_command_data); if (Expected ExpectedEndPtr = - processLoadCommandData(LC, LoadCmd, - *Y.get())) + processLoadCommandData(LC, LoadCmd, *Y)) EndPtr = *ExpectedEndPtr; else return ExpectedEndPtr.takeError(); Index: llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp =================================================================== --- llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp +++ llvm/unittests/DebugInfo/DWARF/DWARFExpressionCopyBytesTest.cpp @@ -101,7 +101,7 @@ Res.Ctx = std::make_unique(Triple(TripleName), MAI.get(), MRI.get(), /*MSTI=*/nullptr); - Res.MOFI.reset(TheTarget->createMCObjectFileInfo(*Res.Ctx.get(), + Res.MOFI.reset(TheTarget->createMCObjectFileInfo(*Res.Ctx, /*PIC=*/false)); Res.Ctx->setObjectFileInfo(Res.MOFI.get()); Index: llvm/unittests/InterfaceStub/ELFYAMLTest.cpp =================================================================== --- llvm/unittests/InterfaceStub/ELFYAMLTest.cpp +++ llvm/unittests/InterfaceStub/ELFYAMLTest.cpp @@ -221,7 +221,7 @@ raw_string_ostream OS(Result); ASSERT_THAT_ERROR(writeIFSToOutputStream(OS, Moved), Succeeded()); Result = OS.str(); - compareByLine(Result.c_str(), Expected); + compareByLine(Result, Expected); } TEST(ElfYamlTextAPI, YAMLWritesNoTBESyms) { @@ -251,5 +251,5 @@ raw_string_ostream OS(Result); ASSERT_THAT_ERROR(writeIFSToOutputStream(OS, Stub), Succeeded()); Result = OS.str(); - compareByLine(Result.c_str(), Expected); + compareByLine(Result, Expected); } Index: llvm/unittests/MC/DwarfLineTableHeaders.cpp =================================================================== --- llvm/unittests/MC/DwarfLineTableHeaders.cpp +++ llvm/unittests/MC/DwarfLineTableHeaders.cpp @@ -72,7 +72,7 @@ Res.Ctx = std::make_unique(Triple(TripleName), MAI.get(), MRI.get(), /*MSTI=*/nullptr); - Res.MOFI.reset(TheTarget->createMCObjectFileInfo(*Res.Ctx.get(), + Res.MOFI.reset(TheTarget->createMCObjectFileInfo(*Res.Ctx, /*PIC=*/false)); Res.Ctx->setObjectFileInfo(Res.MOFI.get()); Index: llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp =================================================================== --- llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp +++ llvm/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp @@ -28,7 +28,7 @@ void *Ptr = (void*)(intptr_t)TestA; std::string Path = fs::getMainExecutable(Argv0, Ptr); llvm::SmallString<256> Buf(path::parent_path(Path)); - path::append(Buf, (Name + LLVM_PLUGIN_EXT).c_str()); + path::append(Buf, Name + LLVM_PLUGIN_EXT); return std::string(Buf.str()); }