This is an archive of the discontinued LLVM Phabricator instance.

[FileManager] fillRealPathName even if we aren't opening the file
ClosedPublic

Authored by jkorous on Feb 13 2019, 3:32 PM.

Diff Detail

Event Timeline

jkorous created this revision.Feb 13 2019, 3:32 PM

@sammccall I think you touched this part of the code recently in r352079 (revert of r347205).

arphaman added inline comments.Feb 14 2019, 12:41 PM
lib/Basic/FileManager.cpp
271

I don't really understand what this comment is trying to say. Can you rephrase it?

unittests/Basic/FileManagerTest.cpp
349

Please leave this comment out

jkorous marked 2 inline comments as done.Feb 14 2019, 12:46 PM

Thanks for taking a look!

lib/Basic/FileManager.cpp
214

If we can't stat the file we return here.

271

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?)

jkorous marked an inline comment as done.Feb 14 2019, 12:49 PM
jkorous added inline comments.
unittests/Basic/FileManagerTest.cpp
349

Sure, no problem.

Just so I understand it - when it is appropriate to quote the radar? I see a lot of them in clang/test. Are these just from the "ancient" history?

arphaman added inline comments.Feb 14 2019, 12:55 PM
lib/Basic/FileManager.cpp
271

The throwback here is unnecessary. You can just say that RealFilePath should still be filled even for stats.

unittests/Basic/FileManagerTest.cpp
357

NIT: You might want to make OpenFile = false explicit to emphasize the stat.

arphaman added inline comments.Feb 14 2019, 12:58 PM
unittests/Basic/FileManagerTest.cpp
349

There are some radars but that doesn't mean we should still be adding them. They don't provide any context or value for the developers here, especially in a comment. For a unit test like this the name should generally provide some form of self-contained description of the scenario, which it does here. I would recommend leaving the radar number in a commit message instead.

jkorous updated this revision to Diff 186906.Feb 14 2019, 1:16 PM
  • comments
  • explicit openFile = false in test
jkorous marked 4 inline comments as done.Feb 14 2019, 1:17 PM

Updated the patch.

unittests/Basic/FileManagerTest.cpp
349

Got it. Thanks!

This revision is now accepted and ready to land.Feb 14 2019, 1:24 PM
This revision was automatically updated to reflect the committed changes.
jkorous marked an inline comment as done.