Bug 1395580 - check_macroassembler_style.py - Also manage the coding style {} for function declarations r?nbp draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 15 Sep 2017 17:20:18 +0200
changeset 665489 d1ceaf29cc951df51c5ac939ea609c61376c3f66
parent 665488 810a3cdecef216e47911371f61435ecc2fbc7abd
child 665490 e697a3397b97ad385b675b76489632e8ee25a747
push id80086
push userbmo:sledru@mozilla.com
push dateFri, 15 Sep 2017 16:04:44 +0000
reviewersnbp
bugs1395580
milestone57.0a1
Bug 1395580 - check_macroassembler_style.py - Also manage the coding style {} for function declarations r?nbp MozReview-Commit-ID: KQMJNk6tAEU
config/check_macroassembler_style.py
--- a/config/check_macroassembler_style.py
+++ b/config/check_macroassembler_style.py
@@ -139,20 +139,22 @@ def get_macroassembler_definitions(filen
             if '//{{{ check_macroassembler_style' in line:
                 style_section = True
             elif '//}}} check_macroassembler_style' in line:
                 style_section = False
             if not style_section:
                 continue
 
             line = re.sub(r'//.*', '', line)
-            if line.startswith('{'):
+            if line.startswith('{') or line.strip() == "{}":
                 if 'MacroAssembler::' in lines:
                     signatures.extend(get_normalized_signatures(lines, fileAnnot))
-                code_section = True
+                if line.strip() != "{}": # Empty declaration, no need to declare
+                    # a new code section
+                    code_section = True
                 continue
             if line.startswith('}'):
                 code_section = False
                 lines = ''
                 continue
             if code_section:
                 continue