This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add slice/take/drop methods to ArrayRef
ClosedPublic

Authored by gchatelet on Apr 15 2021, 8:34 AM.

Details

Summary

Add various methods from llvm::ArrayRef. Refactor implementation to remove code duplication.

Diff Detail

Event Timeline

gchatelet created this revision.Apr 15 2021, 8:34 AM
Herald added a project: Restricted Project. ยท View Herald TranscriptApr 15 2021, 8:34 AM
gchatelet requested review of this revision.Apr 15 2021, 8:34 AM

I removed the various asserts from the original code as we did for StringView.
Should we start to add tests?

sivachandra accepted this revision.Apr 15 2021, 10:01 PM
sivachandra added inline comments.
libc/utils/CPP/ArrayRef.h
28

These are effectively type names so why not Capitalize them?

This revision is now accepted and ready to land.Apr 15 2021, 10:01 PM
gchatelet marked an inline comment as done.
  • Fix argument capitalization
libc/utils/CPP/ArrayRef.h
28

This is to follow the naming scheme of STL container
https://en.cppreference.com/w/cpp/container/array

This revision was landed with ongoing or failed builds.Apr 16 2021, 12:55 AM
This revision was automatically updated to reflect the committed changes.

Should we start to add tests?

Sorry I missed this. We can add tests now in a different pass.

Should we start to add tests?

Sorry I missed this. We can add tests now in a different pass.

๐Ÿ‘