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

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

Differential Revision: https://reviews.llvm.org/D100569

GitOrigin-RevId: f6b656853644a058534bffb0708c2e95347bd233
1 file changed