[PATCH] D81041: Use existing path sep style in clang::FileManager::FixupRelativePath

Adrian McCarthy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 15:59:07 PDT 2020


amccarth added a comment.

In D81041#2072396 <https://reviews.llvm.org/D81041#2072396>, @ctetreau wrote:

> After some further investigation, I have come to believe that the root cause of the issue I am seeing is on line 783 of clang/lib/Lex/HeaderSearch.cpp. A path is constructed using string concatenation (dir + '/' + file), which is obviously not robust to the various issues in path construction. A fix had been committed and reverted back in 2015.


When I was fixing portability problems with VFS paths, I started out by trying to make paths canonical, and that always led to roadblocks.  A clang developer told me that clang philosophically does not try to do any regularization of paths.  It turns out that's actually key to making VFS paths viable.  Since they can truly consist of a mix of styles, there is no "correct" canonical form.  Once I took that approach, most of the VFS portability problems were simple to fix without inflicting collateral damage.  So I'm not surprised that the 2015 "fix" causes problems.

I'm happy to look at future proposals, and I'll CC myself on that bug report.  But since you've said you have other priorities now, I'll treat this patch as dormant.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81041





More information about the cfe-commits mailing list