Skip to content

Commit

Permalink
[Demangle] replace use of llvm::StringView w/ std::string_view
Browse files Browse the repository at this point in the history
This refactoring was waiting on converting LLVM to C++17.

Leave StringView.h and cleanup around for subsequent cleanup.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D148384
  • Loading branch information
nickdesaulniers committed Apr 14, 2023
1 parent 1c261e3 commit 3e55950
Show file tree
Hide file tree
Showing 14 changed files with 402 additions and 359 deletions.
3 changes: 2 additions & 1 deletion lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "UdtRecordCompleter.h"
#include "SymbolFileNativePDB.h"
#include <optional>
#include <string_view>

using namespace lldb_private;
using namespace lldb_private::npdb;
Expand Down Expand Up @@ -174,7 +175,7 @@ PdbAstBuilder::CreateDeclInfoForType(const TagRecord &record, TypeIndex ti) {
return CreateDeclInfoForUndecoratedName(record.Name);

llvm::ms_demangle::Demangler demangler;
StringView sv(record.UniqueName.begin(), record.UniqueName.size());
std::string_view sv(record.UniqueName.begin(), record.UniqueName.size());
llvm::ms_demangle::TagTypeNode *ttn = demangler.parseTagUniqueName(sv);
if (demangler.Error)
return {m_clang.GetTranslationUnitDecl(), std::string(record.UniqueName)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "PdbUtil.h"
#include "UdtRecordCompleter.h"
#include <optional>
#include <string_view>

using namespace lldb;
using namespace lldb_private;
Expand Down Expand Up @@ -631,7 +632,7 @@ static std::string GetUnqualifiedTypeName(const TagRecord &record) {
}

llvm::ms_demangle::Demangler demangler;
StringView sv(record.UniqueName.begin(), record.UniqueName.size());
std::string_view sv(record.UniqueName.begin(), record.UniqueName.size());
llvm::ms_demangle::TagTypeNode *ttn = demangler.parseTagUniqueName(sv);
if (demangler.Error)
return std::string(record.Name);
Expand Down
Loading

0 comments on commit 3e55950

Please sign in to comment.