summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2019-08-26 20:32:05 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2019-08-26 20:32:05 +0000
commitf5848190854cb19280ae2fa465b6f199ed4f896f (patch)
treefc9d60369abb3b7776e21adf45b7027ccb67b95f /clang/lib/Serialization/ASTWriter.cpp
parent33d563e59ed97d03a7508c06bbff3967d687dede (diff)
downloadbcm5719-llvm-f5848190854cb19280ae2fa465b6f199ed4f896f.tar.gz
bcm5719-llvm-f5848190854cb19280ae2fa465b6f199ed4f896f.zip
ContentCache: Drop getBuffer's dependency on SourceManager
Refactor ContentCache::IsSystemFile to IsFileVolatile, checking SourceManager::userFilesAreVolatile at construction time. This is a step toward lowering ContentCache down from SourceManager to FileManager. No functionality change intended. https://reviews.llvm.org/D66713 llvm-svn: 369958
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index b7066dc3347..0228e4dc978 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1804,12 +1804,12 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr,
InputFileEntry Entry;
Entry.File = Cache->OrigEntry;
- Entry.IsSystemFile = Cache->IsSystemFile;
+ Entry.IsSystemFile = isSystem(File.getFileCharacteristic());
Entry.IsTransient = Cache->IsTransient;
Entry.BufferOverridden = Cache->BufferOverridden;
Entry.IsTopLevelModuleMap = isModuleMap(File.getFileCharacteristic()) &&
File.getIncludeLoc().isInvalid();
- if (Cache->IsSystemFile)
+ if (Entry.IsSystemFile)
SortedFiles.push_back(Entry);
else
SortedFiles.push_front(Entry);
@@ -2315,8 +2315,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
// We add one to the size so that we capture the trailing NULL
// that is required by llvm::MemoryBuffer::getMemBuffer (on
// the reader side).
- const llvm::MemoryBuffer *Buffer
- = Content->getBuffer(PP.getDiagnostics(), PP.getSourceManager());
+ const llvm::MemoryBuffer *Buffer =
+ Content->getBuffer(PP.getDiagnostics(), PP.getFileManager());
StringRef Name = Buffer->getBufferIdentifier();
Stream.EmitRecordWithBlob(SLocBufferAbbrv, Record,
StringRef(Name.data(), Name.size() + 1));
@@ -2330,7 +2330,7 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
// Include the implicit terminating null character in the on-disk buffer
// if we're writing it uncompressed.
const llvm::MemoryBuffer *Buffer =
- Content->getBuffer(PP.getDiagnostics(), PP.getSourceManager());
+ Content->getBuffer(PP.getDiagnostics(), PP.getFileManager());
StringRef Blob(Buffer->getBufferStart(), Buffer->getBufferSize() + 1);
emitBlob(Stream, Blob, SLocBufferBlobCompressedAbbrv,
SLocBufferBlobAbbrv);
OpenPOWER on IntegriCloud