blob: f5f04ae314a2bbb536657c128c31abc7a6bdbf19 [file] [log] [blame]
Andrew Geisslerea144b032023-01-27 16:03:57 -06001From 4efc42b99c96b026f560b0918de7e237ac3dc8d1 Mon Sep 17 00:00:00 2001
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Tue, 10 Mar 2020 08:26:53 -0700
4Subject: [PATCH] gentypes/genmodes: Do not use __LINE__ for maintaining
5 reproducibility
6
7Inserting line numbers into generated code means its not always reproducible wth
8differing versions of host gcc. Void the issue by not adding these.
9
10Upstream-Status: Inappropriate [OE Reproducibility specific]
11
12Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
Andrew Geisslerea144b032023-01-27 16:03:57 -060015 gcc/gengtype.cc | 6 +++---
16 gcc/genmodes.cc | 32 ++++++++++++++++----------------
Brad Bishopbec4ebc2022-08-03 09:55:16 -040017 2 files changed, 19 insertions(+), 19 deletions(-)
18
Andrew Geisslerea144b032023-01-27 16:03:57 -060019diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc
20index 386ae1b0506..9762e914296 100644
21--- a/gcc/gengtype.cc
22+++ b/gcc/gengtype.cc
23@@ -1006,7 +1006,7 @@ create_field_at (pair_p next, type_p type, const char *name, options_p opt,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040024 /* Create a fake field with the given type and name. NEXT is the next
25 field in the chain. */
26 #define create_field(next,type,name) \
27- create_field_all (next,type,name, 0, this_file, __LINE__)
28+ create_field_all (next,type,name, 0, this_file, 0)
29
30 /* Like create_field, but the field is only valid when condition COND
31 is true. */
Andrew Geisslerea144b032023-01-27 16:03:57 -060032@@ -1039,7 +1039,7 @@ create_optional_field_ (pair_p next, type_p type, const char *name,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040033 }
34
35 #define create_optional_field(next,type,name,cond) \
36- create_optional_field_(next,type,name,cond,__LINE__)
37+ create_optional_field_(next,type,name,cond,0)
38
39 /* Reverse a linked list of 'struct pair's in place. */
40 pair_p
Andrew Geisslerea144b032023-01-27 16:03:57 -060041@@ -5238,7 +5238,7 @@ main (int argc, char **argv)
Brad Bishopbec4ebc2022-08-03 09:55:16 -040042 /* These types are set up with #define or else outside of where
43 we can see them. We should initialize them before calling
44 read_input_list. */
45-#define POS_HERE(Call) do { pos.file = this_file; pos.line = __LINE__; \
46+#define POS_HERE(Call) do { pos.file = this_file; pos.line = 0; \
47 Call;} while (0)
48 POS_HERE (do_scalar_typedef ("CUMULATIVE_ARGS", &pos));
49 POS_HERE (do_scalar_typedef ("REAL_VALUE_TYPE", &pos));
Andrew Geisslerea144b032023-01-27 16:03:57 -060050diff --git a/gcc/genmodes.cc b/gcc/genmodes.cc
51index 59850bb070a..e187f8542a1 100644
52--- a/gcc/genmodes.cc
53+++ b/gcc/genmodes.cc
54@@ -440,7 +440,7 @@ complete_all_modes (void)
Brad Bishopbec4ebc2022-08-03 09:55:16 -040055 }
56
57 /* For each mode in class CLASS, construct a corresponding complex mode. */
58-#define COMPLEX_MODES(C) make_complex_modes (MODE_##C, __FILE__, __LINE__)
59+#define COMPLEX_MODES(C) make_complex_modes (MODE_##C, __FILE__, 0)
60 static void
61 make_complex_modes (enum mode_class cl,
62 const char *file, unsigned int line)
Andrew Geisslerea144b032023-01-27 16:03:57 -060063@@ -499,7 +499,7 @@ make_complex_modes (enum mode_class cl,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040064 having as many components as necessary. ORDER is the sorting order
65 of the mode, with smaller numbers indicating a higher priority. */
66 #define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W, ORDER) \
67- make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, __LINE__)
68+ make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, 0)
69 #define VECTOR_MODES(C, W) VECTOR_MODES_WITH_PREFIX (V, C, W, 0)
70 static void ATTRIBUTE_UNUSED
71 make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width,
Andrew Geisslerea144b032023-01-27 16:03:57 -060072@@ -552,7 +552,7 @@ make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040073 BYTESIZE bytes in total. */
Andrew Geisslerea144b032023-01-27 16:03:57 -060074 #define VECTOR_BOOL_MODE(NAME, COUNT, COMPONENT, BYTESIZE) \
75 make_vector_bool_mode (#NAME, COUNT, #COMPONENT, BYTESIZE, \
76- __FILE__, __LINE__)
77+ __FILE__, 0)
Brad Bishopbec4ebc2022-08-03 09:55:16 -040078 static void ATTRIBUTE_UNUSED
79 make_vector_bool_mode (const char *name, unsigned int count,
Andrew Geisslerea144b032023-01-27 16:03:57 -060080 const char *component, unsigned int bytesize,
81@@ -574,7 +574,7 @@ make_vector_bool_mode (const char *name, unsigned int count,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040082 /* Input. */
83
84 #define _SPECIAL_MODE(C, N) \
85- make_special_mode (MODE_##C, #N, __FILE__, __LINE__)
86+ make_special_mode (MODE_##C, #N, __FILE__, 0)
87 #define RANDOM_MODE(N) _SPECIAL_MODE (RANDOM, N)
88 #define CC_MODE(N) _SPECIAL_MODE (CC, N)
89
Andrew Geisslerea144b032023-01-27 16:03:57 -060090@@ -587,7 +587,7 @@ make_special_mode (enum mode_class cl, const char *name,
Brad Bishopbec4ebc2022-08-03 09:55:16 -040091
92 #define INT_MODE(N, Y) FRACTIONAL_INT_MODE (N, -1U, Y)
93 #define FRACTIONAL_INT_MODE(N, B, Y) \
94- make_int_mode (#N, B, Y, __FILE__, __LINE__)
95+ make_int_mode (#N, B, Y, __FILE__, 0)
96
97 static void
98 make_int_mode (const char *name,
Andrew Geisslerea144b032023-01-27 16:03:57 -060099@@ -628,16 +628,16 @@ make_opaque_mode (const char *name,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400100 }
101
102 #define FRACT_MODE(N, Y, F) \
103- make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, __LINE__)
104+ make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, 0)
105
106 #define UFRACT_MODE(N, Y, F) \
107- make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, __LINE__)
108+ make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, 0)
109
110 #define ACCUM_MODE(N, Y, I, F) \
111- make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, __LINE__)
112+ make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, 0)
113
114 #define UACCUM_MODE(N, Y, I, F) \
115- make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, __LINE__)
116+ make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, 0)
117
118 /* Create a fixed-point mode by setting CL, NAME, BYTESIZE, IBIT, FBIT,
119 FILE, and LINE. */
Andrew Geisslerea144b032023-01-27 16:03:57 -0600120@@ -658,7 +658,7 @@ make_fixed_point_mode (enum mode_class cl,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400121
122 #define FLOAT_MODE(N, Y, F) FRACTIONAL_FLOAT_MODE (N, -1U, Y, F)
123 #define FRACTIONAL_FLOAT_MODE(N, B, Y, F) \
124- make_float_mode (#N, B, Y, #F, __FILE__, __LINE__)
125+ make_float_mode (#N, B, Y, #F, __FILE__, 0)
126
127 static void
128 make_float_mode (const char *name,
Andrew Geisslerea144b032023-01-27 16:03:57 -0600129@@ -675,7 +675,7 @@ make_float_mode (const char *name,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400130 #define DECIMAL_FLOAT_MODE(N, Y, F) \
131 FRACTIONAL_DECIMAL_FLOAT_MODE (N, -1U, Y, F)
132 #define FRACTIONAL_DECIMAL_FLOAT_MODE(N, B, Y, F) \
133- make_decimal_float_mode (#N, B, Y, #F, __FILE__, __LINE__)
134+ make_decimal_float_mode (#N, B, Y, #F, __FILE__, 0)
135
136 static void
137 make_decimal_float_mode (const char *name,
Andrew Geisslerea144b032023-01-27 16:03:57 -0600138@@ -690,7 +690,7 @@ make_decimal_float_mode (const char *name,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400139 }
140
141 #define RESET_FLOAT_FORMAT(N, F) \
142- reset_float_format (#N, #F, __FILE__, __LINE__)
143+ reset_float_format (#N, #F, __FILE__, 0)
144 static void ATTRIBUTE_UNUSED
145 reset_float_format (const char *name, const char *format,
146 const char *file, unsigned int line)
Andrew Geisslerea144b032023-01-27 16:03:57 -0600147@@ -711,7 +711,7 @@ reset_float_format (const char *name, const char *format,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400148
149 /* __intN support. */
150 #define INT_N(M,PREC) \
151- make_int_n (#M, PREC, __FILE__, __LINE__)
152+ make_int_n (#M, PREC, __FILE__, 0)
153 static void ATTRIBUTE_UNUSED
154 make_int_n (const char *m, int bitsize,
155 const char *file, unsigned int line)
Andrew Geisslerea144b032023-01-27 16:03:57 -0600156@@ -740,7 +740,7 @@ make_int_n (const char *m, int bitsize,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400157 /* Partial integer modes are specified by relation to a full integer
158 mode. */
159 #define PARTIAL_INT_MODE(M,PREC,NAME) \
160- make_partial_integer_mode (#M, #NAME, PREC, __FILE__, __LINE__)
161+ make_partial_integer_mode (#M, #NAME, PREC, __FILE__, 0)
162 static void ATTRIBUTE_UNUSED
163 make_partial_integer_mode (const char *base, const char *name,
164 unsigned int precision,
Andrew Geisslerea144b032023-01-27 16:03:57 -0600165@@ -767,7 +767,7 @@ make_partial_integer_mode (const char *base, const char *name,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400166 /* A single vector mode can be specified by naming its component
167 mode and the number of components. */
Andrew Geisslerea144b032023-01-27 16:03:57 -0600168 #define VECTOR_MODE_WITH_PREFIX(PREFIX, C, M, N, ORDER) \
169- make_vector_mode (MODE_##C, #PREFIX, #M, N, ORDER, __FILE__, __LINE__);
170+ make_vector_mode (MODE_##C, #PREFIX, #M, N, ORDER, __FILE__, 0);
171 #define VECTOR_MODE(C, M, N) VECTOR_MODE_WITH_PREFIX(V, C, M, N, 0);
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400172 static void ATTRIBUTE_UNUSED
173 make_vector_mode (enum mode_class bclass,
Andrew Geisslerea144b032023-01-27 16:03:57 -0600174@@ -814,7 +814,7 @@ make_vector_mode (enum mode_class bclass,
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400175
176 /* Adjustability. */
177 #define _ADD_ADJUST(A, M, X, C1, C2) \
178- new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, __LINE__)
179+ new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, 0)
180
181 #define ADJUST_NUNITS(M, X) _ADD_ADJUST (nunits, M, X, RANDOM, RANDOM)
182 #define ADJUST_BYTESIZE(M, X) _ADD_ADJUST (bytesize, M, X, RANDOM, RANDOM)