about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-07-04 11:07:48 +0200
committerJakub Beránek <berykubik@gmail.com>2025-07-04 11:07:48 +0200
commitc33dd1b306db360f92c46f1cab79e68e6a845bf5 (patch)
tree3fa8e6c5426eb1fa41b4ac3e6ebeaa322ab89688 /compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
parentac1a8b398b8c0f33e982ba736d31492d911c3050 (diff)
parentc96a69059ecc618b519da385a6ccd03155aa0237 (diff)
downloadrust-c33dd1b306db360f92c46f1cab79e68e6a845bf5.tar.gz
rust-c33dd1b306db360f92c46f1cab79e68e6a845bf5.zip
Merge ref 'c96a69059ecc' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: c96a69059ecc618b519da385a6ccd03155aa0237
Filtered ref: 7b9552d4c39c31aabf6749629da2d4a7e6e1cd60

This merge was created using https://github.com/rust-lang/josh-sync.
Diffstat (limited to 'compiler/rustc_codegen_gcc/tools/generate_intrinsics.py')
-rw-r--r--compiler/rustc_codegen_gcc/tools/generate_intrinsics.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py b/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
index ed0ebf00719..88927f39b93 100644
--- a/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
+++ b/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
@@ -176,14 +176,14 @@ def update_intrinsics(llvm_path, llvmint, llvmint2):
         out.write("// File generated by `rustc_codegen_gcc/tools/generate_intrinsics.py`\n")
         out.write("// DO NOT EDIT IT!\n")
         out.write("/// Translate a given LLVM intrinsic name to an equivalent GCC one.\n")
-        out.write("fn map_arch_intrinsic(name:&str)->&str{\n")
-        out.write('let Some(name) = name.strip_prefix("llvm.") else { unimplemented!("***** unsupported LLVM intrinsic {}", name) };\n')
+        out.write("fn map_arch_intrinsic(full_name:&str)->&'static str{\n")
+        out.write('let Some(name) = full_name.strip_prefix("llvm.") else { unimplemented!("***** unsupported LLVM intrinsic {}", full_name) };\n')
         out.write('let Some((arch, name)) = name.split_once(\'.\') else { unimplemented!("***** unsupported LLVM intrinsic {}", name) };\n')
         out.write("match arch {\n")
         for arch in archs:
             if len(intrinsics[arch]) == 0:
                 continue
-            out.write("\"{}\" => {{ #[allow(non_snake_case)] fn {}(name: &str) -> &str {{ match name {{".format(arch,arch))
+            out.write("\"{}\" => {{ #[allow(non_snake_case)] fn {}(name: &str,full_name:&str) -> &'static str {{ match name {{".format(arch,arch))
             intrinsics[arch].sort(key=lambda x: (x[0], x[2]))
             out.write('    // {}\n'.format(arch))
             for entry in intrinsics[arch]:
@@ -196,9 +196,9 @@ def update_intrinsics(llvm_path, llvmint, llvmint2):
                     out.write('    // [INVALID CONVERSION]: "{}" => "{}",\n'.format(llvm_name, entry[1]))
                 else:
                     out.write('    "{}" => "{}",\n'.format(llvm_name, entry[1]))
-            out.write('    _ => unimplemented!("***** unsupported LLVM intrinsic {}", name),\n')
-            out.write("}} }} {}(name) }}\n,".format(arch))
-        out.write('    _ => unimplemented!("***** unsupported LLVM architecture {}", name),\n')
+            out.write('    _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}"),\n')
+            out.write("}} }} {}(name,full_name) }}\n,".format(arch))
+        out.write('    _ => unimplemented!("***** unsupported LLVM architecture {arch}, intrinsic:{full_name}"),\n')
         out.write("}\n}")
     subprocess.call(["rustfmt", output_file])
     print("Done!")