]> granicus.if.org Git - clang/commit
Add a pretty horrible hack to prevent clang from crashing with inconsistent PCH
authorDaniel Dunbar <daniel@zuster.org>
Sun, 6 Dec 2009 05:43:36 +0000 (05:43 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 6 Dec 2009 05:43:36 +0000 (05:43 +0000)
commit21a8bed504a95df019771ab1a3dc9ecccfd9cfaa
treeeb0091140327707f4b84d3c4d121608bc38f01ed
parentc9c1e9c4b513e83146eff1728142683980df26a7
Add a pretty horrible hack to prevent clang from crashing with inconsistent PCH
files.
 - The issue is that PCH uses a stat cache, which may reference files which have
   been deleted or moved. In such cases ContentCache::getBuffer was returning 0
   but most clients are incapable of dealing with this (i.e., they don't).

   For the time being, resolve this issue by just making up some invalid file
   contents and. Eventually we should detect that we are in an inconsistent
   situation and error out with a nice message that the PCH is out of date.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90699 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/SourceManager.cpp
test/PCH/inconsistent-pch.c [new file with mode: 0644]