Support: Use sys::path::is_style_{posix,windows}() in a few places
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 22 Oct 2021 01:33:24 +0000 (18:33 -0700)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 29 Oct 2021 19:09:41 +0000 (12:09 -0700)
commit99023627010bbfefb71e25a2b4d056de1cbd354e
treea7ad434f3071922aac052bf9eb23c29c577cb885
parent51ce567b38ec92163ec05c9bef0bd0e2bd53c667
Support: Use sys::path::is_style_{posix,windows}() in a few places

Use the new sys::path::is_style_posix() and is_style_windows() in a few
places that need to detect the system's native path style.

In llvm/lib/Support/Path.cpp, this patch removes most uses of the
private `real_style()`, where is_style_posix() and is_style_windows()
are just a little tidier.

Elsewhere, this removes `_WIN32` macro checks. Added a FIXME to a
FileManagerTest that seemed fishy, but maintained the existing
behaviour.

Differential Revision: https://reviews.llvm.org/D112289
13 files changed:
clang/include/clang/Basic/JsonSupport.h
clang/lib/Basic/FileManager.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChain.cpp
clang/lib/Lex/PPDirectives.cpp
clang/unittests/Basic/FileManagerTest.cpp
clang/unittests/Driver/ToolChainTest.cpp
clang/unittests/Lex/HeaderSearchTest.cpp
clang/unittests/Tooling/RefactoringTest.cpp
llvm/include/llvm/Support/VirtualFileSystem.h
llvm/lib/Support/GraphWriter.cpp
llvm/lib/Support/Path.cpp
llvm/tools/lli/lli.cpp