From 9384c1d52a8176666e0412b23d9a32ccbc4a8f44 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Mon, 6 May 2019 18:20:03 -0700 Subject: Make sexp instruction parser pass clang-tidy (#2088) Our current clang-tidy setting requires {} after ifs. Unlike clang-format, I couldn't find any directives or options that allow us to exclude the generated inc file from clang-tidy. Anyway adding a pair of braces is all it takes to make it pass. --- scripts/gen-s-parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/gen-s-parser.py') diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py index 262c0aeaf..9dcfb3dd3 100755 --- a/scripts/gen-s-parser.py +++ b/scripts/gen-s-parser.py @@ -498,7 +498,7 @@ def instruction_parser(): printer.print_line("strncpy(op, s[0]->c_str(), {});".format(inst_length)) def print_leaf(expr, inst): - printer.print_line("if (strcmp(op, \"{inst}\") == 0) return {expr};" + printer.print_line("if (strcmp(op, \"{inst}\") == 0) {{ return {expr}; }}" .format(inst=inst, expr=expr)) printer.print_line("goto parse_error;") -- cgit v1.2.3