From ab8f622c79b27bc606da043e8dcbd417b8ade725 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Thu, 30 Mar 2023 15:01:21 -0400 Subject: [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 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp') 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; } -- cgit v1.1