Internal to Apple, we have dSYMs that include source path remappings from the build-system paths to the long-term storage, and the latter point to NFS mounted directories, using a tilde username component. Currently, lldb expands those tilde paths to absolute paths when it is parsing the dSYMs, but this requires a stat of the full NFS filepath to the source directory -- and over a slow network, that delay can be significant. These initial realpath & stat's would all happen at initial file load / process launch, which is already a huge perf bottleneck. It's quite easy to move them out of there, and over a slow network connection, can yield a large time savings.
This patch keeps the source path remapping names in terms of tilde-username until we are actually opening one of the source files, at which point we realpath and test for the path existence. We'll be opening the source file anyway in a second, so walking the inodes would be done for that - there's no additional perf penalty from doing the expansion-and-check here.
I would create a little helper function (resolve_tilde(FileSpec& s) or something) to avoid duplicating this code on line 541?