summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-16 20:05:18 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-16 20:05:18 +0000
commit9dc3212f98f1b6605cc5b4af7d047d0a2a1334ce (patch)
treefa54710fef94dd0fb7dc2695d6fa9e7c7b834df7 /clang/lib/Basic/SourceManager.cpp
parentde2ac70c0a37a6f34296f76b5b78704d7970f532 (diff)
downloadbcm5719-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.cpp1
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,
OpenPOWER on IntegriCloud