diff options
author | Zequan Wu <zequanwu@google.com> | 2023-03-30 15:01:21 -0400 |
---|---|---|
committer | Zequan Wu <zequanwu@google.com> | 2023-04-17 13:07:42 -0400 |
commit | ab8f622c79b27bc606da043e8dcbd417b8ade725 (patch) | |
tree | 3bedfa0ddf71791be883538825e865d5f3e78a70 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 676a96f768e1101ed5187c7751e56e1e11ebe593 (diff) | |
download | llvm-ab8f622c79b27bc606da043e8dcbd417b8ade725.zip llvm-ab8f622c79b27bc606da043e8dcbd417b8ade725.tar.gz llvm-ab8f622c79b27bc606da043e8dcbd417b8ade725.tar.bz2 |
[DebugInfo] Fix file path separator when targeting windows.
This fixes two problems:
1. When crossing compiling for windows on linux, source file path in debug info is concatenated with directory by host native separator ('/'). For windows local build, they are concatenated by '\'. This causes non-determinism bug.
The solution here is to let `LangOptions.UseTargetPathSeparator` to control if we should use host native separator or not.
2. Objectfile path in CodeView also uses host native separator when generated.
It's fixed by changing the path separator in `/Fo` to '\' if the path is not an absolute path when adding the `-object-file-name=` flag.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D147256
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 86cdd11..5aceb33 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -791,7 +791,6 @@ void CodeViewDebug::emitObjName() { // Don't emit the filename if we're writing to stdout or to /dev/null. PathRef = {}; } else { - llvm::sys::path::remove_dots(PathStore, /*remove_dot_dot=*/true); PathRef = PathStore; } |