forked from OSchip/llvm-project
Revert r354075 "[clang][FileManager] fillRealPathName even if we aren't opening the file"
The new test doesn't pass on Windows. llvm-svn: 354169
This commit is contained in:
parent
63c300cfc1
commit
e2bb3121fd
|
@ -267,9 +267,6 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile,
|
|||
if (UFE.File) {
|
||||
if (auto PathName = UFE.File->getName())
|
||||
fillRealPathName(&UFE, *PathName);
|
||||
} else if (!openFile) {
|
||||
// We should still fill the path even if we aren't opening the file.
|
||||
fillRealPathName(&UFE, InterndFileName);
|
||||
}
|
||||
return &UFE;
|
||||
}
|
||||
|
|
|
@ -346,18 +346,4 @@ TEST_F(FileManagerTest, getVirtualFileFillsRealPathName) {
|
|||
EXPECT_EQ(file->tryGetRealPathName(), ExpectedResult);
|
||||
}
|
||||
|
||||
TEST_F(FileManagerTest, getFileDontOpenRealPath) {
|
||||
auto statCache = llvm::make_unique<FakeStatCache>();
|
||||
statCache->InjectDirectory("/tmp/abc", 42);
|
||||
SmallString<64> Path("/tmp/abc/foo.cpp");
|
||||
statCache->InjectFile(Path.str().str().c_str(), 43);
|
||||
manager.setStatCache(std::move(statCache));
|
||||
|
||||
const FileEntry *file = manager.getFile(Path, /*openFile=*/false);
|
||||
|
||||
ASSERT_TRUE(file != nullptr);
|
||||
|
||||
ASSERT_EQ(file->tryGetRealPathName(), Path);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
|
Loading…
Reference in New Issue