Re-land "Optimize path::remove_dots"
authorReid Kleckner <rnk@google.com>
Mon, 4 May 2020 23:23:48 +0000 (16:23 -0700)
committerReid Kleckner <rnk@google.com>
Mon, 4 May 2020 23:40:39 +0000 (16:40 -0700)
commit75cbf6dc5cdb844ba4dd4631a984412e06c5387c
tree5ce083a6a77041c28563a75014928016a1dac867
parent2868ee5b3273e203d3b5d170531ecba764b2d610
Re-land "Optimize path::remove_dots"

This reverts commit fb5fd74685e728b1d5e68d33e9842bcd734b98e6.
Re-instates commit 53913a65b408ade2956061b4c0aaed6bba907403

The fix is to trim off trailing separators, as in `/foo/bar/` and
produce `/foo/bar`. VFS tests rely on this. I added unit tests for
remove_dots.
llvm/lib/Support/Path.cpp
llvm/lib/Support/Windows/Path.inc
llvm/unittests/Support/Path.cpp