llvm::sys::path already provides a function home_directory() which returns the current user's home directory.
This patch extends this by implementing a function which returns the home directory of an arbitrary user. This satisfies a use case in LLDB where we need to resolve paths of the form ~username/path, and since it is similar in nature to the existing home_directory() function, seems generally useful for llvm
StringRef doesn't have a c_str() method, but you can do .str().c_str() to convert to std::string first. *yawn*, excessive copies in C++. :(