[PATCH] D45473: CodeGen: Don't try to canonicalize Unix-style paths in CodeView debug info.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 9 19:40:58 PDT 2018


pcc added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:117-125
+  // If this is a Unix-style path, just use it as is. Don't try to canonicalize
+  // it textually because one of the path components could be a symlink.
+  if (!Dir.empty() && Dir[0] == '/') {
+    Filepath = Dir;
+    if (Dir.back() != '/')
+      Filepath += '/';
+    Filepath += Filename;
----------------
zturner wrote:
> Shouldn't we instead just use something like `LLVM_ON_WIN32` etc?
I don't think so. Imagine that you have something like a ThinLTO distributed build where bitcode files are copied to a remote machine where code generation happens. In that case the code generator won't necessarily be running the same operating system as the bitcode producer was, and the consumer of the object file will be expecting a path style consistent with the bitcode producer.


https://reviews.llvm.org/D45473





More information about the llvm-commits mailing list