<div dir="ltr"><div dir="ltr">Reverted:<div><a href="http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/4351">http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/4351</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 15, 2019 at 11:07 AM Galina Kistanova via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hello Jan,<br><br>It looks like this commit broke tests on couple of win builders:</div><div dir="ltr"><a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/23655" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/23655</a><br><a href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win</a><br>. . .<br>Failing Tests (1):<br> Clang-Unit :: Basic/./BasicTests.exe/FileManagerTest.getFileDontOpenRealPath<br><br>Please have a look ASAP?<br><br>Thanks<br><br>Galina<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 14, 2019 at 3:02 PM Jan Korous via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: jkorous<br>
Date: Thu Feb 14 15:02:35 2019<br>
New Revision: 354075<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=354075&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=354075&view=rev</a><br>
Log:<br>
[clang][FileManager] fillRealPathName even if we aren't opening the file<br>
<br>
The pathname wasn't previously filled when the getFile() method was called with openFile = false.<br>
We are caching FileEntry-s in ParsedAST::Includes in clangd and this caused the problem.<br>
<br>
This fixes an internal test failure in clangd - ClangdTests.GoToInclude.All<br>
<br>
rdar://47536127<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D58213" rel="noreferrer" target="_blank">https://reviews.llvm.org/D58213</a><br>
<br>
Modified:<br>
cfe/trunk/lib/Basic/FileManager.cpp<br>
cfe/trunk/unittests/Basic/FileManagerTest.cpp<br>
<br>
Modified: cfe/trunk/lib/Basic/FileManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=354075&r1=354074&r2=354075&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=354075&r1=354074&r2=354075&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Basic/FileManager.cpp (original)<br>
+++ cfe/trunk/lib/Basic/FileManager.cpp Thu Feb 14 15:02:35 2019<br>
@@ -267,6 +267,9 @@ const FileEntry *FileManager::getFile(St<br>
if (UFE.File) {<br>
if (auto PathName = UFE.File->getName())<br>
fillRealPathName(&UFE, *PathName);<br>
+ } else if (!openFile) {<br>
+ // We should still fill the path even if we aren't opening the file.<br>
+ fillRealPathName(&UFE, InterndFileName);<br>
}<br>
return &UFE;<br>
}<br>
<br>
Modified: cfe/trunk/unittests/Basic/FileManagerTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/FileManagerTest.cpp?rev=354075&r1=354074&r2=354075&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/FileManagerTest.cpp?rev=354075&r1=354074&r2=354075&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/unittests/Basic/FileManagerTest.cpp (original)<br>
+++ cfe/trunk/unittests/Basic/FileManagerTest.cpp Thu Feb 14 15:02:35 2019<br>
@@ -346,4 +346,18 @@ TEST_F(FileManagerTest, getVirtualFileFi<br>
EXPECT_EQ(file->tryGetRealPathName(), ExpectedResult);<br>
}<br>
<br>
+TEST_F(FileManagerTest, getFileDontOpenRealPath) {<br>
+ auto statCache = llvm::make_unique<FakeStatCache>();<br>
+ statCache->InjectDirectory("/tmp/abc", 42);<br>
+ SmallString<64> Path("/tmp/abc/foo.cpp");<br>
+ statCache->InjectFile(Path.str().str().c_str(), 43);<br>
+ manager.setStatCache(std::move(statCache));<br>
+<br>
+ const FileEntry *file = manager.getFile(Path, /*openFile=*/false);<br>
+<br>
+ ASSERT_TRUE(file != nullptr);<br>
+<br>
+ ASSERT_EQ(file->tryGetRealPathName(), Path);<br>
+}<br>
+<br>
} // anonymous namespace<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>