Bug 1395580 - check_macroassembler_style.py - Also manage the coding style {} for function declarations r?nbp
MozReview-Commit-ID: KQMJNk6tAEU
--- 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