[cfe-commits] r144916 - /cfe/trunk/lib/Serialization/ASTReader.cpp
Douglas Gregor
dgregor at apple.com
Thu Nov 17 11:08:51 PST 2011
Author: dgregor
Date: Thu Nov 17 13:08:51 2011
New Revision: 144916
URL: http://llvm.org/viewvc/llvm-project?rev=144916&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Serialization/ASTReader.cpp
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=144916&r1=144915&r2=144916&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Thu Nov 17 13:08:51 2011
@@ -1091,8 +1091,10 @@
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,
More information about the cfe-commits
mailing list