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:
parent
2872bc06d4
commit
2fe6eb0a6c
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user