[PATCH] D121236: [JMCInstrument] infer proper path style based on debug info

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 15:04:45 PST 2022


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm, thanks!



================
Comment at: llvm/lib/CodeGen/JMCInstrumenter.cpp:72
+  sys::path::Style PathStyle =
+      has_root_name(SP.getDirectory(), sys::path::Style::windows_backslash) ||
+              SP.getDirectory().find("\\") != StringRef::npos
----------------
I see, I was hoping we already had an auto-detector routine. We have an existing one in the VFS code, but it's inaccessible from here, and your logic seems slightly better:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Support/VirtualFileSystem.cpp#L1059


================
Comment at: llvm/test/Instrumentation/JustMyCode/jmc-instrument.ll:136
+!6 = !DIFile(filename: "./b/./../b/x.c", directory: "C:/a")
+!7 = !DIFile(filename: "./b/.\\../b/x.c", directory: "a\\d/p")
+!8 = !DIFile(filename: "./b/./../b/x.c", directory: "a/d/p")
----------------
Thanks for the tests


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121236/new/

https://reviews.llvm.org/D121236



More information about the llvm-commits mailing list