In D54435 there was some discussion about the expand_tilde flag for real_path that I wanted to expose through the VFS. The consensus is that these two things should be separate functions. Since we already have the code for this I went ahead and added a function expand_tilde that does just that.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Thanks! Only real substantial suggestion is not to require handling an error where none is possible.
llvm/include/llvm/Support/FileSystem.h | ||
---|---|---|
352 ↗ | (On Diff #173772) | it'd be worth explicitly stating whether ~user is handled, whether $ENVVAR is handled, and what this does on windows. |
355 ↗ | (On Diff #173772) | this can't fail, remove the error_code return? then it can return its result, which makes it a bit easier to use. |
llvm/lib/Support/Unix/Path.inc | ||
554 ↗ | (On Diff #173772) | the much richer alternative on unix is to wrap wordexp(), which more precisely emulates a shell. |
llvm/unittests/Support/Path.cpp | ||
536 ↗ | (On Diff #173772) | is there any reason for this to fail? Maybe assert it instead so the test doesn't silently become a no-op? |
538 ↗ | (On Diff #173772) | also test ~/foo? (would be nice to have a test for ~username on unix, but not sure if it's easy to make that work) |