Fix diagnostic pragmas.

Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

llvm-svn: 121873
This commit is contained in:
Argyrios Kyrtzidis
2010-12-15 18:44:22 +00:00
parent 1066ef6b24
commit 1cb0de1d4c
23 changed files with 455 additions and 118 deletions

View File

@@ -110,6 +110,11 @@ bool FullSourceLoc::isInSystemHeader() const {
return SrcMgr->isInSystemHeader(*this);
}
bool FullSourceLoc::isBeforeInTranslationUnitThan(SourceLocation Loc) const {
assert(isValid());
return SrcMgr->isBeforeInTranslationUnit(*this, Loc);
}
const char *FullSourceLoc::getCharacterData(bool *Invalid) const {
assert(isValid());
return SrcMgr->getCharacterData(*this, Invalid);