This is an archive of the discontinued LLVM Phabricator instance.

[libcxxabi][demangle] create helper for std::string_view::starts_with
ClosedPublic

Authored by nickdesaulniers on Apr 17 2023, 11:43 AM.

Details

Summary

Add C++ 20 style starts_with to replace StringView::startsWith in
LLVMDemangle. Due to library layering (LLVMSupport depends on
LLVMDemangle), we add the utility header under llvm/Demangle, instead of
llvm/ADT or llvm/Support.

Modify this in libcxxabi, then copy this over to llvm.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2023, 11:43 AM
nickdesaulniers requested review of this revision.Apr 17 2023, 11:43 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 17 2023, 11:43 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

(note to reviewers: it's on my todo list to backport my recent changes to llvm's demangle to libcxxabi's demangle; didn't realize there were two in tree until after making changes to the downstream one. Luckily, they are simply 1:1 copies)

nickdesaulniers planned changes to this revision.Apr 17 2023, 12:00 PM
nickdesaulniers added inline comments.
libcxxabi/src/demangle/StringViewExtras.h
21

"DemangleConfig.h" is needed for this defition

  • add DemangleConfig.h

I wonder if this new file should get an entry in clang/docs/tools/clang-formatted-files.txt?

  • add new file to clang/docs/tools/clang-formatted-files.txt
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2023, 2:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MaskRay accepted this revision.EditedApr 19 2023, 1:47 PM

This was added to ADT in https://reviews.llvm.org/D148367 then reverted in https://reviews.llvm.org/D148547 because it was a layering violation pointed out in https://reviews.llvm.org/D148384#4270356.

This description requires readers to read the links. How about make the description self-contained with a brief message?

Add C++ 20 style starts_with to replace StringView::startsWith in LLVMDemangle. Due to library layering (LLVMSupport depends on LLVMDemangle), we add the utility header under llvm/Demangle, instead of llvm/ADT or llvm/Support.

A member from #libc_abi needs to review this as well to make this differential green :)

nickdesaulniers edited the summary of this revision. (Show Details)
phosek accepted this revision.Apr 19 2023, 10:49 PM

LGTM

This revision is now accepted and ready to land.Apr 19 2023, 10:49 PM
This revision was landed with ongoing or failed builds.Apr 20 2023, 10:19 AM
This revision was automatically updated to reflect the committed changes.