diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-14 05:02:58 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-14 05:02:58 +0000 |
commit | fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6 (patch) | |
tree | 093ac406bd59d18b3971e52091ad0204b6e0032a /clang/lib/Basic/SourceManager.cpp | |
parent | 526ff155467dd70f79ee8bcf65a801a0f989b19e (diff) | |
download | llvm-fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6.zip llvm-fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6.tar.gz llvm-fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6.tar.bz2 |
[modules] Add an experimental -cc1 feature to embed the contents of an input
file in the .pcm files. This allows a smaller set of files to be sent to a
remote build worker when building with explicit modules (for instance, module
map files need not be sent along with the corresponding precompiled modules).
This doesn't actually make the embedded files visible to header search, so
it's not useful as a packaging format for public header files.
llvm-svn: 245028
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 8954c8f..32894f2 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -678,6 +678,13 @@ 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. + const SrcMgr::ContentCache *CC = getOrCreateContentCache(File); + const_cast<SrcMgr::ContentCache *>(CC)->BufferOverridden = true; +} + StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const { bool MyInvalid = false; const SLocEntry &SLoc = getSLocEntry(FID, &MyInvalid); |