aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ExtensionRAIIObject.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-15 07:01:18 +0000
committerChris Lattner <sabre@nondot.org>2009-04-15 07:01:18 +0000
commit27ceb9d77d929f02a8a811d189a96885629c7c0c (patch)
tree5bdff22c0f05093e02e4aa969b6e35bfa9b60b30 /lib/Parse/ExtensionRAIIObject.h
parentffb4b6e299069139908540ce97be4462e16b53a4 (diff)
Rejigger how -pedantic and -pedantic-errors work and their interaction
with other diagnostic mapping. In the new scheme, -Wfoo or -Wno-foo or -Werror=foo all override the -pedantic options, and __extension__ robustly silences all extension diagnostics in their scope. An added bonus of this change is that MAP_DEFAULT goes away, meaning that per-diagnostic mapping information can now be stored in 2 bits, doubling the density of the Diagnostic::DiagMapping array. This also substantially simplifies Diagnostic::getDiagnosticLevel. OTOH, this temporarily introduces some "macro intensive" code in Diagnostic.cpp. This will be addressed in a later patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ExtensionRAIIObject.h')
-rw-r--r--lib/Parse/ExtensionRAIIObject.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Parse/ExtensionRAIIObject.h b/lib/Parse/ExtensionRAIIObject.h
index 928d443b74..2b2bd3b216 100644
--- a/lib/Parse/ExtensionRAIIObject.h
+++ b/lib/Parse/ExtensionRAIIObject.h
@@ -26,15 +26,13 @@ namespace clang {
void operator=(const ExtensionRAIIObject &); // DO NOT IMPLEMENT
ExtensionRAIIObject(const ExtensionRAIIObject&); // DO NOT IMPLEMENT
Diagnostic &Diags;
- bool OldState;
public:
ExtensionRAIIObject(Diagnostic &diags) : Diags(diags) {
- OldState = Diags.getWarnOnExtensions();
- Diags.setWarnOnExtensions(false);
+ Diags.IncrementAllExtensionsSilenced();
}
~ExtensionRAIIObject() {
- Diags.setWarnOnExtensions(OldState);
+ Diags.DecrementAllExtensionsSilenced();
}
};
}