This patch introduces FileSpec::GetComponents, a method that splits a
FileSpec's path into its individual components. For example, given
/foo/bar/baz, you'll get back a vector of strings {"foo", "bar", baz"}.
The motivation here is to reduce the use of
FileSpec::RemoveLastPathComponent. Mutating a FileSpec is expensive,
so providing a way of doing this without mutation is useful.
I'm surprised this returns a vector of std::strings and not llvm::StringRefs. I would expect all the components to be part of the FileSpec's stored path. Even with the file and directory stored as separate ConstStrings, that should be possible?