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

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 15:40:30 PST 2022


ychen added inline comments.


================
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
----------------
rnk wrote:
> 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
yeah, I considered hoisting it to `Path.h` but it does not seem suitable for all cases for JMC and I'm afraid of breaking lldb by touching `path` related code. We should definitely consider a common path style detection function if there are more users in the future.  


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