Index: clang-tools-extra/modularize/ModuleAssistant.cpp =================================================================== --- clang-tools-extra/modularize/ModuleAssistant.cpp +++ clang-tools-extra/modularize/ModuleAssistant.cpp @@ -305,7 +305,7 @@ loadModuleDescriptions( RootModuleName, HeaderFileNames, ProblemFileNames, Dependencies, HeaderPrefix)); - if (!RootModule.get()) + if (!RootModule) return false; // Write module map file. Index: clang/lib/Driver/OffloadBundler.cpp =================================================================== --- clang/lib/Driver/OffloadBundler.cpp +++ clang/lib/Driver/OffloadBundler.cpp @@ -1183,7 +1183,7 @@ assert(FileHandler && "FileHandle creation failed for file in the archive!"); - if (Error ReadErr = FileHandler.get()->ReadHeader(*CodeObjectBuffer)) + if (Error ReadErr = FileHandler->ReadHeader(*CodeObjectBuffer)) return ReadErr; Expected> CurBundleIDOrErr = @@ -1208,8 +1208,7 @@ BundlerConfig)) { std::string BundleData; raw_string_ostream DataStream(BundleData); - if (Error Err = - FileHandler.get()->ReadBundle(DataStream, *CodeObjectBuffer)) + if (Error Err = FileHandler->ReadBundle(DataStream, *CodeObjectBuffer)) return Err; for (auto &CompatibleTarget : CompatibleTargets) { @@ -1248,7 +1247,7 @@ } } - if (Error Err = FileHandler.get()->ReadBundleEnd(*CodeObjectBuffer)) + if (Error Err = FileHandler->ReadBundleEnd(*CodeObjectBuffer)) return Err; Expected> NextTripleOrErr = Index: clang/lib/Driver/ToolChain.cpp =================================================================== --- clang/lib/Driver/ToolChain.cpp +++ clang/lib/Driver/ToolChain.cpp @@ -150,9 +150,9 @@ } const XRayArgs& ToolChain::getXRayArgs() const { - if (!XRayArguments.get()) + if (!XRayArguments) XRayArguments.reset(new XRayArgs(*this, Args)); - return *XRayArguments.get(); + return *XRayArguments; } namespace { Index: lld/ELF/Writer.cpp =================================================================== --- lld/ELF/Writer.cpp +++ lld/ELF/Writer.cpp @@ -1031,8 +1031,8 @@ // to the start of the .got or .got.plt section. InputSection *sec = in.gotPlt.get(); if (!target->gotBaseSymInGotPlt) - sec = in.mipsGot.get() ? cast(in.mipsGot.get()) - : cast(in.got.get()); + sec = in.mipsGot ? cast(in.mipsGot.get()) + : cast(in.got.get()); ElfSym::globalOffsetTable->section = sec; } Index: lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h =================================================================== --- lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h +++ lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h @@ -15,7 +15,6 @@ #include "lldb/lldb-public.h" #include -#include namespace lldb_private { Index: lldb/include/lldb/Host/Editline.h =================================================================== --- lldb/include/lldb/Host/Editline.h +++ lldb/include/lldb/Host/Editline.h @@ -47,7 +47,6 @@ #include #include #include -#include #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Utility/CompletionRequest.h" Index: lldb/include/lldb/Target/Process.h =================================================================== --- lldb/include/lldb/Target/Process.h +++ lldb/include/lldb/Target/Process.h @@ -2695,7 +2695,7 @@ }; void SetNextEventAction(Process::NextEventAction *next_event_action) { - if (m_next_event_action_up.get()) + if (m_next_event_action_up) m_next_event_action_up->HandleBeingUnshipped(); m_next_event_action_up.reset(next_event_action); Index: lldb/source/API/SBCommandReturnObject.cpp =================================================================== --- lldb/source/API/SBCommandReturnObject.cpp +++ lldb/source/API/SBCommandReturnObject.cpp @@ -292,7 +292,7 @@ return; } else if (len > 0) { std::string buffer(string, len); - ref().AppendMessage(buffer.c_str()); + ref().AppendMessage(buffer); } else ref().AppendMessage(string); } Index: lldb/source/API/SBExpressionOptions.cpp =================================================================== --- lldb/source/API/SBExpressionOptions.cpp +++ lldb/source/API/SBExpressionOptions.cpp @@ -254,5 +254,5 @@ } EvaluateExpressionOptions &SBExpressionOptions::ref() const { - return *(m_opaque_up.get()); + return *(m_opaque_up); } Index: lldb/source/API/SBInstruction.cpp =================================================================== --- lldb/source/API/SBInstruction.cpp +++ lldb/source/API/SBInstruction.cpp @@ -13,7 +13,6 @@ #include "lldb/API/SBFrame.h" #include "lldb/API/SBFile.h" -#include "lldb/API/SBInstruction.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBTarget.h" #include "lldb/Core/Disassembler.h" Index: lldb/source/API/SBPlatform.cpp =================================================================== --- lldb/source/API/SBPlatform.cpp +++ lldb/source/API/SBPlatform.cpp @@ -11,7 +11,6 @@ #include "lldb/API/SBError.h" #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBLaunchInfo.h" -#include "lldb/API/SBPlatform.h" #include "lldb/API/SBUnixSignals.h" #include "lldb/Host/File.h" #include "lldb/Target/Platform.h" Index: lldb/source/API/SBSourceManager.cpp =================================================================== --- lldb/source/API/SBSourceManager.cpp +++ lldb/source/API/SBSourceManager.cpp @@ -88,14 +88,14 @@ if (&rhs == this) return; - m_opaque_up = std::make_unique(*(rhs.m_opaque_up.get())); + m_opaque_up = std::make_unique(*(rhs.m_opaque_up)); } const lldb::SBSourceManager &SBSourceManager:: operator=(const lldb::SBSourceManager &rhs) { LLDB_INSTRUMENT_VA(this, rhs); - m_opaque_up = std::make_unique(*(rhs.m_opaque_up.get())); + m_opaque_up = std::make_unique(*(rhs.m_opaque_up)); return *this; } Index: lldb/source/Breakpoint/BreakpointResolverScripted.cpp =================================================================== --- lldb/source/Breakpoint/BreakpointResolverScripted.cpp +++ lldb/source/Breakpoint/BreakpointResolverScripted.cpp @@ -139,7 +139,7 @@ short_help); } if (!short_help.empty()) - s->PutCString(short_help.c_str()); + s->PutCString(short_help); else s->Printf("python class = %s", m_class_name.c_str()); } Index: lldb/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -130,10 +130,10 @@ m_bp_opts.SetThreadID(thread_id); } break; case 'T': - m_bp_opts.GetThreadSpec()->SetName(option_arg.str().c_str()); + m_bp_opts.GetThreadSpec()->SetName(option_arg.str()); break; case 'q': - m_bp_opts.GetThreadSpec()->SetQueueName(option_arg.str().c_str()); + m_bp_opts.GetThreadSpec()->SetQueueName(option_arg.str()); break; case 'x': { uint32_t thread_index = UINT32_MAX; Index: lldb/source/Commands/CommandObjectExpression.cpp =================================================================== --- lldb/source/Commands/CommandObjectExpression.cpp +++ lldb/source/Commands/CommandObjectExpression.cpp @@ -477,7 +477,7 @@ CommandReturnObject return_obj( GetCommandInterpreter().GetDebugger().GetUseColor()); - EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj); + EvaluateExpression(line, *output_sp, *error_sp, return_obj); if (output_sp) output_sp->Flush(); if (error_sp) Index: lldb/source/Commands/CommandObjectHelp.cpp =================================================================== --- lldb/source/Commands/CommandObjectHelp.cpp +++ lldb/source/Commands/CommandObjectHelp.cpp @@ -145,15 +145,15 @@ return false; } else if (!sub_cmd_obj) { StreamString error_msg_stream; - GenerateAdditionalHelpAvenuesMessage( - &error_msg_stream, cmd_string.c_str(), - m_interpreter.GetCommandPrefix(), sub_command.c_str()); + GenerateAdditionalHelpAvenuesMessage(&error_msg_stream, cmd_string, + m_interpreter.GetCommandPrefix(), + sub_command); result.AppendError(error_msg_stream.GetString()); return false; } else { GenerateAdditionalHelpAvenuesMessage( - &result.GetOutputStream(), cmd_string.c_str(), - m_interpreter.GetCommandPrefix(), sub_command.c_str()); + &result.GetOutputStream(), cmd_string, + m_interpreter.GetCommandPrefix(), sub_command); result.GetOutputStream().Printf( "\nThe closest match is '%s'. Help on it follows.\n\n", sub_cmd_obj->GetCommandName().str().c_str()); Index: lldb/source/Commands/CommandObjectMultiword.cpp =================================================================== --- lldb/source/Commands/CommandObjectMultiword.cpp +++ lldb/source/Commands/CommandObjectMultiword.cpp @@ -217,7 +217,7 @@ } } error_msg.append("\n"); - result.AppendRawError(error_msg.c_str()); + result.AppendRawError(error_msg); return false; } Index: lldb/source/Commands/CommandObjectTarget.cpp =================================================================== --- lldb/source/Commands/CommandObjectTarget.cpp +++ lldb/source/Commands/CommandObjectTarget.cpp @@ -390,7 +390,7 @@ module_sp->SetSymbolFileFileSpec(symfile); if (remote_file) { std::string remote_path = remote_file.GetPath(); - target_sp->SetArg0(remote_path.c_str()); + target_sp->SetArg0(remote_path); module_sp->SetPlatformFileSpec(remote_file); } } Index: lldb/source/Commands/CommandObjectThread.cpp =================================================================== --- lldb/source/Commands/CommandObjectThread.cpp +++ lldb/source/Commands/CommandObjectThread.cpp @@ -1710,7 +1710,7 @@ } if (!warnings.empty()) - result.AppendWarning(warnings.c_str()); + result.AppendWarning(warnings); } result.SetStatus(eReturnStatusSuccessFinishResult); Index: lldb/source/Core/Disassembler.cpp =================================================================== --- lldb/source/Core/Disassembler.cpp +++ lldb/source/Core/Disassembler.cpp @@ -1129,7 +1129,7 @@ thumb_arch_name.erase(0, 3); thumb_arch_name.insert(0, "thumb"); } - m_arch.SetTriple(thumb_arch_name.c_str()); + m_arch.SetTriple(thumb_arch_name); } } Index: lldb/source/Core/FormatEntity.cpp =================================================================== --- lldb/source/Core/FormatEntity.cpp +++ lldb/source/Core/FormatEntity.cpp @@ -629,9 +629,9 @@ ValueObject::ExpressionPathAftermath what_next = (deref_pointer ? ValueObject::eExpressionPathAftermathDereference : ValueObject::eExpressionPathAftermathNothing); - ValueObjectSP item = valobj->GetValueForExpressionPath( - ptr_deref_buffer.c_str(), &reason_to_stop, &final_value_type, options, - &what_next); + ValueObjectSP item = + valobj->GetValueForExpressionPath(ptr_deref_buffer, &reason_to_stop, + &final_value_type, options, &what_next); if (!item) { LLDB_LOGF(log, "[ExpandIndexedExpression] ERROR: why stopping = %d," @@ -765,7 +765,7 @@ target = valobj - ->GetValueForExpressionPath(expr_path.c_str(), &reason_to_stop, + ->GetValueForExpressionPath(expr_path, &reason_to_stop, &final_value_type, options, &what_next) .get(); Index: lldb/source/Core/IOHandlerCursesGUI.cpp =================================================================== --- lldb/source/Core/IOHandlerCursesGUI.cpp +++ lldb/source/Core/IOHandlerCursesGUI.cpp @@ -3838,7 +3838,7 @@ void UpdateMatches(const std::string &text) override { CompletionResult result; - CompletionRequest request(text.c_str(), text.size(), result); + CompletionRequest request(text, text.size(), result); CommandCompletions::InvokeCommonCompletionCallbacks( m_debugger.GetCommandInterpreter(), m_completion_mask, request, nullptr); Index: lldb/source/Core/ValueObject.cpp =================================================================== --- lldb/source/Core/ValueObject.cpp +++ lldb/source/Core/ValueObject.cpp @@ -62,8 +62,6 @@ #include #include -#include - namespace lldb_private { class ExecutionContextScope; } Index: lldb/source/Expression/REPL.cpp =================================================================== --- lldb/source/Expression/REPL.cpp +++ lldb/source/Expression/REPL.cpp @@ -336,10 +336,9 @@ const char *expr_prefix = nullptr; lldb::ValueObjectSP result_valobj_sp; Status error; - lldb::ExpressionResults execution_results = - UserExpression::Evaluate(exe_ctx, expr_options, code.c_str(), - expr_prefix, result_valobj_sp, error, - nullptr); // fixed expression + lldb::ExpressionResults execution_results = UserExpression::Evaluate( + exe_ctx, expr_options, code, expr_prefix, result_valobj_sp, error, + nullptr); // fixed expression // CommandInterpreter &ci = debugger.GetCommandInterpreter(); Index: lldb/source/Host/common/ProcessLaunchInfo.cpp =================================================================== --- lldb/source/Host/common/ProcessLaunchInfo.cpp +++ lldb/source/Host/common/ProcessLaunchInfo.cpp @@ -20,10 +20,6 @@ #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/FileSystem.h" -#if !defined(_WIN32) -#include -#endif - using namespace lldb; using namespace lldb_private; Index: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp =================================================================== --- lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp +++ lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp @@ -41,7 +41,6 @@ #include "llvm/ADT/SmallVector.h" #endif #include "lldb/Host/Host.h" -#include "lldb/Host/Socket.h" #include "lldb/Host/common/TCPSocket.h" #include "lldb/Host/common/UDPSocket.h" #include "lldb/Utility/Log.h" Index: lldb/source/Interpreter/CommandInterpreter.cpp =================================================================== --- lldb/source/Interpreter/CommandInterpreter.cpp +++ lldb/source/Interpreter/CommandInterpreter.cpp @@ -1501,8 +1501,7 @@ else if (cmd_obj->IsMultiwordObject()) { // Our current object is a multi-word object; see if the cmd_word is a // valid sub-command for our object. - CommandObject *sub_cmd_obj = - cmd_obj->GetSubcommandObject(cmd_word.c_str()); + CommandObject *sub_cmd_obj = cmd_obj->GetSubcommandObject(cmd_word); if (sub_cmd_obj) cmd_obj = sub_cmd_obj; else // cmd_word was not a valid sub-command word, so we are done @@ -1766,9 +1765,8 @@ options.SetTryAllThreads(true); options.SetTimeout(std::nullopt); - ExpressionResults expr_result = - target.EvaluateExpression(expr_str.c_str(), exe_ctx.GetFramePtr(), - expr_result_valobj_sp, options); + ExpressionResults expr_result = target.EvaluateExpression( + expr_str, exe_ctx.GetFramePtr(), expr_result_valobj_sp, options); if (expr_result == eExpressionCompleted) { Scalar scalar; @@ -3410,8 +3408,7 @@ } } else { if (cmd_obj->IsMultiwordObject()) { - CommandObject *sub_cmd_obj = - cmd_obj->GetSubcommandObject(next_word.c_str()); + CommandObject *sub_cmd_obj = cmd_obj->GetSubcommandObject(next_word); if (sub_cmd_obj) { // The subcommand's name includes the parent command's name, so // restart rather than append to the revised_command_line. Index: lldb/source/Interpreter/CommandObject.cpp =================================================================== --- lldb/source/Interpreter/CommandObject.cpp +++ lldb/source/Interpreter/CommandObject.cpp @@ -32,7 +32,6 @@ #include "lldb/Target/Language.h" #include "lldb/Interpreter/CommandInterpreter.h" -#include "lldb/Interpreter/CommandOptionArgumentTable.h" #include "lldb/Interpreter/CommandReturnObject.h" using namespace lldb; Index: lldb/source/Interpreter/OptionArgParser.cpp =================================================================== --- lldb/source/Interpreter/OptionArgParser.cpp +++ lldb/source/Interpreter/OptionArgParser.cpp @@ -222,7 +222,7 @@ std::string str_offset = matches[3].str(); if (!llvm::StringRef(str_offset).getAsInteger(0, offset)) { Status error; - addr = ToAddress(exe_ctx, name.c_str(), LLDB_INVALID_ADDRESS, &error); + addr = ToAddress(exe_ctx, name, LLDB_INVALID_ADDRESS, &error); if (addr != LLDB_INVALID_ADDRESS) { if (sign[0] == '+') return addr + offset; Index: lldb/source/Interpreter/OptionValueArch.cpp =================================================================== --- lldb/source/Interpreter/OptionValueArch.cpp +++ lldb/source/Interpreter/OptionValueArch.cpp @@ -45,7 +45,7 @@ case eVarSetOperationReplace: case eVarSetOperationAssign: { std::string value_str = value.trim().str(); - if (m_current_value.SetTriple(value_str.c_str())) { + if (m_current_value.SetTriple(value_str)) { m_value_was_set = true; NotifyValueChanged(); } else Index: lldb/source/Interpreter/ScriptInterpreter.cpp =================================================================== --- lldb/source/Interpreter/ScriptInterpreter.cpp +++ lldb/source/Interpreter/ScriptInterpreter.cpp @@ -82,7 +82,7 @@ Status ScriptInterpreter::GetStatusFromSBError(const lldb::SBError &error) const { if (error.m_opaque_up) - return *error.m_opaque_up.get(); + return *error.m_opaque_up; return Status(); } Index: lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -644,7 +644,7 @@ if (m_load_address == LLDB_INVALID_ADDRESS) return false; - FileSpec file_spec(m_name.c_str()); + FileSpec file_spec(m_name); llvm::MachO::mach_header mh; size_t size_to_read = 512; @@ -785,7 +785,7 @@ PlatformDarwinKernel::GetPluginNameStatic()); if (platform_sp->GetPluginName() == g_platform_name.GetStringRef()) { ModuleSpec kext_bundle_module_spec(module_spec); - FileSpec kext_filespec(m_name.c_str()); + FileSpec kext_filespec(m_name); FileSpecList search_paths = target.GetExecutableSearchPaths(); kext_bundle_module_spec.GetFileSpec() = kext_filespec; platform_sp->GetSharedModule(kext_bundle_module_spec, process, Index: lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp =================================================================== --- lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp @@ -15,8 +15,6 @@ #include "lldb/Utility/Status.h" #include "lldb/Symbol/ObjectFile.h" -#include "lldb/Target/Process.h" -#include "lldb/Target/Target.h" #include "HexagonDYLDRendezvous.h" Index: lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -56,10 +56,8 @@ #include "ASTUtils.h" #include "ClangASTSource.h" -#include "ClangDiagnostic.h" #include "ClangExpressionDeclMap.h" #include "ClangExpressionHelper.h" -#include "ClangExpressionParser.h" #include "ClangHost.h" #include "ClangModulesDeclVendor.h" #include "ClangPersistentVariables.h" Index: lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp @@ -116,7 +116,7 @@ ClangPersistentVariables::GetClangModulesDeclVendor() { if (!m_modules_decl_vendor_sp) { m_modules_decl_vendor_sp.reset( - ClangModulesDeclVendor::Create(*m_target_sp.get())); + ClangModulesDeclVendor::Create(*m_target_sp)); } return m_modules_decl_vendor_sp; } Index: lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp =================================================================== --- lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp +++ lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp @@ -117,7 +117,7 @@ // will crash in clang. clang::OverloadedOperatorKind op_kind = clang::NUM_OVERLOADED_OPERATORS; if (func_proto_type && - TypeSystemClang::IsOperator(decl_name.getAsString().c_str(), op_kind)) { + TypeSystemClang::IsOperator(decl_name.getAsString(), op_kind)) { if (!TypeSystemClang::CheckOverloadedOperatorKindParameterCount( false, op_kind, func_proto_type->getNumParams())) return nullptr; Index: lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp +++ lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp @@ -211,7 +211,7 @@ const std::string &trace_item_name = ".trace") { auto trace_sp = std::make_shared(); ValueObjectSP trace_value_object = - o->GetValueForExpressionPath(trace_item_name.c_str()); + o->GetValueForExpressionPath(trace_item_name); size_t count = trace_value_object->GetNumChildren(); for (size_t j = 0; j < count; j++) { addr_t trace_addr = @@ -230,11 +230,10 @@ const StructuredData::DictionarySP &dict)> const &callback) { auto array_sp = std::make_shared(); - unsigned int count = - return_value_sp->GetValueForExpressionPath(count_name.c_str()) - ->GetValueAsUnsigned(0); + unsigned int count = return_value_sp->GetValueForExpressionPath(count_name) + ->GetValueAsUnsigned(0); ValueObjectSP objects = - return_value_sp->GetValueForExpressionPath(items_name.c_str()); + return_value_sp->GetValueForExpressionPath(items_name); for (unsigned int i = 0; i < count; i++) { ValueObjectSP o = objects->GetChildAtIndex(i, true); auto dict_sp = std::make_shared(); @@ -249,9 +248,8 @@ static std::string RetrieveString(ValueObjectSP return_value_sp, ProcessSP process_sp, const std::string &expression_path) { - addr_t ptr = - return_value_sp->GetValueForExpressionPath(expression_path.c_str()) - ->GetValueAsUnsigned(0); + addr_t ptr = return_value_sp->GetValueForExpressionPath(expression_path) + ->GetValueAsUnsigned(0); std::string str; Status error; process_sp->ReadCStringFromMemory(ptr, str, error); Index: lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp =================================================================== --- lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp +++ lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp @@ -88,7 +88,7 @@ static addr_t RetrieveUnsigned(ValueObjectSP return_value_sp, ProcessSP process_sp, const std::string &expression_path) { - return return_value_sp->GetValueForExpressionPath(expression_path.c_str()) + return return_value_sp->GetValueForExpressionPath(expression_path) ->GetValueAsUnsigned(0); } Index: lldb/source/Plugins/Language/ObjC/Cocoa.cpp =================================================================== --- lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -381,12 +381,12 @@ } } - stream.PutCString(prefix.c_str()); + stream.PutCString(prefix); const int radix = 10; const bool isSigned = true; std::string str = llvm::toString(value, radix, isSigned); - stream.PutCString(str.c_str()); - stream.PutCString(suffix.c_str()); + stream.PutCString(str); + stream.PutCString(suffix); } static void NSNumber_FormatFloat(ValueObject &valobj, Stream &stream, Index: lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp =================================================================== --- lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp +++ lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp @@ -101,9 +101,8 @@ std::string trace_path = "." + std::string(type) + "_trace"; ValueObjectSP count_sp = - return_value_sp->GetValueForExpressionPath(count_path.c_str()); - ValueObjectSP tid_sp = - return_value_sp->GetValueForExpressionPath(tid_path.c_str()); + return_value_sp->GetValueForExpressionPath(count_path); + ValueObjectSP tid_sp = return_value_sp->GetValueForExpressionPath(tid_path); if (!count_sp || !tid_sp) return; @@ -115,7 +114,7 @@ return; ValueObjectSP trace_sp = - return_value_sp->GetValueForExpressionPath(trace_path.c_str()); + return_value_sp->GetValueForExpressionPath(trace_path); if (!trace_sp) return; Index: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp =================================================================== --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -59,7 +59,6 @@ #include #include #include -#include #endif #ifndef __APPLE__ @@ -7037,7 +7036,7 @@ if (image.uuid.IsValid()) module_spec.GetUUID() = image.uuid; if (!image.filename.empty()) - module_spec.GetFileSpec() = FileSpec(image.filename.c_str()); + module_spec.GetFileSpec() = FileSpec(image.filename); module_sp = process.GetTarget().GetOrCreateModule(module_spec, false, &error); process.GetTarget().GetImages().AppendIfNeeded(module_sp, Index: lldb/source/Plugins/Platform/Android/AdbClient.cpp =================================================================== --- lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -134,7 +134,7 @@ port = env_port; } std::string uri = "connect://127.0.0.1:" + port; - m_conn->Connect(uri.c_str(), &error); + m_conn->Connect(uri, &error); return error; } @@ -304,8 +304,7 @@ std::vector error_message; auto error = ReadMessage(error_message); if (error.Success()) - error.SetErrorString( - std::string(&error_message[0], error_message.size()).c_str()); + error.SetErrorString(std::string(&error_message[0], error_message.size())); return error; } Index: lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp =================================================================== --- lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -95,8 +95,8 @@ if (gdbstub_port) local_port = std::stoi(gdbstub_port); - auto error = MakeConnectURL(pid, local_port, remote_port, socket_name.c_str(), - connect_url); + auto error = + MakeConnectURL(pid, local_port, remote_port, socket_name, connect_url); if (error.Success() && log) LLDB_LOGF(log, "gdbserver connect URL: %s", connect_url.c_str()); Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp @@ -86,7 +86,7 @@ llvm::StringRef dirname = GetDeviceSupportDirectoryName(); std::string local_sdk_cache_str = "~/Library/Developer/Xcode/"; local_sdk_cache_str += std::string(dirname); - FileSpec local_sdk_cache(local_sdk_cache_str.c_str()); + FileSpec local_sdk_cache(local_sdk_cache_str); FileSystem::Instance().Resolve(local_sdk_cache); if (FileSystem::Instance().Exists(local_sdk_cache)) { if (log) { @@ -231,7 +231,7 @@ if (m_device_support_directory.empty()) { if (FileSpec fspec = HostInfo::GetXcodeDeveloperDirectory()) { m_device_support_directory = fspec.GetPath(); - m_device_support_directory.append(platform_dir.c_str()); + m_device_support_directory.append(platform_dir); } else { // Assign a single NULL character so we know we tried to find the device // support directory and we don't keep trying to find it over and over. Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -411,7 +411,7 @@ const bool find_files = false; const bool find_other = false; FileSystem::Instance().EnumerateDirectory( - dir.c_str(), find_directories, find_files, find_other, + dir, find_directories, find_files, find_other, FindKDKandSDKDirectoriesInDirectory, this); } @@ -442,7 +442,7 @@ const bool find_files = true; const bool find_other = true; // I think eFileTypeSymbolicLink are "other"s. FileSystem::Instance().EnumerateDirectory( - dir.GetPath().c_str(), find_directories, find_files, find_other, + dir.GetPath(), find_directories, find_files, find_other, GetKernelsAndKextsInDirectoryWithRecursion, this); } const uint32_t num_dirs_no_recurse = m_search_directories_no_recursing.size(); @@ -452,7 +452,7 @@ const bool find_files = true; const bool find_other = true; // I think eFileTypeSymbolicLink are "other"s. FileSystem::Instance().EnumerateDirectory( - dir.GetPath().c_str(), find_directories, find_files, find_other, + dir.GetPath(), find_directories, find_files, find_other, GetKernelsAndKextsInDirectoryNoRecursion, this); } } @@ -545,7 +545,7 @@ const bool find_files = false; const bool find_other = false; FileSystem::Instance().EnumerateDirectory( - search_here_too.c_str(), find_directories, find_files, find_other, + search_here_too, find_directories, find_files, find_other, recurse ? GetKernelsAndKextsInDirectoryWithRecursion : GetKernelsAndKextsInDirectoryNoRecursion, baton); @@ -874,8 +874,7 @@ PlatformDarwinKernel::SearchForExecutablesRecursively(const std::string &dir) { std::vector executables; std::error_code EC; - for (llvm::sys::fs::recursive_directory_iterator it(dir.c_str(), EC), - end; + for (llvm::sys::fs::recursive_directory_iterator it(dir, EC), end; it != end && !EC; it.increment(EC)) { auto status = it->status(); if (!status) Index: lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h =================================================================== --- lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h +++ lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h @@ -60,7 +60,7 @@ unsigned int GetVersionAtIndex(size_t idx) const { return m_versions[idx]; } - std::string GetFamily() const { return m_family.c_str(); } + std::string GetFamily() const { return m_family; } private: std::string m_family; Index: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp =================================================================== --- lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -87,7 +87,7 @@ } if (!m_platform_description.empty()) - return m_platform_description.c_str(); + return m_platform_description; return GetDescriptionStatic(); } @@ -423,10 +423,10 @@ if (process_sp) { process_sp->HijackProcessEvents(launch_info.GetHijackListener()); - error = process_sp->ConnectRemote(connect_url.c_str()); + error = process_sp->ConnectRemote(connect_url); // Retry the connect remote one time... if (error.Fail()) - error = process_sp->ConnectRemote(connect_url.c_str()); + error = process_sp->ConnectRemote(connect_url); if (error.Success()) error = process_sp->Launch(launch_info); else if (debugserver_pid != LLDB_INVALID_PROCESS_ID) { @@ -509,7 +509,7 @@ target->CreateProcess(attach_info.GetListenerForProcess(debugger), "gdb-remote", nullptr, true); if (process_sp) { - error = process_sp->ConnectRemote(connect_url.c_str()); + error = process_sp->ConnectRemote(connect_url); if (error.Success()) { ListenerSP listener_sp = attach_info.GetHijackListener(); if (listener_sp) @@ -794,7 +794,7 @@ GetPendingGdbServerList(connection_urls); for (size_t i = 0; i < connection_urls.size(); ++i) { - ConnectProcess(connection_urls[i].c_str(), "gdb-remote", debugger, nullptr, error); + ConnectProcess(connection_urls[i], "gdb-remote", debugger, nullptr, error); if (error.Fail()) return i; // We already connected to i process successfully } Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -869,7 +869,7 @@ if (connection) { // Do the listen on another thread so we can continue on... if (connection->Connect( - m_listen_url.c_str(), + m_listen_url, [this](llvm::StringRef port_str) { uint16_t port = 0; llvm::to_integer(port_str, port, 10); Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1320,7 +1320,7 @@ else triple += os_name; } - m_host_arch.SetTriple(triple.c_str()); + m_host_arch.SetTriple(triple); llvm::Triple &host_triple = m_host_arch.GetTriple(); if (host_triple.getVendor() == llvm::Triple::Apple && @@ -1345,7 +1345,7 @@ } } } else { - m_host_arch.SetTriple(triple.c_str()); + m_host_arch.SetTriple(triple); if (pointer_byte_size) { assert(pointer_byte_size == m_host_arch.GetAddressByteSize()); } @@ -1602,7 +1602,7 @@ std::string error_string; // Now convert the HEX bytes into a string value error_extractor.GetHexByteString(error_string); - error.SetErrorString(error_string.c_str()); + error.SetErrorString(error_string); } else if (name.equals("dirty-pages")) { std::vector dirty_page_list; for (llvm::StringRef x : llvm::split(value, ',')) { @@ -2010,7 +2010,7 @@ StringExtractor extractor(value); std::string triple; extractor.GetHexByteString(triple); - process_info.GetArchitecture().SetTriple(triple.c_str()); + process_info.GetArchitecture().SetTriple(triple); } else if (name.equals("name")) { StringExtractor extractor(value); // The process name from ASCII hex bytes since we can't control the @@ -2192,7 +2192,7 @@ // Set the ArchSpec from the triple if we have it. if (!triple.empty()) { - m_process_arch.SetTriple(triple.c_str()); + m_process_arch.SetTriple(triple); m_process_arch.SetFlags(elf_abi); if (pointer_byte_size) { assert(pointer_byte_size == m_process_arch.GetAddressByteSize()); @@ -3792,7 +3792,7 @@ StringExtractor extractor(value); std::string triple; extractor.GetHexByteString(triple); - module_spec.GetArchitecture().SetTriple(triple.c_str()); + module_spec.GetArchitecture().SetTriple(triple); } else if (name == "file_offset") { uint64_t ival = 0; if (!value.getAsInteger(16, ival)) Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -747,9 +747,8 @@ std::string output; FileSpec working_spec(working_dir); FileSystem::Instance().Resolve(working_spec); - Status err = - Host::RunShellCommand(path.c_str(), working_spec, &status, &signo, - &output, std::chrono::seconds(10)); + Status err = Host::RunShellCommand(path, working_spec, &status, &signo, + &output, std::chrono::seconds(10)); StreamGDBRemote response; if (err.Fail()) { response.PutCString("F,"); @@ -1136,8 +1135,7 @@ response.PutChar(';'); response.PutCString("file_path:"); - response.PutStringAsRawHex8( - matched_module_spec.GetFileSpec().GetPath().c_str()); + response.PutStringAsRawHex8(matched_module_spec.GetFileSpec().GetPath()); response.PutChar(';'); response.PutCString("file_offset:"); response.PutHex64(file_offset); @@ -1212,7 +1210,7 @@ proc_info.GetUserID(), proc_info.GetGroupID(), proc_info.GetEffectiveUserID(), proc_info.GetEffectiveGroupID()); response.PutCString("name:"); - response.PutStringAsRawHex8(proc_info.GetExecutableFile().GetPath().c_str()); + response.PutStringAsRawHex8(proc_info.GetExecutableFile().GetPath()); response.PutChar(';'); response.PutCString("args:"); Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -1501,7 +1501,7 @@ FileSpec working_dir{m_process_launch_info.GetWorkingDirectory()}; if (working_dir) { StreamString response; - response.PutStringAsRawHex8(working_dir.GetPath().c_str()); + response.PutStringAsRawHex8(working_dir.GetPath()); return SendPacketNoLock(response.GetString()); } @@ -3197,7 +3197,7 @@ response.Printf(""); for (auto const &library : *library_list) { response.Printf("", library.ld_addr); Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -429,7 +429,7 @@ separator = ","; // encode result strings into hex bytes to avoid unexpected error caused by // special characters like '$'. - response.PutStringAsRawHex8(match.c_str()); + response.PutStringAsRawHex8(match); } return SendPacketNoLock(response.GetString()); @@ -586,8 +586,7 @@ FileSpec socket_path_spec(GetDomainSocketDir()); socket_path_spec.AppendPathComponent(socket_name.c_str()); - llvm::sys::fs::createUniqueFile(socket_path_spec.GetPath().c_str(), - socket_path); + llvm::sys::fs::createUniqueFile(socket_path_spec.GetPath(), socket_path); return FileSpec(socket_path.c_str()); } Index: lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp =================================================================== --- lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp +++ lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp @@ -104,7 +104,7 @@ ExecutionContext exe_ctx(target_sp, /*get_process=*/false); StructuredData::GenericSP object_sp = GetInterface().CreatePluginObject( - m_scripted_process_info.GetClassName().c_str(), exe_ctx, + m_scripted_process_info.GetClassName(), exe_ctx, m_scripted_process_info.GetArgsSP()); if (!object_sp || !object_sp->IsValid()) { Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -459,8 +459,7 @@ ->GetArchitecture() .GetTriple() .getArchName() - .str() - .c_str()); + .str()); comp_unit_info->oso_sp->module_sp = std::make_shared( obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file, oso_arch, oso_object ? &oso_object : nullptr, 0, Index: lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp +++ lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp @@ -1442,7 +1442,7 @@ // TODO: get mangled name for the method. return m_ast.AddMethodToCXXRecordType( - record_type.GetOpaqueQualType(), name.c_str(), + record_type.GetOpaqueQualType(), name, /*mangled_name*/ nullptr, method_comp_type, access, method.isVirtual(), method.isStatic(), method.hasInlineAttribute(), /*is_explicit*/ false, // FIXME: Need this field in CodeView. Index: lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp =================================================================== --- lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -246,7 +246,7 @@ // the full source path remap. if (do_truncate_remapping_names) { FileSpec build_path(key.AsCString()); - FileSpec source_path(DBGSourcePath.c_str()); + FileSpec source_path(DBGSourcePath); build_path.RemoveLastPathComponent(); build_path.RemoveLastPathComponent(); source_path.RemoveLastPathComponent(); Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp =================================================================== --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -77,8 +77,6 @@ #include -#include - using namespace lldb; using namespace lldb_private; using namespace lldb_private::dwarf; Index: lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h =================================================================== --- lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -67,7 +67,7 @@ m_initial_sp(0), m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(), m_pushed_regs(), m_curr_row_modified(false), m_forward_branch_offset(0) { - if (m_inst_emulator_up.get()) { + if (m_inst_emulator_up) { m_inst_emulator_up->SetBaton(this); m_inst_emulator_up->SetCallbacks(ReadMemory, WriteMemory, ReadRegister, WriteRegister); Index: lldb/source/Symbol/LocateSymbolFileMacOSX.cpp =================================================================== --- lldb/source/Symbol/LocateSymbolFileMacOSX.cpp +++ lldb/source/Symbol/LocateSymbolFileMacOSX.cpp @@ -350,7 +350,7 @@ (CFDictionaryRef)uuid_dict, CFSTR("DBGSymbolRichExecutable")); if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) { if (CFCString::FileSystemRepresentation(cf_str, str)) { - module_spec.GetFileSpec().SetFile(str.c_str(), FileSpec::Style::native); + module_spec.GetFileSpec().SetFile(str, FileSpec::Style::native); FileSystem::Instance().Resolve(module_spec.GetFileSpec()); LLDB_LOGF(log, "From dsymForUUID plist: Symbol rich executable is at '%s'", @@ -362,8 +362,7 @@ CFSTR("DBGDSYMPath")); if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) { if (CFCString::FileSystemRepresentation(cf_str, str)) { - module_spec.GetSymbolFileSpec().SetFile(str.c_str(), - FileSpec::Style::native); + module_spec.GetSymbolFileSpec().SetFile(str, FileSpec::Style::native); FileSystem::Instance().Resolve(module_spec.GetFileSpec()); success = true; LLDB_LOGF(log, "From dsymForUUID plist: dSYM is at '%s'", str.c_str()); @@ -434,7 +433,7 @@ DBGSourcePath = original_DBGSourcePath_value; } if (DBGSourcePath[0] == '~') { - FileSpec resolved_source_path(DBGSourcePath.c_str()); + FileSpec resolved_source_path(DBGSourcePath); FileSystem::Instance().Resolve(resolved_source_path); DBGSourcePath = resolved_source_path.GetPath(); } @@ -445,8 +444,8 @@ module_spec.GetSourceMappingList().Append(DBGBuildSourcePath, DBGSourcePath, true); if (do_truncate_remapping_names) { - FileSpec build_path(DBGBuildSourcePath.c_str()); - FileSpec source_path(DBGSourcePath.c_str()); + FileSpec build_path(DBGBuildSourcePath); + FileSpec source_path(DBGSourcePath); build_path.RemoveLastPathComponent(); build_path.RemoveLastPathComponent(); source_path.RemoveLastPathComponent(); @@ -480,7 +479,7 @@ if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) { if (DBGSourcePath[0] == '~') { - FileSpec resolved_source_path(DBGSourcePath.c_str()); + FileSpec resolved_source_path(DBGSourcePath); FileSystem::Instance().Resolve(resolved_source_path); DBGSourcePath = resolved_source_path.GetPath(); } Index: lldb/source/Symbol/SymbolFile.cpp =================================================================== --- lldb/source/Symbol/SymbolFile.cpp +++ lldb/source/Symbol/SymbolFile.cpp @@ -21,6 +21,7 @@ #include "lldb/lldb-private.h" #include +#include using namespace lldb_private; using namespace lldb; @@ -69,7 +70,7 @@ const uint32_t sym_file_abilities = curr_symfile_up->GetAbilities(); if (sym_file_abilities > best_symfile_abilities) { best_symfile_abilities = sym_file_abilities; - best_symfile_up.reset(curr_symfile_up.release()); + best_symfile_up = std::move(curr_symfile_up); // If any symbol file parser has all of the abilities, then we should // just stop looking. if ((kAllAbilities & sym_file_abilities) == kAllAbilities) Index: lldb/source/Target/LanguageRuntime.cpp =================================================================== --- lldb/source/Target/LanguageRuntime.cpp +++ lldb/source/Target/LanguageRuntime.cpp @@ -300,7 +300,7 @@ // and cached because we may create multiple debuggers and need one // instance of the command each - the implementing function is meant to // create a new instance of the command each time it is invoked. - parent->LoadSubCommand(command->GetCommandName().str().c_str(), command); + parent->LoadSubCommand(command->GetCommandName().str(), command); } } } Index: lldb/source/Target/TargetList.cpp =================================================================== --- lldb/source/Target/TargetList.cpp +++ lldb/source/Target/TargetList.cpp @@ -351,7 +351,7 @@ target_sp->SetArg0(resolved_bundle_exe_path); } else { // Use resolved path - target_sp->SetArg0(file.GetPath().c_str()); + target_sp->SetArg0(file.GetPath()); } } if (file.GetDirectory()) { Index: lldb/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1084,7 +1084,7 @@ // queries GetDescription makes, and only assert if you try to run the thread. if (!m_null_plan_stack_up) m_null_plan_stack_up = std::make_unique(*this, true); - return *(m_null_plan_stack_up.get()); + return *(m_null_plan_stack_up); } void Thread::PushPlan(ThreadPlanSP thread_plan_sp) { Index: lldb/source/Target/ThreadPlanPython.cpp =================================================================== --- lldb/source/Target/ThreadPlanPython.cpp +++ lldb/source/Target/ThreadPlanPython.cpp @@ -15,7 +15,6 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" -#include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanPython.h" #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" Index: lldb/source/Target/ThreadPlanStack.cpp =================================================================== --- lldb/source/Target/ThreadPlanStack.cpp +++ lldb/source/Target/ThreadPlanStack.cpp @@ -406,7 +406,7 @@ for (auto thread : current_threads.Threads()) { lldb::tid_t cur_tid = thread->GetID(); if (!Find(cur_tid)) { - AddThread(*thread.get()); + AddThread(*thread); thread->QueueBasePlan(true); } } Index: lldb/tools/debugserver/source/DNBTimer.h =================================================================== --- lldb/tools/debugserver/source/DNBTimer.h +++ lldb/tools/debugserver/source/DNBTimer.h @@ -47,7 +47,7 @@ ~DNBTimer() {} - bool IsThreadSafe() const { return m_mutexAP.get() != NULL; } + bool IsThreadSafe() const { return m_mutexAP != NULL; } // Reset the time value to now void Reset() { PTHREAD_MUTEX_LOCKER(locker, m_mutexAP.get()); Index: lldb/tools/debugserver/source/RNBRemote.cpp =================================================================== --- lldb/tools/debugserver/source/RNBRemote.cpp +++ lldb/tools/debugserver/source/RNBRemote.cpp @@ -37,7 +37,6 @@ #include "DNBThreadResumeActions.h" #include "JSON.h" #include "JSONGenerator.h" -#include "JSONGenerator.h" #include "MacOSX/Genealogy.h" #include "OsLogger.h" #include "RNBContext.h" @@ -1431,7 +1430,6 @@ void RNBRemote::NotifyThatProcessStopped(void) { RNBRemote::HandlePacket_last_signal(NULL); - return; } /* 'A arglen,argnum,arg,...' @@ -3854,7 +3852,7 @@ return_message += cstring_to_asciihex_string("debugserver is x86_64 binary running in " "translation, attach failed."); - SendPacket(return_message.c_str()); + SendPacket(return_message); return rnb_err; } @@ -5223,7 +5221,7 @@ else xml_out << 'm'; // More data needs to be read with a // subsequent call - xml_out << binary_encode_string(chunk.data()); + xml_out << binary_encode_string(chunk); } } return SendPacket(xml_out.str()); Index: lldb/tools/lldb-vscode/BreakpointBase.cpp =================================================================== --- lldb/tools/lldb-vscode/BreakpointBase.cpp +++ lldb/tools/lldb-vscode/BreakpointBase.cpp @@ -304,7 +304,7 @@ } if (!output.empty() && output.back() != '\n') output.push_back('\n'); // Ensure log message has line break. - g_vsc.SendOutput(OutputType::Console, output.c_str()); + g_vsc.SendOutput(OutputType::Console, output); // Do not stop. return false; Index: llvm/include/llvm/Analysis/RegionInfoImpl.h =================================================================== --- llvm/include/llvm/Analysis/RegionInfoImpl.h +++ llvm/include/llvm/Analysis/RegionInfoImpl.h @@ -778,12 +778,12 @@ void RegionInfoBase::dump() const { print(dbgs()); } #endif -template -void RegionInfoBase::releaseMemory() { +template void RegionInfoBase::releaseMemory() { BBtoRegion.clear(); - if (TopLevelRegion) + if (TopLevelRegion) { delete TopLevelRegion; - TopLevelRegion = nullptr; + TopLevelRegion = nullptr; + } } template Index: llvm/include/llvm/MC/MCContext.h =================================================================== --- llvm/include/llvm/MC/MCContext.h +++ llvm/include/llvm/MC/MCContext.h @@ -190,8 +190,7 @@ SmallString<128> CompilationDir; /// Prefix replacement map for source file information. - std::map> - DebugPrefixMap; + std::map> DebugPrefixMap; /// The main file name if passed in explicitly. std::string MainFileName; Index: llvm/include/llvm/ProfileData/InstrProfReader.h =================================================================== --- llvm/include/llvm/ProfileData/InstrProfReader.h +++ llvm/include/llvm/ProfileData/InstrProfReader.h @@ -256,8 +256,8 @@ Error readNextRecord(NamedInstrProfRecord &Record) override; InstrProfSymtab &getSymtab() override { - assert(Symtab.get()); - return *Symtab.get(); + assert(Symtab); + 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 @@ -1076,7 +1076,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. @@ -1165,7 +1165,7 @@ if (!Coverage) return 1; - CoverageReport Report(ViewOpts, *Coverage.get()); + CoverageReport Report(ViewOpts, *Coverage); if (!ShowFunctionSummaries) { if (SourceFiles.empty()) Report.renderFileReports(llvm::outs(), IgnoreFilenameFilters); @@ -1231,16 +1231,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-pdbutil/PrettyClassLayoutGraphicalDumper.cpp =================================================================== --- llvm/tools/llvm-pdbutil/PrettyClassLayoutGraphicalDumper.cpp +++ llvm/tools/llvm-pdbutil/PrettyClassLayoutGraphicalDumper.cpp @@ -13,7 +13,6 @@ #include "PrettyFunctionDumper.h" #include "PrettyTypedefDumper.h" #include "PrettyVariableDumper.h" -#include "PrettyVariableDumper.h" #include "llvm-pdbutil.h" #include "llvm/DebugInfo/PDB/IPDBLineNumber.h" 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();