aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-12-03 11:20:57 +0200
committerMartin Storsjö <martin@martin.st>2020-12-10 14:11:06 +0200
commit879c15e890b4d25d28ea904e92497f091f796019 (patch)
tree1ab60fa07db702feec0d4605f45d9b82c1fb468d /clang/lib/Frontend/CompilerInvocation.cpp
parent693da9df7481c48dd1edb93e78c66ec57fddeb60 (diff)
downloadllvm-879c15e890b4d25d28ea904e92497f091f796019.zip
llvm-879c15e890b4d25d28ea904e92497f091f796019.tar.gz
llvm-879c15e890b4d25d28ea904e92497f091f796019.tar.bz2
[llvm-rc] Handle driveless absolute windows paths when loading external files
When llvm-rc loads an external file, it looks for it relative to a number of include directories and the current working directory. If the path is considered absolute, llvm-rc tries to open the filename as such, and doesn't try to open it relative to other paths. On Windows, a path name like "\dir\file" isn't considered absolute as it lacks the drive name, but by appending it on top of the search dirs, it's not found. LLVM's sys::path::append just appends such a path (same with a properly absolute posix path) after the paths it's supposed to be relative to. This fix doesn't handle the case if the resource script and the external file are on a different drive than the current working directory; to fix that, we'd have to make LLVM's sys::path::append handle appending fully absolute and partially absolute paths (ones lacking a drive prefix but containing a root directory), or switch to C++17's std::filesystem. Differential Revision: https://reviews.llvm.org/D92558
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions