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
Diff Detail
- Build Status
Buildable 4344 Build 4344: arc lint + arc unit
Event Timeline
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 | ||
---|---|---|
979–981 | Does this simplify to EXPECT_EQ(Path7, PathHome + "\\aaa")? If so we don't need the const char * local. | |
986 | Does EXPECT_EQ work? |
unittests/Support/Path.cpp | ||
---|---|---|
979–981 | SmallString does not have operator +. It has operator += but it does not help here. | |
986 | Yes, it works, as SmallString has operator == inherited from SmallVectorImpl.
Corresponding checks were updated accordingly. |
Does this simplify to EXPECT_EQ(Path7, PathHome + "\\aaa")? If so we don't need the const char * local.