[all-commits] [llvm/llvm-project] 8fc7a9: Let normalize() for posix style convert backslash ...

Nico Weber via All-commits all-commits at lists.llvm.org
Tue May 5 10:55:39 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fc7a907b93a8e9eef96e872f8f926db3ebfe9b6
      https://github.com/llvm/llvm-project/commit/8fc7a907b93a8e9eef96e872f8f926db3ebfe9b6
  Author: Nico Weber <thakis at chromium.org>
  Date:   2020-05-05 (Tue, 05 May 2020)

  Changed paths:
    M clang/test/Lexer/case-insensitive-include-ms.c
    M llvm/lib/Support/Path.cpp
    M llvm/unittests/Support/Path.cpp

  Log Message:
  -----------
  Let normalize() for posix style convert backslash to slash unconditionally.

Currently, normalize() for posix replaces backslashes to slashes, except
that two backslashes in sequence are kept as-is.

clang calls normalize() to convert \ to / is microsoft compat mode. This
generally works well, but a path like "c:\\foo\\bar.h" with two
backslashes doesn't work due to the exception in normalize().

These paths happen naturally on Windows hosts with e.g.
`#include __FILE__`, and them not working on other hosts makes it
more difficult to write tests for this case.

The special case has been around without justification since this code
was added in r203611 (since then moved around in r215241 r215243).  No
integration tests fail if I remove it.

Try removing the special case.

Differential Revision: https://reviews.llvm.org/D79265




More information about the All-commits mailing list