Skip to content

Commit 884cea1

Browse files
Only generate expect attribute if needed
1 parent 1548ba6 commit 884cea1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/generate_intrinsics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ def update_intrinsics(llvm_path, llvmint, llvmint2):
183183
for arch in archs:
184184
if len(intrinsics[arch]) == 0:
185185
continue
186-
out.write("\"{}\" => {{ #[allow(non_snake_case)] fn {}(name: &str,full_name:&str) -> &'static str {{ match name {{".format(arch,arch))
186+
attribute = "#[expect(non_snake_case)]" if arch[0].isupper() else ""
187+
out.write("\"{}\" => {{ {} fn {}(name: &str,full_name:&str) -> &'static str {{ match name {{".format(arch, attribute, arch))
187188
intrinsics[arch].sort(key=lambda x: (x[0], x[2]))
188189
out.write(' // {}\n'.format(arch))
189190
for entry in intrinsics[arch]:

0 commit comments

Comments
 (0)