Commit Graph

3 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis c137d0d62f [PCH] Fix reading from PCH of diagnostic pragmas.
In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize
the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations
leading to crash because the main FileID was not yet initialized.

Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking
invariants. Fix this by having the ASTReader set up the internal state directly.

llvm-svn: 144153
2011-11-09 01:24:17 +00:00
Argyrios Kyrtzidis f50f7b2c65 [libclang] Fix crash when a #pragma diagnostic is included in the preamble.
A PCH file keeps track of #pragma diagnostics state; when loading the preamble, they conflicted
with the #pragma diagnostic state already present in the DiagnosticsEngine object due to
parsing the preamble.

Fix this by clearing the state of the DiagnosticsEngine object.
Fixes rdar://10363572 && http://llvm.org/PR11254.

llvm-svn: 143644
2011-11-03 20:28:19 +00:00
Argyrios Kyrtzidis bbbeea11a8 For Diagnostic::Reset() also reset the state related to #pragma diagnostic. Fixes rdar://9170766.
llvm-svn: 128346
2011-03-26 18:58:17 +00:00