about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-30 18:47:06 +0000
committerbors <bors@rust-lang.org>2025-06-30 18:47:06 +0000
commitf26e58023071e71636a3c72ac3a2bf89b1f76706 (patch)
tree977f28b66426e32e5c19291e11a28ed8ef9481a9 /compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
parentc65dccabacdfd6c8a7f7439eba13422fdd89b91e (diff)
parent666934ac54b6732907820be6421dd525d4ace3e8 (diff)
downloadrust-f26e58023071e71636a3c72ac3a2bf89b1f76706.tar.gz
rust-f26e58023071e71636a3c72ac3a2bf89b1f76706.zip
Auto merge of #143239 - GuillaumeGomez:subtree-update_cg_gcc_2025-06-30, r=GuillaumeGomez
GCC backend subtree update

cc `@antoyo`

r? ghost
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!")