[PATCH] D49197: FileManager: Try to compute RealPathName in getVirtualFile

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 11 11:42:06 PDT 2018


ioeric added inline comments.


================
Comment at: lib/Basic/FileManager.cpp:395
+  SmallString<128> RealPathName;
+  if (!FS->getRealPath(InterndFileName, RealPathName))
+    UFE->RealPathName = RealPathName.str();
----------------
It seems that at this point, we have failed to find `FileName` in vfs (with `getStatValue` above), so `getRealPath` would also fail? 

In general, the virtual file here can be an actual *virtual* file that doesn't exist anywhere, and I think there are users who use this to map virtual file (possibly with relative paths) into file manager (while they should really use overlay vfs!).


Repository:
  rC Clang

https://reviews.llvm.org/D49197





More information about the cfe-commits mailing list