[PATCH] D30668: Add llvm::sys::fs::real_path

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 17:05:29 PST 2017


zturner updated this revision to Diff 91240.
zturner added a comment.

Fixed a few edge cases and removed a few copies, making things slightly more efficient.

Also, I responded yesterday but for some reason I don't see it showing up on the review.  So just to make sure everyone got it: @mgorny LLVM already has `realpath`-like functionality built in, it's just cumbersome to use.  You can do it by calling `openFileForRead` and passing an optional output parameter.  A search of the codebase shows that a few clients are already using this (mostly in clang).  Unfortunately though, it doesn't work for directories on Windows.  And as mentioned, it's a clunky interface if the *only* thing you want is the path.

In any case, I'll leave this up for another day in case anyone has further comments.


https://reviews.llvm.org/D30668

Files:
  llvm/include/llvm/Support/FileSystem.h
  llvm/lib/Support/Unix/Path.inc
  llvm/lib/Support/Windows/Path.inc
  llvm/unittests/Support/Path.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30668.91240.patch
Type: text/x-patch
Size: 9106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170310/b00715a4/attachment.bin>


More information about the llvm-commits mailing list