diff options
Diffstat (limited to 'clang/include/clang')
| -rw-r--r-- | clang/include/clang/AST/ASTDiagnostic.h | 1 | ||||
| -rw-r--r-- | clang/include/clang/Analysis/AnalysisDiagnostic.h | 1 | ||||
| -rw-r--r-- | clang/include/clang/Basic/Diagnostic.h | 21 | ||||
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticCommonKinds.def | 12 | ||||
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticKinds.def | 33 | ||||
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticLexKinds.def | 4 | ||||
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.def | 8 | ||||
| -rw-r--r-- | clang/include/clang/Driver/DriverDiagnostic.h | 25 | ||||
| -rw-r--r-- | clang/include/clang/Lex/LexDiagnostic.h | 1 | ||||
| -rw-r--r-- | clang/include/clang/Parse/ParseDiagnostic.h | 1 | 
10 files changed, 28 insertions, 79 deletions
diff --git a/clang/include/clang/AST/ASTDiagnostic.h b/clang/include/clang/AST/ASTDiagnostic.h index ddb5b404e4a..f08cb33e37a 100644 --- a/clang/include/clang/AST/ASTDiagnostic.h +++ b/clang/include/clang/AST/ASTDiagnostic.h @@ -18,6 +18,7 @@ namespace clang {  #define DIAG(ENUM,FLAGS,DESC) ENUM,  #define ASTSTART  #include "clang/Basic/DiagnosticASTKinds.def" +#undef DIAG        NUM_BUILTIN_AST_DIAGNOSTICS      };    }  // end namespace diag diff --git a/clang/include/clang/Analysis/AnalysisDiagnostic.h b/clang/include/clang/Analysis/AnalysisDiagnostic.h index 1f2f0891005..f01170a9256 100644 --- a/clang/include/clang/Analysis/AnalysisDiagnostic.h +++ b/clang/include/clang/Analysis/AnalysisDiagnostic.h @@ -18,6 +18,7 @@ namespace clang {  #define DIAG(ENUM,FLAGS,DESC) ENUM,  #define ANALYSISSTART  #include "clang/Basic/DiagnosticAnalysisKinds.def" +#undef DIAG        NUM_BUILTIN_ANALYSIS_DIAGNOSTICS      };    }  // end namespace diag diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h index d9d32bcc5d2..2f3184c46b7 100644 --- a/clang/include/clang/Basic/Diagnostic.h +++ b/clang/include/clang/Basic/Diagnostic.h @@ -18,13 +18,6 @@  #include <string>  #include <cassert> -#define DIAG_START_LEX                              300 -#define DIAG_START_PARSE    (DIAG_START_LEX      +  300) -#define DIAG_START_AST      (DIAG_START_PARSE    +  300) -#define DIAG_START_SEMA     (DIAG_START_AST      +  100) -#define DIAG_START_ANALYSIS (DIAG_START_SEMA     + 1000) -#define DIAG_UPPER_LIMIT    (DIAG_START_ANALYSIS +  100) -  namespace llvm {    template <typename T> class SmallVectorImpl;  } @@ -38,6 +31,16 @@ namespace clang {    // Import the diagnostic enums themselves.    namespace diag { +    // Start position for diagnostics. +    enum { +      DIAG_START_LEX      =                        300, +      DIAG_START_PARSE    = DIAG_START_LEX      +  300, +      DIAG_START_AST      = DIAG_START_PARSE    +  300, +      DIAG_START_SEMA     = DIAG_START_AST      +  100, +      DIAG_START_ANALYSIS = DIAG_START_SEMA     + 1000, +      DIAG_UPPER_LIMIT    = DIAG_START_ANALYSIS +  100 +    }; +      class CustomDiagInfo;      /// diag::kind - All of the diagnostics that can be emitted by the frontend. @@ -93,7 +96,7 @@ private:    /// DiagMappings - Mapping information for diagnostics.  Mapping info is    /// packed into two bits per diagnostic. -  unsigned char DiagMappings[DIAG_UPPER_LIMIT/4]; +  unsigned char DiagMappings[diag::DIAG_UPPER_LIMIT/4];    /// ErrorOccurred - This is set to true when an error is emitted, and is    /// sticky. @@ -155,7 +158,7 @@ public:    /// setDiagnosticMapping - This allows the client to specify that certain    /// warnings are ignored.  Only NOTEs, WARNINGs, and EXTENSIONs can be mapped.    void setDiagnosticMapping(diag::kind Diag, diag::Mapping Map) { -    assert(Diag < DIAG_UPPER_LIMIT && +    assert(Diag < diag::DIAG_UPPER_LIMIT &&             "Can only map builtin diagnostics");      assert(isBuiltinNoteWarningOrExtension(Diag) && "Cannot map errors!");      unsigned char &Slot = DiagMappings[Diag/4]; diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.def b/clang/include/clang/Basic/DiagnosticCommonKinds.def index 73863215370..019e9c0de80 100644 --- a/clang/include/clang/Basic/DiagnosticCommonKinds.def +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.def @@ -65,19 +65,7 @@ DIAG(note_invalid_subexpr_in_ice, NOTE,  // Driver  DIAG(pp_macro_not_used, WARNING,    // -Wunused-macros       "macro is not used") -DIAG(warn_floatingpoint_eq, WARNING, -  "comparing floating point with == or != is unsafe") -DIAG(warn_objc_property_attr_mutually_exclusive, WARNING, -     "property attributes '%0' and '%1' are mutually exclusive") -DIAG(warn_printf_not_string_constant, WARNING, -     "format string is not a string literal (potentially insecure)") -DIAG(warn_implicit_function_decl, WARNING, -     "implicit declaration of function %0")  DIAG(err_pp_I_dash_not_supported, ERROR,       "-I- not supported, please use -iquote instead") -DIAG(warn_octal_escape_too_large, EXTWARN, -     "octal escape sequence out of range") -DIAG(warn_hex_escape_too_large, EXTWARN, -     "hex escape sequence out of range")  DIAG(warn_pp_undef_identifier, WARNING,       "%0 is not defined, evaluates to 0") diff --git a/clang/include/clang/Basic/DiagnosticKinds.def b/clang/include/clang/Basic/DiagnosticKinds.def index 70a4821ea17..e69de29bb2d 100644 --- a/clang/include/clang/Basic/DiagnosticKinds.def +++ b/clang/include/clang/Basic/DiagnosticKinds.def @@ -1,33 +0,0 @@ -//===-- DiagnosticKinds.def - C Family Diagnostic Kind Database -*- C++ -*-===// -// -//                     The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -//  This file defines the DiagnosticKind database. -// -//===----------------------------------------------------------------------===// - -// Flags for diagnostic: -// -//   DIAG_TYPE - Allows one of: -//     NOTE      - Informational message. -//     WARNING   - Warning. -//     EXTENSION - Notification that an extension to the language is being used. -//     EXTWARN   - Warning for behaviour that is supported as an extension. This  -//                 differs from EXTENSION in that the warning is always emitted -//                 by default. -//     ERROR     - Error, compilation will stop after parsing completes. - - -#include "clang/Basic/DiagnosticCommonKinds.def" -#include "clang/Basic/DiagnosticLexKinds.def" -#include "clang/Basic/DiagnosticParseKinds.def" -#include "clang/Basic/DiagnosticASTKinds.def" -#include "clang/Basic/DiagnosticSemaKinds.def" -#include "clang/Basic/DiagnosticAnalysisKinds.def" - -#undef DIAG diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.def b/clang/include/clang/Basic/DiagnosticLexKinds.def index 69656989644..8c9a82688a7 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.def +++ b/clang/include/clang/Basic/DiagnosticLexKinds.def @@ -98,6 +98,10 @@ DIAG(ext_binary_literal, EXTENSION,       "binary integer literals are an extension")  DIAG(err_pascal_string_too_long, ERROR,      "Pascal string is too long") +DIAG(warn_octal_escape_too_large, EXTWARN, +     "octal escape sequence out of range") +DIAG(warn_hex_escape_too_large, EXTWARN, +     "hex escape sequence out of range")  //===----------------------------------------------------------------------===//  // Preprocessor Diagnostics diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.def b/clang/include/clang/Basic/DiagnosticSemaKinds.def index 6276d61211f..63955adc13e 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.def +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.def @@ -74,6 +74,8 @@ DIAG(err_parameter_name_omitted, ERROR,       "parameter name omitted")  DIAG(warn_decl_in_param_list, WARNING,       "declaration of %0 will not be visible outside of this function") +DIAG(warn_implicit_function_decl, WARNING, +     "implicit declaration of function %0")  DIAG(err_declarator_need_ident, ERROR,       "declarator requires an identifier") @@ -196,6 +198,8 @@ DIAG(error_duplicate_ivar_use, ERROR,       "synthesized properties %0 and %1 both claim ivar %2")  DIAG(error_property_implemented, ERROR,       "property %0 is already implemented") +DIAG(warn_objc_property_attr_mutually_exclusive, WARNING, +     "property attributes '%0' and '%1' are mutually exclusive")  // C++ class members  DIAG(err_storageclass_invalid_for_member, ERROR, @@ -624,6 +628,8 @@ DIAG(err_offsetof_array_type, ERROR,       "offsetof requires array type, %0 invalid")  DIAG(ext_offsetof_extended_field_designator, EXTENSION,       "using extended field designator is an extension") +DIAG(warn_floatingpoint_eq, WARNING, +  "comparing floating point with == or != is unsafe")  DIAG(err_typecheck_subscript_value, ERROR,       "subscripted value is neither array nor pointer") @@ -721,6 +727,8 @@ DIAG(err_builtin_direct_init_more_than_one_arg, ERROR,       "initializer of a builtin type can only take one argument")  DIAG(err_value_init_for_array_type, ERROR,       "array types cannot be value-initialized") +DIAG(warn_printf_not_string_constant, WARNING, +     "format string is not a string literal (potentially insecure)")  DIAG(err_unexpected_interface, ERROR,       "unexpected interface name %0: expected expression") diff --git a/clang/include/clang/Driver/DriverDiagnostic.h b/clang/include/clang/Driver/DriverDiagnostic.h index 459d17da4e4..e69de29bb2d 100644 --- a/clang/include/clang/Driver/DriverDiagnostic.h +++ b/clang/include/clang/Driver/DriverDiagnostic.h @@ -1,25 +0,0 @@ -//===--- DiagnosticDriver.h - Diagnostics for the driver --------*- C++ -*-===// -// -//                     The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_DIAGNOSTICDRIVER_H -#define LLVM_CLANG_DIAGNOSTICDRIVER_H - -#include "clang/Basic/Diagnostic.h" - -namespace clang { -  namespace diag {  -    enum { -// FIXME: REMOVE?? -      NUM_BUILTIN_DRIVER_DIAGNOSTICS -    }; -  }  // end namespace diag -}  // end namespace clang - -#endif - diff --git a/clang/include/clang/Lex/LexDiagnostic.h b/clang/include/clang/Lex/LexDiagnostic.h index 202605fe5ce..8e79e15f6d0 100644 --- a/clang/include/clang/Lex/LexDiagnostic.h +++ b/clang/include/clang/Lex/LexDiagnostic.h @@ -18,6 +18,7 @@ namespace clang {  #define DIAG(ENUM,FLAGS,DESC) ENUM,  #define LEXSTART  #include "clang/Basic/DiagnosticLexKinds.def" +#undef DIAG        NUM_BUILTIN_LEX_DIAGNOSTICS      };    }  // end namespace diag diff --git a/clang/include/clang/Parse/ParseDiagnostic.h b/clang/include/clang/Parse/ParseDiagnostic.h index 52a89e89041..1856b0670bb 100644 --- a/clang/include/clang/Parse/ParseDiagnostic.h +++ b/clang/include/clang/Parse/ParseDiagnostic.h @@ -18,6 +18,7 @@ namespace clang {  #define DIAG(ENUM,FLAGS,DESC) ENUM,  #define PARSESTART  #include "clang/Basic/DiagnosticParseKinds.def" +#undef DIAG        NUM_BUILTIN_PARSE_DIAGNOSTICS      };    }  // end namespace diag  | 

