This is an archive of the discontinued LLVM Phabricator instance.

Allow temporary string_view((const char*)nullptr) while cleanup occurs.
AbandonedPublic

Authored by EricWF on Mar 10 2022, 1:12 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

Google is working to clean up a local patch to libc++ that allows
string_view to be constructed from null pointers. In order to do this we
need to intercept the call to char_traits::length. This temporary change
allows google to live at head with libc++ while it cleans up
non-conforming code.

Diff Detail

Event Timeline

EricWF created this revision.Mar 10 2022, 1:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 1:12 PM
EricWF requested review of this revision.Mar 10 2022, 1:12 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptMar 10 2022, 1:12 PM
EricWF updated this revision to Diff 414479.Mar 10 2022, 1:15 PM
  • Make code compile (Spell the parameter name correctly)

I'll go ahead and land D121231, and we can land this patch on top if it makes your life easier in terms of upstream/downstream maintenance.

libcxx/include/string_view
320

With this patch, we are not asserting that __s != nullptr. I'd be OK with the patch if that were addressed. TBH I'm mostly neutral on how we solve this problem, as long as we get rid of the naked call to __libcpp_debug_function and we retain the _LIBCPP_ASSERT(__s != nullptr) upstream.

I landed my patch last week -- I assume you resolved the merge conflict internally already. If we want to move forward with something like this, let's do it, otherwise, we can abandon the patch to clear up the review queue!

EricWF abandoned this revision.Mar 16 2022, 4:08 PM