[ADT] Move llvm::identity into IndexedMap (NFC) (#164568)
This patch moves llvm::identity to IndexedMap for two reasons:
- llvm::identity is used only IndexedMap.
- llvm::identity is not suitable for general use as it is not quite
the same as std::identity despite the comments in identity.h.
Also, this patch renames the class to IdentityIndex and places it in
the "detail" namespace.