diff options
| author | Ted Kremenek <kremenek@apple.com> | 2007-12-13 18:12:10 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2007-12-13 18:12:10 +0000 |
| commit | 2f4ab7148c7fa51a4ebfe1e33f771ae106bcec7f (patch) | |
| tree | f454ab9c7824991cf333d651052b7cd7afea5c2a /clang/Basic/SourceManager.cpp | |
| parent | 31dcdb312b1cc3a724a94245a846afd342282ade (diff) | |
| download | bcm5719-llvm-2f4ab7148c7fa51a4ebfe1e33f771ae106bcec7f.tar.gz bcm5719-llvm-2f4ab7148c7fa51a4ebfe1e33f771ae106bcec7f.zip | |
Add hack to SourceManager to support missing source files during
deserialization. Eventually this should be replaced with a lazy-reading
mechanism that only reads source files when they are needed by clients.
llvm-svn: 45007
Diffstat (limited to 'clang/Basic/SourceManager.cpp')
| -rw-r--r-- | clang/Basic/SourceManager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/Basic/SourceManager.cpp b/clang/Basic/SourceManager.cpp index bfa77923b07..22a7cf511f2 100644 --- a/clang/Basic/SourceManager.cpp +++ b/clang/Basic/SourceManager.cpp @@ -441,10 +441,14 @@ void ContentCache::ReadToSourceManager(llvm::Deserializer& D, const char* start = &Buf[0]; const FileEntry* E = FMgr->getFile(start,start+Buf.size()); - assert (E && "Not yet supported: missing files."); - - // Get the ContextCache object and register it with the deserializer. - D.RegisterPtr(PtrID,SMgr.getContentCache(E)); + // FIXME: Ideally we want a lazy materialization of the ContentCache + // anyway, because we don't want to read in source files unless this + // is absolutely needed. + if (!E) + D.RegisterPtr(PtrID,NULL); + else + // Get the ContextCache object and register it with the deserializer. + D.RegisterPtr(PtrID,SMgr.getContentCache(E)); } else { // Register the ContextCache object with the deserializer. |

