1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/tools/llvm-rc
Martin Storsjö 102c71a022 [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
2020-12-10 14:11:06 +02:00
..
CMakeLists.txt
llvm-rc.cpp [llvm-rc] Lowercase the option definitions. NFC. 2020-09-16 09:34:26 +03:00
Opts.td [llvm-rc] Lowercase the option definitions. NFC. 2020-09-16 09:34:26 +03:00
ResourceFileWriter.cpp [llvm-rc] Handle driveless absolute windows paths when loading external files 2020-12-10 14:11:06 +02:00
ResourceFileWriter.h [llvm-rc] Allow string table values split into multiple string literals 2020-08-05 08:59:32 +03:00
ResourceScriptCppFilter.cpp
ResourceScriptCppFilter.h
ResourceScriptParser.cpp [llvm-rc] Allow omitting components from VERSIONINFO versions 2020-09-16 09:34:26 +03:00
ResourceScriptParser.h
ResourceScriptStmt.cpp [llvm-rc] Allow string table values split into multiple string literals 2020-08-05 08:59:32 +03:00
ResourceScriptStmt.h [llvm-rc] Allow string table values split into multiple string literals 2020-08-05 08:59:32 +03:00
ResourceScriptToken.cpp
ResourceScriptToken.h
ResourceScriptTokenList.def
ResourceVisitor.h