forked from OSchip/llvm-project
If we're dealing with an overridden buffer in the AST reader, load the
file as a virtual file with the stored modification time and size. llvm-svn: 144916
This commit is contained in:
parent
14c62c8d02
commit
be51458dc3
|
@ -1091,8 +1091,10 @@ ASTReader::ASTReadResult ASTReader::ReadSLocEntryRecord(int ID) {
|
|||
std::string OrigFilename(BlobStart, BlobStart + BlobLen);
|
||||
std::string Filename = OrigFilename;
|
||||
MaybeAddSystemRootToFilename(Filename);
|
||||
const FileEntry *File = FileMgr.getFile(Filename, /*OpenFile=*/false,
|
||||
/*CacheFailure=*/!OverriddenBuffer);
|
||||
const FileEntry *File =
|
||||
OverriddenBuffer? FileMgr.getVirtualFile(Filename, (off_t)Record[4],
|
||||
(time_t)Record[5])
|
||||
: FileMgr.getFile(Filename, /*OpenFile=*/false);
|
||||
if (File == 0 && !OriginalDir.empty() && !CurrentDir.empty() &&
|
||||
OriginalDir != CurrentDir) {
|
||||
std::string resolved = resolveFileRelativeToOriginalDir(Filename,
|
||||
|
|
Loading…
Reference in New Issue