Windows does not treat ~ as a reference to home directory, so the call
to llvm::sys::path::native on, say, ~/somedir produces ~\somedir,
which has different meaning than the original path. With this change
tilde is expanded on Windows to user profile directory. Such behavior
keeps original meaning of the path and is consistent with the algorithm
of llvm::sys::path::home_directory.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Seems like reasonable functionality. I just have a few comments on the unittest. If SmallString doesn't do operator==, they're mostly irrelevant.
unittests/Support/Path.cpp | ||
---|---|---|
951–953 ↗ | (On Diff #80604) | Does this simplify to EXPECT_EQ(Path7, PathHome + "\\aaa")? If so we don't need the const char * local. |
958 ↗ | (On Diff #80604) | Does EXPECT_EQ work? |
unittests/Support/Path.cpp | ||
---|---|---|
951–953 ↗ | (On Diff #80604) | SmallString does not have operator +. It has operator += but it does not help here. |
958 ↗ | (On Diff #80604) | Yes, it works, as SmallString has operator == inherited from SmallVectorImpl.
Corresponding checks were updated accordingly. |