LLVMReactorDebugInfo: fix location filename always "<unknown>" on Windows

This filename is output in the emitted asm files when ENABLE_RR_EMIT_ASM_FILE is enabled, but on Windows, it was always "<unknown>". Fixed this by splitting out the name by backslash as well. Bug: b/174358505 Change-Id: Ie5386fa50fd8a6aa43a48bc6fa5fcf987936aacf Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51750 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent aedd133c
......@@ -56,7 +56,11 @@ __pragma(warning(push))
std::pair<llvm::StringRef, llvm::StringRef> splitPath(const char *path)
{
auto dirAndFile = llvm::StringRef(path).rsplit('/');
# ifdef _WIN32
auto dirAndFile = llvm::StringRef(path).rsplit('\\');
# else
auto dirAndFile = llvm::StringRef(path).rsplit('/');
# endif
if(dirAndFile.second == "")
{
dirAndFile.second = "<unknown>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment