[all-commits] [llvm/llvm-project] 5523fe: [clang][lex] Use preferred path separator in inclu...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Fri Sep 8 16:38:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5523fefb01c282c4cbcaf6314a9aaf658c6c145f
      https://github.com/llvm/llvm-project/commit/5523fefb01c282c4cbcaf6314a9aaf658c6c145f
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2023-09-08 (Fri, 08 Sep 2023)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/checkers/misc/header-include-cycle.cpp
    M clang/lib/Lex/HeaderSearch.cpp
    M clang/lib/Tooling/Syntax/Tokens.cpp
    M clang/test/CXX/class/class.friend/p7-cxx20.cpp
    M clang/test/CXX/class/class.mfct/p1-cxx20.cpp
    M clang/test/Index/skip-parsed-bodies/compile_commands.json
    M clang/test/Misc/remap-file.c
    M clang/test/Modules/cxx20-hu-04.cpp
    M clang/test/Modules/cxx20-hu-05.cpp
    M clang/test/Modules/cxx20-hu-06.cpp
    M clang/test/Modules/cxx20-include-translation.cpp
    M clang/test/Preprocessor/file_test_windows.c
    M clang/test/Preprocessor/microsoft-header-search-fail.c
    M clang/unittests/Lex/PPDependencyDirectivesTest.cpp
    M clang/unittests/Tooling/TransformerTest.cpp

  Log Message:
  -----------
  [clang][lex] Use preferred path separator in includer-relative lookup

There is a long-standing FIXME in `HeaderSearch.cpp` to use the path separator preferred by the platform instead of forward slash. There was an attempt to fix that (1cf6c28a) which got reverted (cf385dc8). I couldn't find an explanation, but my guess is that some tests assuming forward slash started failing.

This commit fixes tests with that assumption.

This is intended to be NFC, but there are two exceptions to that:
* Some diagnostic messages might now contain backslash instead of forward slash.
* Arguments to the "-remap-file" option that use forward slash might stop kicking in. Separators between potential includer path and header name need to be replaced by backslash in that case.




More information about the All-commits mailing list