[PATCH] D58213: [FileManager] fillRealPathName even if we aren't opening the file
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 14 12:56:18 PST 2019
arphaman added inline comments.
================
Comment at: lib/Basic/FileManager.cpp:271
+ } else if (!openFile) {
+ // Since we didn't return early after getStatValue() call the file exists.
+ fillRealPathName(&UFE, InterndFileName);
----------------
jkorous wrote:
> arphaman wrote:
> > I don't really understand what this comment is trying to say. Can you rephrase it?
> Please see the above comment (line 214).
>
> What I meant is that it's guaranteed that the file exists as we would have returned otherwise. Does that make sense?
>
> Any suggestion how to rephrase the comment? (Or shall I just remove it?)
The throwback here is unnecessary. You can just say that RealFilePath should still be filled even for `stat`s.
================
Comment at: unittests/Basic/FileManagerTest.cpp:357
+
+ const FileEntry *file = manager.getFile(Path);
+
----------------
NIT: You might want to make `OpenFile = false` explicit to emphasize the stat.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58213/new/
https://reviews.llvm.org/D58213
More information about the cfe-commits
mailing list