From 9dc3212f98f1b6605cc5b4af7d047d0a2a1334ce Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 16 Nov 2011 20:05:18 +0000 Subject: 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 --- clang/lib/Basic/SourceManager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Basic/SourceManager.cpp') 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(IR)->replaceBuffer(Buffer, DoNotFree); + const_cast(IR)->BufferOverridden = true; } void SourceManager::overrideFileContents(const FileEntry *SourceFile, -- cgit v1.2.3