self.lines = []
self.files = []
self.file_patterns = []
+ self.opened_parentheses = 0
def parse_file_names(self):
# Whether the content currently processed is between a star prefix the
for line in self.lines:
# If this line matches the star prefix, start the location
# processing on the information that follows the star.
+ # Note that we need to skip macro names that can be in form of:
+ #
+ # * config/i386/i386.md (*fix_trunc<mode>_i387_1,
+ # *add<mode>3_ne, *add<mode>3_eq_0, *add<mode>3_ne_0,
+ # *fist<mode>2_<rounding>_1, *<code><mode>3_1):
+ #
m = star_prefix_regex.match(line)
- if m:
+ if m and len(m.group('spaces')) == 1:
in_location = True
line = m.group('content')
self.parse_changelog()
self.parse_file_names()
self.check_for_empty_description()
+ self.check_for_broken_parentheses()
self.deduce_changelog_locations()
self.check_file_patterns()
if not self.errors:
else:
m = star_prefix_regex.match(line)
if m:
- if len(m.group('spaces')) != 1:
+ if (len(m.group('spaces')) != 1 and
+ last_entry.opened_parentheses == 0):
msg = 'one space should follow asterisk'
self.errors.append(Error(msg, line))
else:
msg = f'empty group "{needle}" found'
self.errors.append(Error(msg, line))
last_entry.lines.append(line)
+ self.process_parentheses(last_entry, line)
else:
if last_entry.is_empty:
msg = 'first line should start with a tab, ' \
self.errors.append(Error(msg, line))
else:
last_entry.lines.append(line)
+ self.process_parentheses(last_entry, line)
+
+ def process_parentheses(self, last_entry, line):
+ for c in line:
+ if c == '(':
+ last_entry.opened_parentheses += 1
+ elif c == ')':
+ if last_entry.opened_parentheses == 0:
+ msg = 'bad wrapping of parenthesis'
+ self.errors.append(Error(msg, line))
+ else:
+ last_entry.opened_parentheses -= 1
def parse_file_names(self):
for entry in self.changelog_entries:
msg = 'missing description of a change'
self.errors.append(Error(msg, line))
+ def check_for_broken_parentheses(self):
+ for entry in self.changelog_entries:
+ if entry.opened_parentheses != 0:
+ msg = 'bad parentheses wrapping'
+ self.errors.append(Error(msg, entry.lines[0]))
+
def get_file_changelog_location(self, changelog_file):
for file in self.info.modified_files:
if file[0] == changelog_file:
--
2.29.2
+=== 0001-Add-macro.patch ===
+From 9b7eedc932fe594547fb060b36dfd9e4178c4f9b Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Wed, 13 Jan 2021 16:26:45 +0100
+Subject: [PATCH 1/2] Add macro.
+
+gcc/ChangeLog:
+
+ * config/i386/i386.md (*fix_trunc<mode>_i387_1, *add<mode>3_eq,
+ *add<mode>3_ne, *add<mode>3_eq_0, *add<mode>3_ne_0, *add<mode>3_eq,
+ *fist<mode>2_<rounding>_1, *<code><mode>3_1, *<code>di3_doubleword):
+ Use ix86_pre_reload_split instead of can_create_pseudo_p in condition.
+ * config/i386/sse.md
+ (*fix_trunc<mode>_i387_1, *add<mode>3_eq,
+ *add<mode>3_ne, *add<mode>3_eq_0, *add<mode>3_ne_0, *add<mode>3_eq,
+ *fist<mode>2_<rounding>_1): This should also work.
+---
+ gcc/config/i386/i386.md | 1 +
+ gcc/config/i386/sse.md | 1 +
+ 2 files changed, 2 insertions(+)
+diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
+index b60784a2908..ac63591b33f 100644
+--- a/gcc/config/i386/i386.md
++++ b/gcc/config/i386/i386.md
+@@ -1 +1,2 @@
+
++
+
+diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
+index 7f03fc491c3..0e17997db26 100644
+--- a/gcc/config/i386/sse.md
++++ b/gcc/config/i386/sse.md
+@@ -1 +1,2 @@
+
++
+
+--
+2.29.2
+
+=== 0002-Wrong-macro-changelog.patch ===
+From 3542802111d4c6752ac7233ef96655b7fb78aae4 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Wed, 13 Jan 2021 16:54:58 +0100
+Subject: [PATCH 2/2] Wrong macro changelog
+
+gcc/ChangeLog:
+
+ * config/i386/i386.md (*fix_trunc<mode>_i387_1,
+ (foo): Change it.
+---
+ gcc/config/i386/i386.md | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
+index ac63591b33f..ff4d61764e7 100644
+--- a/gcc/config/i386/i386.md
++++ b/gcc/config/i386/i386.md
+@@ -1 +1,2 @@
+
++
+--
+2.29.2