diff --git a/lldb/include/lldb/DataFormatters/FormattersContainer.h b/lldb/include/lldb/DataFormatters/FormattersContainer.h index 0761dcfcb12e..9ad48ea75b43 100644 --- a/lldb/include/lldb/DataFormatters/FormattersContainer.h +++ b/lldb/include/lldb/DataFormatters/FormattersContainer.h @@ -58,7 +58,7 @@ class TypeMatcher { if (type.IsEmpty()) return type; - llvm::StringRef type_lexer(type.AsCString()); + llvm::StringRef type_lexer(type); type_lexer.consume_front("class "); type_lexer.consume_front("enum "); diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp index 4bc6fff70c89..701e76cc845e 100644 --- a/lldb/source/Breakpoint/BreakpointLocation.cpp +++ b/lldb/source/Breakpoint/BreakpointLocation.cpp @@ -618,7 +618,7 @@ void BreakpointLocation::GetDescription(Stream *s, sc.function->GetMangled().GetMangledName()) { s->EOL(); s->Indent("mangled function = "); - s->PutCString(mangled_name.AsCString()); + s->PutCString(mangled_name); } } diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index 6e4f6e1b7349..a5f620752acf 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -503,8 +503,8 @@ bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, const Symbol *symbol = symtab->FindSymbolContainingFileAddress(file_Addr); if (symbol) { - const char *symbol_name = symbol->GetName().AsCString(); - if (symbol_name) { + llvm::StringRef symbol_name = symbol->GetName().GetStringRef(); + if (!symbol_name.empty()) { s->PutCStringColorHighlighted(symbol_name, settings); addr_t delta = file_Addr - symbol->GetAddressRef().GetFileAddress(); diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index 3011b6aede3d..77456d23f8b4 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -413,7 +413,7 @@ VariableAnnotator::AnnotateStructured(Instruction &inst) { const Declaration &decl = v->GetDeclaration(); if (decl.GetFile()) { - decl_file = decl.GetFile().GetFilename().AsCString(); + decl_file = decl.GetFile().GetFilename().GetString(); if (decl.GetLine() > 0) decl_line = decl.GetLine(); } diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index f7683c55baf8..032f6f7327e2 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -566,8 +566,7 @@ ConstString Mangled::GetBaseName() const { if (!demangled_name) return {}; - const char *name_str = demangled_name.AsCString(); const auto &range = demangled_info->BasenameRange; return ConstString( - llvm::StringRef(name_str + range.first, range.second - range.first)); + demangled_name.GetStringRef().slice(range.first, range.second)); } diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index cb9955b611d0..77add249f41a 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -796,8 +796,8 @@ bool ValueObjectPrinter::PrintChildrenOneLiner(bool hide_names) { m_stream->PutCString(", "); did_print_children = true; if (!hide_names) { - const char *name = child_sp.get()->GetName().AsCString(); - if (name && *name) { + llvm::StringRef name = child_sp.get()->GetName().GetStringRef(); + if (!name.empty()) { m_stream->PutCString(name); m_stream->PutCString(" = "); } diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp index f3a7e29dcf97..c2084e0322c1 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -656,7 +656,7 @@ void DYLDRendezvous::UpdateFileSpecIfNecessary(SOEntry &entry) { Status region_status = m_process->GetMemoryRegionInfo(entry.dyn_addr, region); if (!region.GetName().IsEmpty()) - entry.file_spec.SetFile(region.GetName().AsCString(), + entry.file_spec.SetFile(region.GetName().GetStringRef(), FileSpec::Style::native); } } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index d04981191e6c..2fa820a3a509 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -1472,7 +1472,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls( if (data_symbol) { std::string warning("got name from symbols: "); - warning.append(name.AsCString()); + warning.append(name.GetStringRef()); const unsigned diag_id = m_ast_context->getDiagnostics().getCustomDiagID( clang::DiagnosticsEngine::Level::Warning, "%0"); @@ -1825,7 +1825,8 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context, Type *function_type = function->GetType(); const auto lang = function->GetCompileUnit()->GetLanguage(); - const auto name = function->GetMangled().GetMangledName().AsCString(); + const llvm::StringRef name = + function->GetMangled().GetMangledName().GetStringRef(); const bool extern_c = (Language::LanguageIsC(lang) && !Mangled::IsMangledName(name)) || (Language::LanguageIsObjC(lang) && diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index be313866a101..7ea9154bb28e 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -1262,7 +1262,7 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type, // Make the objective C V2 mangled name for the ivar offset from the class // name and ivar name std::string buffer("OBJC_IVAR_$_"); - buffer.append(class_name.AsCString()); + buffer.append(class_name.GetStringRef()); buffer.push_back('.'); buffer.append(ivar_name); ConstString ivar_const_str(buffer.c_str()); diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 7cc782cf2823..47f8d8a84446 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2216,7 +2216,7 @@ std::shared_ptr ObjectFileELF::GetGnuDebugDataObjectFile() { if (err) { GetModule()->ReportWarning( "An error occurred while decompression the section {0}: {1}", - section->GetName().AsCString(), llvm::toString(std::move(err)).c_str()); + section->GetName(), llvm::toString(std::move(err)).c_str()); return nullptr; } @@ -3043,7 +3043,7 @@ unsigned ObjectFileELF::ApplyRelocations( for (unsigned i = 0; i < num_relocations; ++i) { if (!rel.Parse(rel_data, &offset)) { GetModule()->ReportError(".rel{0}[{1:d}] failed to parse relocation", - rel_section->GetName().AsCString(), i); + rel_section->GetName(), i); break; } const Symbol *symbol = nullptr; @@ -3058,8 +3058,7 @@ unsigned ObjectFileELF::ApplyRelocations( case R_ARM_REL32: GetModule()->ReportError("unsupported AArch32 relocation:" " .rel{0}[{1}], type {2}", - rel_section->GetName().AsCString(), i, - reloc_type(rel)); + rel_section->GetName(), i, reloc_type(rel)); break; default: assert(false && "unexpected relocation type"); @@ -3088,16 +3087,15 @@ unsigned ObjectFileELF::ApplyRelocations( *dst = value; } else { GetModule()->ReportError(".rel{0}[{1}] unknown symbol id: {2:d}", - rel_section->GetName().AsCString(), i, - reloc_symbol(rel)); + rel_section->GetName(), i, + reloc_symbol(rel)); } break; case R_386_NONE: case R_386_PC32: GetModule()->ReportError("unsupported i386 relocation:" " .rel{0}[{1}], type {2}", - rel_section->GetName().AsCString(), i, - reloc_type(rel)); + rel_section->GetName(), i, reloc_type(rel)); break; default: assert(false && "unexpected relocation type"); diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index d8b017b492b1..b024f8cfb9aa 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -3808,9 +3808,11 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) { // This is usually the second N_SO entry that contains just the // filename, so here we combine it with the first one if we are // minimizing the symbol table - const char *so_path = - sym[sym_idx - 1].GetMangled().GetDemangledName().AsCString(); - if (so_path && so_path[0]) { + llvm::StringRef so_path = sym[sym_idx - 1] + .GetMangled() + .GetDemangledName() + .GetStringRef(); + if (!so_path.empty()) { std::string full_so_path(so_path); const size_t double_slash_pos = full_so_path.find("//"); if (double_slash_pos != std::string::npos) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index bc0206eadc45..519f070f8542 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -611,7 +611,7 @@ void PlatformDarwinKernel::AddKextToMap(PlatformDarwinKernel *thisp, bool PlatformDarwinKernel::KextHasdSYMSibling( const FileSpec &kext_bundle_filepath) { FileSpec dsym_fspec = kext_bundle_filepath; - std::string filename = dsym_fspec.GetFilename().AsCString(); + std::string filename = dsym_fspec.GetFilename().GetString(); filename += ".dSYM"; dsym_fspec.SetFilename(filename); if (FileSystem::Instance().IsDirectory(dsym_fspec)) { @@ -648,7 +648,7 @@ bool PlatformDarwinKernel::KextHasdSYMSibling( // /dir/dir/mach.development.t7004.dSYM bool PlatformDarwinKernel::KernelHasdSYMSibling(const FileSpec &kernel_binary) { FileSpec kernel_dsym = kernel_binary; - std::string filename = kernel_binary.GetFilename().AsCString(); + std::string filename = kernel_binary.GetFilename().GetString(); filename += ".dSYM"; kernel_dsym.SetFilename(filename); return FileSystem::Instance().IsDirectory(kernel_dsym); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 650f227d5282..7c2682389f86 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1619,7 +1619,7 @@ bool SymbolFileDWARF::CompleteType(CompilerType &compiler_type) { GetObjectFile()->GetModule()->LogMessageVerboseBacktrace( log, "{0:x8}: {1} ({2}) '{3}' resolving forward declaration...", def_die.GetID(), DW_TAG_value_to_name(def_die.Tag()), def_die.Tag(), - type->GetName().AsCString()); + type->GetName().GetStringRef()); assert(compiler_type); return dwarf_ast->CompleteTypeFromDWARF(def_die, type, compiler_type); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index fd2da1ea46fe..2f9b821270db 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -345,8 +345,8 @@ void SymbolFileDWARFDebugMap::InitOSO() { if (so_symbol && oso_symbol && so_symbol->GetType() == eSymbolTypeSourceFile && oso_symbol->GetType() == eSymbolTypeObjectFile) { - m_compile_unit_infos[i].so_file.SetFile(so_symbol->GetName().AsCString(), - FileSpec::Style::native); + m_compile_unit_infos[i].so_file.SetFile( + so_symbol->GetName().GetStringRef(), FileSpec::Style::native); m_compile_unit_infos[i].oso_path = oso_symbol->GetName(); m_compile_unit_infos[i].oso_mod_time = llvm::sys::toTimePoint(oso_symbol->GetIntegerValue(0)); diff --git a/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp b/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp index 3947036538f2..e6678f4eebae 100644 --- a/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp +++ b/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp @@ -401,7 +401,7 @@ static bool LookForDsymNextToExecutablePath(const ModuleSpec &mod_spec, FileSpec dsym_directory = exec_fspec; dsym_directory.RemoveLastPathComponent(); - std::string dsym_filename = filename.AsCString(); + std::string dsym_filename = filename.GetString(); dsym_filename += ".dSYM"; dsym_directory.AppendPathComponent(dsym_filename); dsym_directory.AppendPathComponent("Contents"); @@ -442,7 +442,7 @@ static bool LookForDsymNextToExecutablePath(const ModuleSpec &mod_spec, // See if we have a .dSYM.yaa next to this executable path. FileSpec dsym_yaa_fspec = exec_fspec; dsym_yaa_fspec.RemoveLastPathComponent(); - std::string dsym_yaa_filename = filename.AsCString(); + std::string dsym_yaa_filename = filename.GetString(); dsym_yaa_filename += ".dSYM.yaa"; dsym_yaa_fspec.AppendPathComponent(dsym_yaa_filename); diff --git a/lldb/source/Plugins/SymbolLocator/Default/SymbolLocatorDefault.cpp b/lldb/source/Plugins/SymbolLocator/Default/SymbolLocatorDefault.cpp index 096510215cfa..7a9353565c31 100644 --- a/lldb/source/Plugins/SymbolLocator/Default/SymbolLocatorDefault.cpp +++ b/lldb/source/Plugins/SymbolLocator/Default/SymbolLocatorDefault.cpp @@ -201,7 +201,7 @@ std::optional SymbolLocatorDefault::LocateExecutableSymbolFile( // Some debug files may stored in the module directory like this: // /usr/lib/debug/usr/lib/library.so.debug if (!file_dir.IsEmpty()) - files.push_back(dirname + file_dir.AsCString() + "/" + + files.push_back(dirname + file_dir.GetString() + "/" + symbol_file_spec.GetFilename().GetCString()); } diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp index 3b1535a93199..fc0620428a7b 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp @@ -272,7 +272,7 @@ BuildModulesSection(Process &process, FileSpec directory) { FileSpec path_to_copy_module = directory; path_to_copy_module.AppendPathComponent("modules"); path_to_copy_module.AppendPathComponent(system_path); - sys::fs::create_directories(path_to_copy_module.GetDirectory().AsCString()); + sys::fs::create_directories(path_to_copy_module.GetDirectory()); if (std::error_code ec = llvm::sys::fs::copy_file(file, path_to_copy_module.GetPath())) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index ca5d5d12e00b..67be014feee4 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -8602,7 +8602,7 @@ void TypeSystemClang::DumpFromSymbolFile(Stream &s, if (symbol_name != type->GetName().GetStringRef()) continue; - s << type->GetName().AsCString() << "\n"; + s << type->GetName() << "\n"; CompilerType full_type = type->GetFullCompilerType(); if (clang::TagDecl *tag_decl = GetAsTagDecl(full_type)) { diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index fdb20bcd83ff..54062fac2d85 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -89,9 +89,9 @@ void InlineFunctionInfo::DumpStopContext(Stream *s) const { // s->Indent("[inlined] "); s->Indent(); if (m_mangled) - s->PutCString(m_mangled.GetName().AsCString()); + s->PutCString(m_mangled.GetName()); else - s->PutCString(m_name.AsCString()); + s->PutCString(m_name); } ConstString InlineFunctionInfo::GetName() const { diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp index 0d66a383075f..7b015bd23b71 100644 --- a/lldb/source/Symbol/SymbolContext.cpp +++ b/lldb/source/Symbol/SymbolContext.cpp @@ -922,7 +922,7 @@ Mangled SymbolContext::GetPossiblyInlinedFunctionName() const { // Sometimes an inline frame may not have mangling information, // but does have a valid name. - return Mangled{inline_info->GetName().AsCString()}; + return Mangled{inline_info->GetName()}; } // diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp index 55926a0b150f..0057c96f09cd 100644 --- a/lldb/source/Symbol/Variable.cpp +++ b/lldb/source/Symbol/Variable.cpp @@ -596,7 +596,7 @@ static void PrivateAutoComplete( if (variable_list) { for (const VariableSP &var_sp : *variable_list) - request.AddCompletion(var_sp->GetName().AsCString()); + request.AddCompletion(var_sp->GetName()); } } } diff --git a/lldb/source/Target/ModuleCache.cpp b/lldb/source/Target/ModuleCache.cpp index 3d2812b0966e..c4f7fc440836 100644 --- a/lldb/source/Target/ModuleCache.cpp +++ b/lldb/source/Target/ModuleCache.cpp @@ -139,8 +139,8 @@ Status CreateHostSysRootModuleLink(const FileSpec &root_dir_spec, DecrementRefExistingModule(root_dir_spec, sysroot_module_path_spec); } - Status error = MakeDirectory( - FileSpec(sysroot_module_path_spec.GetDirectory().AsCString())); + Status error = + MakeDirectory(FileSpec(sysroot_module_path_spec.GetDirectory())); if (error.Fail()) return error; diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 55eaa88b562d..83f4fdf33d4d 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1896,7 +1896,7 @@ uint32_t Platform::LoadImage(lldb_private::Process *process, // Only local file was specified. Install it to the current working // directory. FileSpec target_file = GetWorkingDirectory(); - target_file.AppendPathComponent(local_file.GetFilename().AsCString()); + target_file.AppendPathComponent(local_file.GetFilename()); if (IsRemote() || local_file != target_file) { error = Install(local_file, target_file); if (error.Fail()) diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 896425e42464..96c1a2400dd7 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -923,7 +923,7 @@ void Target::ApplyNameToBreakpoints(BreakpointName &bp_name) { void Target::GetBreakpointNames(std::vector &names) { names.clear(); for (const auto& bp_name_entry : m_breakpoint_names) { - names.push_back(bp_name_entry.first.AsCString()); + names.push_back(bp_name_entry.first.GetString()); } llvm::sort(names); } diff --git a/lldb/source/Target/Trace.cpp b/lldb/source/Target/Trace.cpp index 1ffd617a80fc..8bec62638b7c 100644 --- a/lldb/source/Target/Trace.cpp +++ b/lldb/source/Target/Trace.cpp @@ -113,7 +113,7 @@ Trace::LoadPostMortemTraceFromFile(Debugger &debugger, return Trace::FindPluginForPostMortemProcess( debugger, *session_file, - trace_description_file.GetDirectory().AsCString()); + trace_description_file.GetDirectory().GetStringRef()); } Expected Trace::FindPluginForPostMortemProcess( diff --git a/lldb/source/Target/TraceDumper.cpp b/lldb/source/Target/TraceDumper.cpp index 5e87deb2ac9c..d8ac7d681292 100644 --- a/lldb/source/Target/TraceDumper.cpp +++ b/lldb/source/Target/TraceDumper.cpp @@ -245,7 +245,7 @@ private: else if (!sc.function && !sc.symbol) m_s << module_name << "`(none)"; else - m_s << module_name << "`" << sc.GetFunctionName().AsCString(); + m_s << module_name << "`" << sc.GetFunctionName(); } void DumpFunctionCallTree(const TraceDumper::FunctionCall &function_call) { diff --git a/lldb/source/ValueObject/DILEval.cpp b/lldb/source/ValueObject/DILEval.cpp index 80b31be8e7c2..ebe44f30979e 100644 --- a/lldb/source/ValueObject/DILEval.cpp +++ b/lldb/source/ValueObject/DILEval.cpp @@ -1064,7 +1064,7 @@ Interpreter::Visit(const BitFieldExtractionNode &node) { std::string message = llvm::formatv( "bitfield range {0}:{1} is not valid for \"({2}) {3}\"", first_index, last_index, base->GetTypeName().AsCString(""), - base->GetName().AsCString()); + base->GetName().GetStringRef()); return llvm::make_error(m_expr, message, node.GetLocation()); } diff --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp index 6a5130f8492a..c43f6a88edb5 100644 --- a/lldb/tools/lldb-test/lldb-test.cpp +++ b/lldb/tools/lldb-test/lldb-test.cpp @@ -767,8 +767,7 @@ Error opts::symbols::verify(lldb_private::Module &Module) { if (!comp_unit) return make_string_error("Cannot parse compile unit {0}.", i); - outs() << "Processing '" - << comp_unit->GetPrimaryFile().GetFilename().AsCString() + outs() << "Processing '" << comp_unit->GetPrimaryFile().GetFilename() << "' compile unit.\n"; LineTable *lt = comp_unit->GetLineTable(); diff --git a/lldb/unittests/Symbol/TestTypeSystemClang.cpp b/lldb/unittests/Symbol/TestTypeSystemClang.cpp index a6db2059a351..2b5c8f6e1404 100644 --- a/lldb/unittests/Symbol/TestTypeSystemClang.cpp +++ b/lldb/unittests/Symbol/TestTypeSystemClang.cpp @@ -758,7 +758,7 @@ TEST_F(TestTypeSystemClang, TemplateArguments) { CompilerType double_type(m_ast->weak_from_this(), m_ast->getASTContext().DoubleTy.getAsOpaquePtr()); for (CompilerType t : {type, typedef_type, auto_type}) { - SCOPED_TRACE(t.GetTypeName().AsCString()); + SCOPED_TRACE(t.GetTypeName().GetString()); const bool expand_pack = false; EXPECT_EQ( diff --git a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp index 6a753b6b33ed..54f10df998aa 100644 --- a/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp +++ b/lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp @@ -307,7 +307,7 @@ DWARF: lldb::TypeSP type = tester.GetParser().ParseTypeFromDWARF(sc, func, &new_type); found_function_types.push_back( - type->GetForwardCompilerType().GetTypeName().AsCString()); + type->GetForwardCompilerType().GetTypeName().GetString()); } // Compare the parsed function types against the expected list of types.