summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-11-26 02:04:16 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-11-26 02:04:16 +0000
commita8cfffa3519c11b0eee26a5d1ff9e4a34d46e73b (patch)
tree7fbaa889132819c58e1786928937d540890154f5 /clang/lib/Basic/SourceManager.cpp
parent72734bffaa2e25b1d5bbc4a7a05a22f944d6bf04 (diff)
downloadbcm5719-llvm-a8cfffa3519c11b0eee26a5d1ff9e4a34d46e73b.tar.gz
bcm5719-llvm-a8cfffa3519c11b0eee26a5d1ff9e4a34d46e73b.zip
[modules] Refactor handling of -fmodules-embed-*. Track this properly rather
than reusing the "overridden buffer" mechanism. This will allow us to make embedded files and overridden files behave differently in future. llvm-svn: 254121
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 7abcba1fb73..80a003fc932 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -439,7 +439,7 @@ SourceManager::getOrCreateContentCache(const FileEntry *FileEnt,
}
Entry->IsSystemFile = isSystemFile;
- Entry->BufferOverridden = FilesAreTransient;
+ Entry->IsTransient = FilesAreTransient;
return Entry;
}
@@ -674,11 +674,9 @@ void SourceManager::disableFileContentsOverride(const FileEntry *File) {
OverriddenFilesInfo->OverriddenFilesWithBuffer.erase(File);
}
-void SourceManager::embedFileContentsInModule(const FileEntry *File) {
- // We model an embedded file as a file whose buffer has been overridden
- // by its contents as they are now.
+void SourceManager::setFileIsTransient(const FileEntry *File) {
const SrcMgr::ContentCache *CC = getOrCreateContentCache(File);
- const_cast<SrcMgr::ContentCache *>(CC)->BufferOverridden = true;
+ const_cast<SrcMgr::ContentCache *>(CC)->IsTransient = true;
}
StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const {
OpenPOWER on IntegriCloud