[Clang] Restore replace_path_prefix instead of startswith
authorSylvain Audi <sylvain.audi@ubisoft.com>
Wed, 29 Apr 2020 16:50:37 +0000 (12:50 -0400)
committerSylvain Audi <sylvain.audi@ubisoft.com>
Wed, 13 May 2020 17:49:14 +0000 (13:49 -0400)
commit7a8edcb2124b60941ef6ea4bb4b38a9eb0d70137
tree6e6e17e69e14eed67c2f745cd6153e9571571284
parent33d96bf7b9b2add1c45bf1c60195dc7ca961393e
[Clang] Restore replace_path_prefix instead of startswith

In D49466, sys::path::replace_path_prefix was used instead startswith for -f[macro/debug/file]-prefix-map options.
However those were reverted later (commit rG3bb24bf25767ef5bbcef958b484e7a06d8689204) due to broken Windows tests.

This patch restores those replace_path_prefix calls.
It also modifies the prefix matching to be case-insensitive under Windows.

Differential Revision : https://reviews.llvm.org/D76869
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/test/Preprocessor/Inputs/include-file-test/file_test.h [moved from clang/test/Preprocessor/file_test.h with 100% similarity]
clang/test/Preprocessor/file_test.c
clang/test/Preprocessor/file_test_windows.c [new file with mode: 0644]
llvm/include/llvm/Support/Path.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/lib/MC/MCContext.cpp
llvm/lib/Support/Path.cpp
llvm/unittests/Support/Path.cpp