diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-16 20:05:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-16 20:05:18 +0000 |
commit | 9dc3212f98f1b6605cc5b4af7d047d0a2a1334ce (patch) | |
tree | fa54710fef94dd0fb7dc2695d6fa9e7c7b834df7 /clang/lib/Basic/SourceManager.cpp | |
parent | de2ac70c0a37a6f34296f76b5b78704d7970f532 (diff) | |
download | bcm5719-llvm-9dc3212f98f1b6605cc5b4af7d047d0a2a1334ce.tar.gz bcm5719-llvm-9dc3212f98f1b6605cc5b4af7d047d0a2a1334ce.zip |
Implement (de-)serialization of the buffer contents for an overridden
file in the source manager. This allows us to properly create and use
modules described by module map files without umbrella headers (or
with incompletely umbrella headers). More generally, we can actually
build a PCH file that makes use of file -> buffer remappings, which
could be useful in libclang in the future.
llvm-svn: 144830
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index ddb1f39d1d6..cdaff2f0082 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -580,6 +580,7 @@ void SourceManager::overrideFileContents(const FileEntry *SourceFile, assert(IR && "getOrCreateContentCache() cannot return NULL"); const_cast<SrcMgr::ContentCache *>(IR)->replaceBuffer(Buffer, DoNotFree); + const_cast<SrcMgr::ContentCache *>(IR)->BufferOverridden = true; } void SourceManager::overrideFileContents(const FileEntry *SourceFile, |