Skip to content

Commit 1e2ddfa

Browse files
Implement review comments.
1 parent ea8c80b commit 1e2ddfa

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang/utils/aarch64_builtins_test_generator.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FunctionType(Enum):
4747
class BuiltinContext:
4848
guard: str
4949
streaming_guard: str
50-
flags: tuple[str, ...]
50+
flags: Tuple[str, ...]
5151

5252
def __str__(self) -> str:
5353
return (
@@ -94,9 +94,8 @@ def parse_builtin_declaration(decl: str) -> Tuple[str, List[str]]:
9494
raise ValueError(f"Could not find function name in: {decl!r}")
9595
func_name = name_m.group(1)
9696

97-
if not params:
98-
param_types: List[str] = []
99-
else:
97+
param_types: List[str] = []
98+
if params:
10099
# Split by commas respecting no pointers/arrays with commas (not expected here)
101100
param_types = [p.strip() for p in params.split(",") if p.strip()]
102101

@@ -193,7 +192,7 @@ def expand_feature_guard(
193192
# remove superset and duplicates
194193
unique = []
195194
for s in results:
196-
if any(s > other for other in results if s is not other):
195+
if any(s > other for other in results):
197196
continue
198197
if s not in unique:
199198
unique.append(s)
@@ -408,7 +407,7 @@ def build_calls_for_group(builtins: Iterable[str]) -> Tuple[List[str], List[str]
408407
calls.append(f"{fn}(" + ", ".join(arg_names) + ");")
409408

410409
# Natural sort (e.g. int8_t before int16_t)
411-
calls.sort(key=lambda t: natural_key(t))
410+
calls.sort(key=natural_key)
412411
var_decls.sort(key=natural_key)
413412

414413
return var_decls, calls

0 commit comments

Comments
 (0)