@mgorny: it's also worth noting that I'm not adding any new functionality (well, aside from tilde expansion).  openFileForRead already provides realpath functionality.  I'm just providing a wrapper over it, as well as making it work correctly on windows for directories <br><div class="gmail_quote"><div dir="ltr">On Thu, Mar 9, 2017 at 1:40 AM Pavel Labath via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">labath accepted this revision.<br class="gmail_msg">
labath added a comment.<br class="gmail_msg">
This revision is now accepted and ready to land.<br class="gmail_msg">
<br class="gmail_msg">
looks good to me, thank you for the patience. BTW I accidentally stumbled onto this <a href="https://docs.python.org/2/library/os.path.html#os.path.expanduser" rel="noreferrer" class="gmail_msg" target="_blank">https://docs.python.org/2/library/os.path.html#os.path.expanduser</a> yesterday, so it looks like supporting tilde expressions on windows is not without precedent.<br class="gmail_msg">
<br class="gmail_msg">
@mgorny: The immediate motivation is lowering similar code for this in lldb. I am not sure what are all the reasons lldb needs it in the first place, but I can totally believe that it is overusing this (OTOH, lldb only consumes paths, it does not produce them, so it's probably not that critical).  Still, maybe this is another reason to have ~ logic separate from real_path stuff -- then one could still support home directory expansion where it makes sense, without forcing full path resolution.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D30668" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D30668</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>