Skip to content

Commit d4f8a7a

Browse files
[fixup] Reformat
1 parent abad709 commit d4f8a7a

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

llvm/utils/UpdateTestChecks/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,7 @@ def invoke_tool(exe, cmd_args, ir, preprocess_cmd=None, verbose=False):
558558
UNUSED_NOTE = "NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:"
559559

560560
DATA_LAYOUT_RE = re.compile(
561-
r"target\sdatalayout\s=\s\"(?P<layout>.+)\"$",
562-
flags=(re.M | re.S)
561+
r"target\sdatalayout\s=\s\"(?P<layout>.+)\"$", flags=(re.M | re.S)
563562
)
564563

565564
OPT_FUNCTION_RE = re.compile(
@@ -655,6 +654,7 @@ def get_triple_from_march(march):
655654
print("Cannot find a triple. Assume 'x86'", file=sys.stderr)
656655
return "x86"
657656

657+
658658
def get_global_underscores(raw_tool_output):
659659
m = DATA_LAYOUT_RE.search(raw_tool_output)
660660
if not m:
@@ -664,7 +664,8 @@ def get_global_underscores(raw_tool_output):
664664
if idx < 0:
665665
return False
666666
ch = data_layout[idx + 2]
667-
return ch == 'o' or ch == 'x'
667+
return ch == "o" or ch == "x"
668+
668669

669670
def apply_filters(line, filters):
670671
has_filter = False

llvm/utils/update_cc_test_checks.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def parse_clang_ast_json(node, loc, search):
125125
# Strip leading underscore from globals, so the name matches the LLVM one
126126
if global_underscores:
127127
storage = node.get("storageClass", None)
128-
if storage != "static" and mangled[0] == '_':
128+
if storage != "static" and mangled[0] == "_":
129129
mangled = mangled[1:]
130130
ret[int(line) - 1].append((spell, mangled, search))
131131

@@ -254,7 +254,9 @@ def config():
254254
return args, parser
255255

256256

257-
def get_function_body(builder, args, filename, clang_args, extra_commands, prefixes, raw_tool_output):
257+
def get_function_body(
258+
builder, args, filename, clang_args, extra_commands, prefixes, raw_tool_output
259+
):
258260
# TODO Clean up duplication of asm/common build_function_body_dictionary
259261
for extra_command in extra_commands:
260262
extra_args = shlex.split(extra_command)
@@ -389,12 +391,20 @@ def main():
389391
# Invoke external tool and extract function bodies.
390392
raw_tool_output = common.invoke_tool(ti.args.clang, clang_args, ti.path)
391393
get_function_body(
392-
builder, ti.args, ti.path, clang_args, extra_commands, prefixes, raw_tool_output
394+
builder,
395+
ti.args,
396+
ti.path,
397+
clang_args,
398+
extra_commands,
399+
prefixes,
400+
raw_tool_output
393401
)
394402

395403
# Invoke clang -Xclang -ast-dump=json to get mapping from start lines to
396404
# mangled names. Forward all clang args for now.
397-
for k, v in get_line2func_list(ti.args, clang_args, common.get_global_underscores(raw_tool_output)).items():
405+
for k, v in get_line2func_list(
406+
ti.args, clang_args, common.get_global_underscores(raw_tool_output)
407+
).items():
398408
line2func_list[k].extend(v)
399409

400410
func_dict = builder.finish_and_get_func_dict()

0 commit comments

Comments
 (0)