diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-10-29 16:50:10 -0700 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-10-29 16:50:10 -0700 |
commit | 8077a19f66b50573a043ef1c405e2149e0c69cb7 (patch) | |
tree | ca932d5f15d5613578de1cf8bc594c16adae89e6 /llvm/unittests/Support/Path.cpp | |
parent | 0d5b6423bac61efd8aaedaa7b65b462d2f08c661 (diff) | |
download | llvm-8077a19f66b50573a043ef1c405e2149e0c69cb7.zip llvm-8077a19f66b50573a043ef1c405e2149e0c69cb7.tar.gz llvm-8077a19f66b50573a043ef1c405e2149e0c69cb7.tar.bz2 |
Support: Remove sys::path::is_style_native()
Remove sys::path::is_style_native(), which was added alongside
is_style_windows() and is_style_posix().
Thinking a bit about the windows forward-slash style variant in
https://reviews.llvm.org/D111879, it's not clear to me how the new
sys::path::is_style_native() should behave for them.
- Should it return true for both `windows_slash` and
`windows_backslash`?
- Should it return true for only one of them?
I can think of hypothetical uses and justifications for either one, and
I could also imagine clients guessing either behaviour when just looking
at the function name in code.
Call sites will probably be more clear if they don't use this function,
and instead write out the code:
```
// Is "S" the coarse-grained native style?
if (is_style_windows(S) == is_style_windows(Style::native))
// Is "S" the fine-grained native style?
if (is_style_windows(S) == is_style_windows(Style::native) &&
preferred_separator(S) == preferred_separator(Style::native))
```
Can always add this again if someone needs it and can justify one
behaviour over the other, but for now might as well avoid growing users.
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r-- | llvm/unittests/Support/Path.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 52e447f..927b7eb 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -86,11 +86,6 @@ TEST(is_style_Style, Works) { EXPECT_TRUE(is_style_posix(Style::native)); EXPECT_FALSE(is_style_windows(Style::native)); #endif - - // Check is_style_native(). - EXPECT_TRUE(is_style_native(Style::native)); - EXPECT_EQ(is_style_posix(Style::native), is_style_native(Style::posix)); - EXPECT_EQ(is_style_windows(Style::native), is_style_native(Style::windows)); } TEST(is_separator, Works) { |