From Cristina and me: Fix the SubSequentDecls.C

The test #includes a header file which is expected to be reverted.
.storeState and .compareState report that header file is leftover in clang's state.
This is intentionally done, because we cannot free the FileEntry pointing to that
file, because it is referenced all over the Source- and File-Managers. Instead we
clean up the cache of the file so that whoever does a request for that file entry
it will be reread from disk.

Semantically speaking this side effect that store/compare state found must be skipped.
This commit is contained in:
Vassil Vassilev 2013-10-16 14:27:26 +02:00 committed by sftnight
parent 2872bc06d4
commit 2fe6eb0a6c

View File

@ -171,6 +171,12 @@ namespace cling {
E = SM.fileinfo_end(); I != E; ++I) {
const clang::SrcMgr::ContentCache &C = *I->second;
const clang::FileEntry *FE = C.OrigEntry;
// Our error recovery purges the cache of the FileEntry, but keeps
// the FileEntry's pointer so that if it was used by smb (like the
// SourceManager) it wouldn't be dangling. In that case we shouldn't
// print the FileName, because semantically it is not there.
if (!FE->getSize() && !FE->getModificationTime())
continue;
std::string fileName(FE->getName());
if (!(fileName.compare(0, 5, "/usr/") == 0 &&
fileName.find("/bits/") != std::string::npos)) {