History

gcc-9.1

Wolfgang Thaller committed 7 years ago

Commit 6fbf4221 parent ec13cc931387 files · +2442466 −1054331Browse files

Showing the changes to gcc/libcpp/include/cpplib.h (1 of 31387 files). Show all

Unified · Split

gcc/libcpp/include/cpplib.h+238−150
@@ -1,5 +1,5 @@
11 /* Definitions for CPP library.
2− Copyright (C) 1995-2018 Free Software Foundation, Inc.
2+ Copyright (C) 1995-2019 Free Software Foundation, Inc.
33 Written by Per Bothner, 1994-95.
44
55 This program is free software; you can redistribute it and/or modify it
@@ -36,7 +36,6 @@ typedef struct cpp_macro cpp_macro; · 30 unmodified lines
3636 typedef struct cpp_callbacks cpp_callbacks;
3737 typedef struct cpp_dir cpp_dir;
3838
39−struct answer;
4039 struct _cpp_file;
4140
4241 /* The first three groups, apart from '=', can appear in preprocessor
@@ -168,8 +167,9 @@ enum cpp_ttype · 125 unmodified lines
168167 #undef TK
169168
170169 /* C language kind, used when calling cpp_create_reader. */
171−enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC11, CLK_GNUC17,
170+enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC11, CLK_GNUC17, CLK_GNUC2X,
172171 CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC11, CLK_STDC17,
172+ CLK_STDC2X,
173173 CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX11, CLK_CXX11,
174174 CLK_GNUCXX14, CLK_CXX14, CLK_GNUCXX17, CLK_CXX17,
175175 CLK_GNUCXX2A, CLK_CXX2A, CLK_ASM};
@@ -240,8 +240,10 @@ struct GTY(()) cpp_identifier { · 64 unmodified lines
240240 /* A preprocessing token. This has been carefully packed and should
241241 occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */
242242 struct GTY(()) cpp_token {
243− source_location src_loc; /* Location of first char of token,
244− together with range of full token. */
243+
244+ /* Location of first char of token, together with range of full token. */
245+ location_t src_loc;
246+
245247 ENUM_BITFIELD(cpp_ttype) type : CHAR_BIT; /* token type */
246248 unsigned short flags; /* flags - see above */
247249
@@ -550,6 +552,59 @@ struct cpp_options · 302 unmodified lines
550552 bool canonical_system_headers;
551553 };
552554
555+/* Diagnostic levels. To get a diagnostic without associating a
556+ position in the translation unit with it, use cpp_error_with_line
557+ with a line number of zero. */
558+
559+enum cpp_diagnostic_level {
560+ /* Warning, an error with -Werror. */
561+ CPP_DL_WARNING = 0,
562+ /* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */
563+ CPP_DL_WARNING_SYSHDR,
564+ /* Warning, an error with -pedantic-errors or -Werror. */
565+ CPP_DL_PEDWARN,
566+ /* An error. */
567+ CPP_DL_ERROR,
568+ /* An internal consistency check failed. Prints "internal error: ",
569+ otherwise the same as CPP_DL_ERROR. */
570+ CPP_DL_ICE,
571+ /* An informative note following a warning. */
572+ CPP_DL_NOTE,
573+ /* A fatal error. */
574+ CPP_DL_FATAL
575+};
576+
577+/* Warning reason codes. Use a reason code of CPP_W_NONE for unclassified
578+ warnings and diagnostics that are not warnings. */
579+
580+enum cpp_warning_reason {
581+ CPP_W_NONE = 0,
582+ CPP_W_DEPRECATED,
583+ CPP_W_COMMENTS,
584+ CPP_W_MISSING_INCLUDE_DIRS,
585+ CPP_W_TRIGRAPHS,
586+ CPP_W_MULTICHAR,
587+ CPP_W_TRADITIONAL,
588+ CPP_W_LONG_LONG,
589+ CPP_W_ENDIF_LABELS,
590+ CPP_W_NUM_SIGN_CHANGE,
591+ CPP_W_VARIADIC_MACROS,
592+ CPP_W_BUILTIN_MACRO_REDEFINED,
593+ CPP_W_DOLLARS,
594+ CPP_W_UNDEF,
595+ CPP_W_UNUSED_MACROS,
596+ CPP_W_CXX_OPERATOR_NAMES,
597+ CPP_W_NORMALIZE,
598+ CPP_W_INVALID_PCH,
599+ CPP_W_WARNING_DIRECTIVE,
600+ CPP_W_LITERAL_SUFFIX,
601+ CPP_W_DATE_TIME,
602+ CPP_W_PEDANTIC,
603+ CPP_W_C90_C99_COMPAT,
604+ CPP_W_CXX11_COMPAT,
605+ CPP_W_EXPANSION_TO_DEFINED
606+};
607+
553608 /* Callback for header lookup for HEADER, which is the name of a
554609 source file. It is used as a method of last resort to find headers
555610 that are not otherwise found during the normal include processing.
@@ -571,12 +626,12 @@ struct cpp_callbacks · 15 unmodified lines
571626 void (*file_change) (cpp_reader *, const line_map_ordinary *);
572627
573628 void (*dir_change) (cpp_reader *, const char *);
574− void (*include) (cpp_reader *, source_location, const unsigned char *,
629+ void (*include) (cpp_reader *, location_t, const unsigned char *,
575630 const char *, int, const cpp_token **);
576− void (*define) (cpp_reader *, source_location, cpp_hashnode *);
577− void (*undef) (cpp_reader *, source_location, cpp_hashnode *);
578− void (*ident) (cpp_reader *, source_location, const cpp_string *);
579− void (*def_pragma) (cpp_reader *, source_location);
631+ void (*define) (cpp_reader *, location_t, cpp_hashnode *);
632+ void (*undef) (cpp_reader *, location_t, cpp_hashnode *);
633+ void (*ident) (cpp_reader *, location_t, const cpp_string *);
634+ void (*def_pragma) (cpp_reader *, location_t);
580635 int (*valid_pch) (cpp_reader *, const char *, int);
581636 void (*read_pch) (cpp_reader *, const char *, int, const char *);
582637 missing_header_cb missing_header;
@@ -587,26 +642,29 @@ struct cpp_callbacks · 4 unmodified lines
587642
588643 /* Called to emit a diagnostic. This callback receives the
589644 translated message. */
590− bool (*error) (cpp_reader *, int, int, rich_location *,
591− const char *, va_list *)
645+ bool (*diagnostic) (cpp_reader *,
646+ enum cpp_diagnostic_level,
647+ enum cpp_warning_reason,
648+ rich_location *,
649+ const char *, va_list *)
592650 ATTRIBUTE_FPTR_PRINTF(5,0);
593651
594652 /* Callbacks for when a macro is expanded, or tested (whether
595653 defined or not at the time) in #ifdef, #ifndef or "defined". */
596− void (*used_define) (cpp_reader *, source_location, cpp_hashnode *);
597− void (*used_undef) (cpp_reader *, source_location, cpp_hashnode *);
654+ void (*used_define) (cpp_reader *, location_t, cpp_hashnode *);
655+ void (*used_undef) (cpp_reader *, location_t, cpp_hashnode *);
598656 /* Called before #define and #undef or other macro definition
599657 changes are processed. */
600658 void (*before_define) (cpp_reader *);
601659 /* Called whenever a macro is expanded or tested.
602660 Second argument is the location of the start of the current expansion. */
603− void (*used) (cpp_reader *, source_location, cpp_hashnode *);
661+ void (*used) (cpp_reader *, location_t, cpp_hashnode *);
604662
605663 /* Callback to identify whether an attribute exists. */
606664 int (*has_attribute) (cpp_reader *);
607665
608− /* Callback that can change a user builtin into normal macro. */
609− bool (*user_builtin_macro) (cpp_reader *, cpp_hashnode *);
666+ /* Callback that can change a user lazy into normal macro. */
667+ void (*user_lazy_macro) (cpp_reader *, cpp_macro *, unsigned);
610668
611669 /* Callback to parse SOURCE_DATE_EPOCH from environment. */
612670 time_t (*get_source_date_epoch) (cpp_reader *);
@@ -620,7 +678,7 @@ struct cpp_callbacks · 7 unmodified lines
620678 The content contains the opening slash-star (or slash-slash),
621679 and for C-style comments contains the closing star-slash. For
622680 C++-style comments it does not include the terminating newline. */
623− void (*comment) (cpp_reader *, source_location, const unsigned char *,
681+ void (*comment) (cpp_reader *, location_t, const unsigned char *,
624682 size_t);
625683
626684 /* Callback for filename remapping in __FILE__ and __BASE_FILE__ macro
@@ -671,14 +729,81 @@ struct cpp_dir · 44 unmodified lines
671729 dev_t dev;
672730 };
673731
674−/* The structure of a node in the hash table. The hash table has
675− entries for all identifiers: either macros defined by #define
676− commands (type NT_MACRO), assertions created with #assert
677− (NT_ASSERTION), or neither of the above (NT_VOID). Builtin macros
678− like __LINE__ are flagged NODE_BUILTIN. Poisoned identifiers are
679− flagged NODE_POISONED. NODE_OPERATOR (C++ only) indicates an
680− identifier that behaves like an operator such as "xor".
681− NODE_DIAGNOSTIC is for speed in lex_token: it indicates a
732+/* The kind of the cpp_macro. */
733+enum cpp_macro_kind {
734+ cmk_macro, /* An ISO macro (token expansion). */
735+ cmk_assert, /* An assertion. */
736+ cmk_traditional /* A traditional macro (text expansion). */
737+};
738+
739+/* Each macro definition is recorded in a cpp_macro structure.
740+ Variadic macros cannot occur with traditional cpp. */
741+struct GTY(()) cpp_macro {
742+ union cpp_parm_u
743+ {
744+ /* Parameters, if any. If parameter names use extended identifiers,
745+ the original spelling of those identifiers, not the canonical
746+ UTF-8 spelling, goes here. */
747+ cpp_hashnode ** GTY ((tag ("false"),
748+ nested_ptr (union tree_node,
749+ "%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
750+ "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"),
751+ length ("%1.paramc"))) params;
752+
753+ /* If this is an assertion, the next one in the chain. */
754+ cpp_macro *GTY ((tag ("true"))) next;
755+ } GTY ((desc ("%1.kind == cmk_assert"))) parm;
756+
757+ /* Definition line number. */
758+ location_t line;
759+
760+ /* Number of tokens in body, or bytes for traditional macros. */
761+ /* Do we really need 2^32-1 range here? */
762+ unsigned int count;
763+
764+ /* Number of parameters. */
765+ unsigned short paramc;
766+
767+ /* Non-zero if this is a user-lazy macro, value provided by user. */
768+ unsigned char lazy;
769+
770+ /* The kind of this macro (ISO, trad or assert) */
771+ unsigned kind : 2;
772+
773+ /* If a function-like macro. */
774+ unsigned int fun_like : 1;
775+
776+ /* If a variadic macro. */
777+ unsigned int variadic : 1;
778+
779+ /* If macro defined in system header. */
780+ unsigned int syshdr : 1;
781+
782+ /* Nonzero if it has been expanded or had its existence tested. */
783+ unsigned int used : 1;
784+
785+ /* Indicate whether the tokens include extra CPP_PASTE tokens at the
786+ end to track invalid redefinitions with consecutive CPP_PASTE
787+ tokens. */
788+ unsigned int extra_tokens : 1;
789+
790+ /* 1 bits spare (32-bit). 33 on 64-bit target. */
791+
792+ union cpp_exp_u
793+ {
794+ /* Trailing array of replacement tokens (ISO), or assertion body value. */
795+ cpp_token GTY ((tag ("false"), length ("%1.count"))) tokens[1];
796+
797+ /* Pointer to replacement text (traditional). See comment at top
798+ of cpptrad.c for how traditional function-like macros are
799+ encoded. */
800+ const unsigned char *GTY ((tag ("true"))) text;
801+ } GTY ((desc ("%1.kind == cmk_traditional"))) exp;
802+};
803+
804+/* Poisoned identifiers are flagged NODE_POISONED. NODE_OPERATOR (C++
805+ only) indicates an identifier that behaves like an operator such as
806+ "xor". NODE_DIAGNOSTIC is for speed in lex_token: it indicates a
682807 diagnostic may be required for this node. Currently this only
683808 applies to __VA_ARGS__, poisoned identifiers, and -Wc++-compat
684809 warnings about NODE_OPERATOR. */
@@ -686,21 +811,21 @@ struct cpp_dir · 1 unmodified line
686811 /* Hash node flags. */
687812 #define NODE_OPERATOR (1 << 0) /* C++ named operator. */
688813 #define NODE_POISONED (1 << 1) /* Poisoned identifier. */
689−#define NODE_BUILTIN (1 << 2) /* Builtin macro. */
690−#define NODE_DIAGNOSTIC (1 << 3) /* Possible diagnostic when lexed. */
691−#define NODE_WARN (1 << 4) /* Warn if redefined or undefined. */
692−#define NODE_DISABLED (1 << 5) /* A disabled macro. */
693−#define NODE_MACRO_ARG (1 << 6) /* Used during #define processing. */
694−#define NODE_USED (1 << 7) /* Dumped with -dU. */
695−#define NODE_CONDITIONAL (1 << 8) /* Conditional macro */
696−#define NODE_WARN_OPERATOR (1 << 9) /* Warn about C++ named operator. */
814+#define NODE_DIAGNOSTIC (1 << 2) /* Possible diagnostic when lexed. */
815+#define NODE_WARN (1 << 3) /* Warn if redefined or undefined. */
816+#define NODE_DISABLED (1 << 4) /* A disabled macro. */
817+#define NODE_USED (1 << 5) /* Dumped with -dU. */
818+#define NODE_CONDITIONAL (1 << 6) /* Conditional macro */
819+#define NODE_WARN_OPERATOR (1 << 7) /* Warn about C++ named operator. */
697820
698821 /* Different flavors of hash node. */
699822 enum node_type
700823 {
701− NT_VOID = 0, /* No definition yet. */
702− NT_MACRO, /* A macro of some form. */
703− NT_ASSERTION /* Predicate for #assert. */
824+ NT_VOID = 0, /* Maybe an assert? */
825+ NT_MACRO_ARG, /* A macro arg. */
826+ NT_USER_MACRO, /* A user macro. */
827+ NT_BUILTIN_MACRO, /* A builtin macro. */
828+ NT_MACRO_MASK = NT_USER_MACRO /* Mask for either macro kind. */
704829 };
705830
706831 /* Different flavors of builtin macro. _Pragma is an operator, but we
@@ -717,46 +842,27 @@ enum cpp_builtin_type · 10 unmodified lines
717842 BT_PRAGMA, /* `_Pragma' operator */
718843 BT_TIMESTAMP, /* `__TIMESTAMP__' */
719844 BT_COUNTER, /* `__COUNTER__' */
720− BT_HAS_ATTRIBUTE, /* `__has_attribute__(x)' */
721− BT_FIRST_USER, /* User defined builtin macros. */
722− BT_LAST_USER = BT_FIRST_USER + 63
845+ BT_HAS_ATTRIBUTE /* `__has_attribute__(x)' */
723846 };
724847
725848 #define CPP_HASHNODE(HNODE) ((cpp_hashnode *) (HNODE))
726−#define HT_NODE(NODE) ((ht_identifier *) (NODE))
727−#define NODE_LEN(NODE) HT_LEN (&(NODE)->ident)
728−#define NODE_NAME(NODE) HT_STR (&(NODE)->ident)
729−
730−/* Specify which field, if any, of the union is used. */
731−
732−enum {
733− NTV_MACRO,
734− NTV_ANSWER,
735− NTV_BUILTIN,
736− NTV_ARGUMENT,
737− NTV_NONE
738−};
739−
740−#define CPP_HASHNODE_VALUE_IDX(HNODE) \
741− ((HNODE.flags & NODE_MACRO_ARG) ? NTV_ARGUMENT \
742− : HNODE.type == NT_MACRO ? ((HNODE.flags & NODE_BUILTIN) \
743− ? NTV_BUILTIN : NTV_MACRO) \
744− : HNODE.type == NT_ASSERTION ? NTV_ANSWER \
745− : NTV_NONE)
849+#define HT_NODE(NODE) (&(NODE)->ident)
850+#define NODE_LEN(NODE) HT_LEN (HT_NODE (NODE))
851+#define NODE_NAME(NODE) HT_STR (HT_NODE (NODE))
746852
747853 /* The common part of an identifier node shared amongst all 3 C front
748854 ends. Also used to store CPP identifiers, which are a superset of
749855 identifiers in the grammatical sense. */
750856
751857 union GTY(()) _cpp_hashnode_value {
752− /* If a macro. */
753− cpp_macro * GTY((tag ("NTV_MACRO"))) macro;
754− /* Answers to an assertion. */
755− struct answer * GTY ((tag ("NTV_ANSWER"))) answers;
858+ /* Assert (maybe NULL) */
859+ cpp_macro * GTY((tag ("NT_VOID"))) answers;
860+ /* Macro (never NULL) */
861+ cpp_macro * GTY((tag ("NT_USER_MACRO"))) macro;
756862 /* Code for a builtin macro. */
757− enum cpp_builtin_type GTY ((tag ("NTV_BUILTIN"))) builtin;
863+ enum cpp_builtin_type GTY ((tag ("NT_BUILTIN_MACRO"))) builtin;
758864 /* Macro argument index. */
759− unsigned short GTY ((tag ("NTV_ARGUMENT"))) arg_index;
865+ unsigned short GTY ((tag ("NT_MACRO_ARG"))) arg_index;
760866 };
761867
762868 struct GTY(()) cpp_hashnode {
@@ -766,10 +872,12 @@ struct GTY(()) cpp_hashnode { · 3 unmodified lines
766872 then index into directive table.
767873 Otherwise, a NODE_OPERATOR. */
768874 unsigned char rid_code; /* Rid code - for front ends. */
769− ENUM_BITFIELD(node_type) type : 6; /* CPP node type. */
770− unsigned int flags : 10; /* CPP flags. */
875+ ENUM_BITFIELD(node_type) type : 2; /* CPP node type. */
876+ unsigned int flags : 8; /* CPP flags. */
877+
878+ /* 6 bits spare (plus another 32 on 64-bit hosts). */
771879
772− union _cpp_hashnode_value GTY ((desc ("CPP_HASHNODE_VALUE_IDX (%1)"))) value;
880+ union _cpp_hashnode_value GTY ((desc ("%1.type"))) value;
773881 };
774882
775883 /* A class for iterating through the source locations within a
@@ -778,13 +886,13 @@ struct GTY(()) cpp_hashnode { · 2 unmodified lines
778886
779887 class cpp_string_location_reader {
780888 public:
781− cpp_string_location_reader (source_location src_loc,
889+ cpp_string_location_reader (location_t src_loc,
782890 line_maps *line_table);
783891
784892 source_range get_next ();
785893
786894 private:
787− source_location m_loc;
895+ location_t m_loc;
788896 int m_offset_per_column;
789897 line_maps *m_line_table;
790898 };
@@ -889,11 +997,32 @@ extern int cpp_avoid_paste (cpp_reader *, const cpp_token *, · 98 unmodified lines
889997 const cpp_token *);
890998 extern const cpp_token *cpp_get_token (cpp_reader *);
891999 extern const cpp_token *cpp_get_token_with_location (cpp_reader *,
892− source_location *);
893−extern bool cpp_fun_like_macro_p (cpp_hashnode *);
1000+ location_t *);
1001+inline bool cpp_user_macro_p (const cpp_hashnode *node)
1002+{
1003+ return node->type == NT_USER_MACRO;
1004+}
1005+inline bool cpp_builtin_macro_p (const cpp_hashnode *node)
1006+{
1007+ return node->type == NT_BUILTIN_MACRO;
1008+}
1009+inline bool cpp_macro_p (const cpp_hashnode *node)
1010+{
1011+ return node->type & NT_MACRO_MASK;
1012+}
1013+
1014+/* Returns true if NODE is a function-like user macro. */
1015+inline bool cpp_fun_like_macro_p (cpp_hashnode *node)
1016+{
1017+ return cpp_user_macro_p (node) && node->value.macro->fun_like;
1018+}
1019+
8941020 extern const unsigned char *cpp_macro_definition (cpp_reader *,
8951021 cpp_hashnode *);
896−extern source_location cpp_macro_definition_location (cpp_hashnode *);
1022+inline location_t cpp_macro_definition_location (cpp_hashnode *node)
1023+{
1024+ return node->value.macro->line;
1025+}
8971026 extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
8981027 extern const cpp_token *cpp_peek_token (cpp_reader *, int);
8991028
@@ -926,6 +1055,9 @@ extern void cpp_assert (cpp_reader *, const char *); · 26 unmodified lines
9261055 extern void cpp_undef (cpp_reader *, const char *);
9271056 extern void cpp_unassert (cpp_reader *, const char *);
9281057
1058+/* Mark a node as a lazily defined macro. */
1059+extern void cpp_define_lazily (cpp_reader *, cpp_hashnode *node, unsigned N);
1060+
9291061 /* Undefine all macros and assertions. */
9301062 extern void cpp_undef_all (cpp_reader *);
9311063
@@ -996,7 +1128,7 @@ struct cpp_num · 64 unmodified lines
9961128 /* Classify a CPP_NUMBER token. The return value is a combination of
9971129 the flags from the above sets. */
9981130 extern unsigned cpp_classify_number (cpp_reader *, const cpp_token *,
999− const char **, source_location);
1131+ const char **, location_t);
10001132
10011133 /* Return the classification flags for a float suffix. */
10021134 extern unsigned int cpp_interpret_float_suffix (cpp_reader *, const char *,
@@ -1014,99 +1146,55 @@ extern cpp_num cpp_interpret_integer (cpp_reader *, const cpp_token *, · 11 unmodified lines
10141146 others assumed clear, to fill out a cpp_num structure. */
10151147 cpp_num cpp_num_sign_extend (cpp_num, size_t);
10161148
1017−/* Diagnostic levels. To get a diagnostic without associating a
1018− position in the translation unit with it, use cpp_error_with_line
1019− with a line number of zero. */
1020−
1021−enum {
1022− /* Warning, an error with -Werror. */
1023− CPP_DL_WARNING = 0,
1024− /* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */
1025− CPP_DL_WARNING_SYSHDR,
1026− /* Warning, an error with -pedantic-errors or -Werror. */
1027− CPP_DL_PEDWARN,
1028− /* An error. */
1029− CPP_DL_ERROR,
1030− /* An internal consistency check failed. Prints "internal error: ",
1031− otherwise the same as CPP_DL_ERROR. */
1032− CPP_DL_ICE,
1033− /* An informative note following a warning. */
1034− CPP_DL_NOTE,
1035− /* A fatal error. */
1036− CPP_DL_FATAL
1037−};
1038−
1039−/* Warning reason codes. Use a reason code of zero for unclassified warnings
1040− and errors that are not warnings. */
1041−enum {
1042− CPP_W_NONE = 0,
1043− CPP_W_DEPRECATED,
1044− CPP_W_COMMENTS,
1045− CPP_W_MISSING_INCLUDE_DIRS,
1046− CPP_W_TRIGRAPHS,
1047− CPP_W_MULTICHAR,
1048− CPP_W_TRADITIONAL,
1049− CPP_W_LONG_LONG,
1050− CPP_W_ENDIF_LABELS,
1051− CPP_W_NUM_SIGN_CHANGE,
1052− CPP_W_VARIADIC_MACROS,
1053− CPP_W_BUILTIN_MACRO_REDEFINED,
1054− CPP_W_DOLLARS,
1055− CPP_W_UNDEF,
1056− CPP_W_UNUSED_MACROS,
1057− CPP_W_CXX_OPERATOR_NAMES,
1058− CPP_W_NORMALIZE,
1059− CPP_W_INVALID_PCH,
1060− CPP_W_WARNING_DIRECTIVE,
1061− CPP_W_LITERAL_SUFFIX,
1062− CPP_W_DATE_TIME,
1063− CPP_W_PEDANTIC,
1064− CPP_W_C90_C99_COMPAT,
1065− CPP_W_CXX11_COMPAT,
1066− CPP_W_EXPANSION_TO_DEFINED
1067−};
1068−
10691149 /* Output a diagnostic of some kind. */
1070−extern bool cpp_error (cpp_reader *, int, const char *msgid, ...)
1150+extern bool cpp_error (cpp_reader *, enum cpp_diagnostic_level,
1151+ const char *msgid, ...)
10711152 ATTRIBUTE_PRINTF_3;
1072−extern bool cpp_warning (cpp_reader *, int, const char *msgid, ...)
1153+extern bool cpp_warning (cpp_reader *, enum cpp_warning_reason,
1154+ const char *msgid, ...)
10731155 ATTRIBUTE_PRINTF_3;
1074−extern bool cpp_pedwarning (cpp_reader *, int, const char *msgid, ...)
1156+extern bool cpp_pedwarning (cpp_reader *, enum cpp_warning_reason,
1157+ const char *msgid, ...)
10751158 ATTRIBUTE_PRINTF_3;
1076−extern bool cpp_warning_syshdr (cpp_reader *, int, const char *msgid, ...)
1159+extern bool cpp_warning_syshdr (cpp_reader *, enum cpp_warning_reason reason,
1160+ const char *msgid, ...)
10771161 ATTRIBUTE_PRINTF_3;
10781162
10791163 /* Output a diagnostic with "MSGID: " preceding the
10801164 error string of errno. No location is printed. */
1081−extern bool cpp_errno (cpp_reader *, int, const char *msgid);
1165+extern bool cpp_errno (cpp_reader *, enum cpp_diagnostic_level,
1166+ const char *msgid);
10821167 /* Similarly, but with "FILENAME: " instead of "MSGID: ", where
10831168 the filename is not localized. */
1084−extern bool cpp_errno_filename (cpp_reader *, int, const char *filename,
1085− source_location loc);
1169+extern bool cpp_errno_filename (cpp_reader *, enum cpp_diagnostic_level,
1170+ const char *filename, location_t loc);
10861171
10871172 /* Same as cpp_error, except additionally specifies a position as a
10881173 (translation unit) physical line and physical column. If the line is
10891174 zero, then no location is printed. */
1090−extern bool cpp_error_with_line (cpp_reader *, int, source_location,
1091− unsigned, const char *msgid, ...)
1175+extern bool cpp_error_with_line (cpp_reader *, enum cpp_diagnostic_level,
1176+ location_t, unsigned,
1177+ const char *msgid, ...)
10921178 ATTRIBUTE_PRINTF_5;
1093−extern bool cpp_warning_with_line (cpp_reader *, int, source_location,
1094− unsigned, const char *msgid, ...)
1179+extern bool cpp_warning_with_line (cpp_reader *, enum cpp_warning_reason,
1180+ location_t, unsigned,
1181+ const char *msgid, ...)
10951182 ATTRIBUTE_PRINTF_5;
1096−extern bool cpp_pedwarning_with_line (cpp_reader *, int, source_location,
1097− unsigned, const char *msgid, ...)
1183+extern bool cpp_pedwarning_with_line (cpp_reader *, enum cpp_warning_reason,
1184+ location_t, unsigned,
1185+ const char *msgid, ...)
10981186 ATTRIBUTE_PRINTF_5;
1099−extern bool cpp_warning_with_line_syshdr (cpp_reader *, int, source_location,
1100− unsigned, const char *msgid, ...)
1187+extern bool cpp_warning_with_line_syshdr (cpp_reader *, enum cpp_warning_reason,
1188+ location_t, unsigned,
1189+ const char *msgid, ...)
11011190 ATTRIBUTE_PRINTF_5;
11021191
1103−extern bool cpp_error_at (cpp_reader * pfile, int level,
1104− source_location src_loc, const char *msgid, ...)
1192+extern bool cpp_error_at (cpp_reader * pfile, enum cpp_diagnostic_level,
1193+ location_t src_loc, const char *msgid, ...)
11051194 ATTRIBUTE_PRINTF_4;
11061195
1107−extern bool cpp_error_at (cpp_reader * pfile, int level,
1108− rich_location *richloc, const char *msgid,
1109− ...)
1196+extern bool cpp_error_at (cpp_reader * pfile, enum cpp_diagnostic_level,
1197+ rich_location *richloc, const char *msgid, ...)
11101198 ATTRIBUTE_PRINTF_4;
11111199
11121200 /* In lex.c */
@@ -1133,7 +1221,7 @@ typedef struct · 20 unmodified lines
11331221 char *comment;
11341222
11351223 /* source location for the given comment. */
1136− source_location sloc;
1224+ location_t sloc;
11371225 } cpp_comment;
11381226
11391227 /* Structure holding all comments for a given cpp_reader. */
@@ -1172,7 +1260,7 @@ extern unsigned char *cpp_quote_string (unsigned char *, const unsigned char *, · 32 unmodified lines
11721260
11731261 /* In files.c */
11741262 extern bool cpp_included (cpp_reader *, const char *);
1175−extern bool cpp_included_before (cpp_reader *, const char *, source_location);
1263+extern bool cpp_included_before (cpp_reader *, const char *, location_t);
11761264 extern void cpp_make_system_header (cpp_reader *, int, int);
11771265 extern bool cpp_push_include (cpp_reader *, const char *);
11781266 extern bool cpp_push_default_include (cpp_reader *, const char *);
@@ -1195,7 +1283,7 @@ extern int cpp_read_state (cpp_reader *, const char *, FILE *, · 16 unmodified lines
11951283 struct save_macro_data *);
11961284
11971285 /* In lex.c */
1198−extern void cpp_force_token_locations (cpp_reader *, source_location *);
1286+extern void cpp_force_token_locations (cpp_reader *, location_t);
11991287 extern void cpp_stop_forcing_token_locations (cpp_reader *);
12001288
12011289 /* In expr.c */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t