From ad7245b90fe9edd01b663f0e17521c9ae42d619e Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sun, 22 Jun 2014 21:58:33 +0000 Subject: DiagnosticIDs: use diagnostic severities to simplify extension handling git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211479 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Diagnostic.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'include/clang') diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index b9da131de3..71642a9b7e 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -146,13 +146,6 @@ public: Fatal = DiagnosticIDs::Fatal }; - /// \brief How do we handle otherwise-unmapped extension? - /// - /// This is controlled by -pedantic and -pedantic-errors. - enum ExtensionHandling { - Ext_Ignore, Ext_Warn, Ext_Error - }; - enum ArgumentKind { ak_std_string, ///< std::string ak_c_string, ///< const char * @@ -190,7 +183,7 @@ private: // 0 -> no limit. unsigned ConstexprBacktraceLimit; // Cap on depth of constexpr evaluation // backtrace stack, 0 -> no limit. - ExtensionHandling ExtBehavior; // Map extensions onto warnings or errors? + diag::Severity ExtBehavior; // Map extensions to warnings or errors? IntrusiveRefCntPtr Diags; IntrusiveRefCntPtr DiagOpts; DiagnosticConsumer *Client; @@ -523,10 +516,8 @@ public: /// mapped onto ignore/warning/error. /// /// This corresponds to the GCC -pedantic and -pedantic-errors option. - void setExtensionHandlingBehavior(ExtensionHandling H) { - ExtBehavior = H; - } - ExtensionHandling getExtensionHandlingBehavior() const { return ExtBehavior; } + void setExtensionHandlingBehavior(diag::Severity H) { ExtBehavior = H; } + diag::Severity getExtensionHandlingBehavior() const { return ExtBehavior; } /// \brief Counter bumped when an __extension__ block is/ encountered. /// -- cgit v1.2.3