[PATCH] D44290: Handle mixed-OS paths in DWARF reader

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 10 14:43:23 PST 2018


zturner added a comment.

Is there some kind of field we can write inside the DWARF that can tell us what path syntax to assume?  I'm a little weary about trying to guess.  It seems like there could be lots of edge cases where we incorrectly determine what syntax a path is using.



================
Comment at: lib/DebugInfo/DWARF/DWARFDebugLine.cpp:956
 
+static bool isPathAbsoluteOnWindowsOrPosix(const Twine &Path) {
+  // Debug info can contain paths from any OS, not necessarily
----------------
aprantl wrote:
> Shouldn't this function be provided in libSupport? For example, by adding a new enumerator sys::path::Style::any ?
It seems pretty special purpose.  If we were going to put something in support I would rather have it be something like `sys::path::guess_path_syntax(const Twine &Path)`


https://reviews.llvm.org/D44290





More information about the llvm-commits mailing list