Simplify extra_name in ExportFunctionSpecializationToCpp (#7587)

Rather than appending to the thunk name for each template arg, use the
mangled form of the specific ID.
This commit is contained in:
Nicholas Bishop
2026-08-10 15:09:58 +00:00
committed by GitHub
parent e7050af1c9
commit 700e42a195
5 changed files with 26 additions and 21 deletions
@@ -486,14 +486,14 @@ void G() {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F__carbon_thunkinst64000043(%_.param.loc24_23.1: ref %A, %_.param.loc24_23.2: ref %A) {
// CHECK:STDOUT: fn @F__carbon_thunk.83afdff581006d1a(%_.param.loc24_23.1: ref %A, %_.param.loc24_23.2: ref %A) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F__carbon_thunkinst64000043.ref: %F.type = name_ref F__carbon_thunkinst64000043, file.%F.decl [concrete = constants.%F]
// CHECK:STDOUT: %F__carbon_thunk.83afdff581006d1a.ref: %F.type = name_ref F__carbon_thunk.83afdff581006d1a, file.%F.decl [concrete = constants.%F]
// CHECK:STDOUT: %I.facet.loc24_23.1: %I.type = facet_value constants.%A, (constants.%I.impl_witness.6ad) [concrete = constants.%I.facet.64b]
// CHECK:STDOUT: %.loc24_23.1: %I.type = converted constants.%A, %I.facet.loc24_23.1 [concrete = constants.%I.facet.64b]
// CHECK:STDOUT: %I.facet.loc24_23.2: %I.type = facet_value constants.%A, (constants.%I.impl_witness.6ad) [concrete = constants.%I.facet.64b]
// CHECK:STDOUT: %.loc24_23.2: %I.type = converted constants.%A, %I.facet.loc24_23.2 [concrete = constants.%I.facet.64b]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F__carbon_thunkinst64000043.ref, @F(constants.%I.facet.64b) [concrete = constants.%F.specific_fn.f33]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F__carbon_thunk.83afdff581006d1a.ref, @F(constants.%I.facet.64b) [concrete = constants.%F.specific_fn.f33]
// CHECK:STDOUT: %.loc24_23.3: ref %A = splice_block %_.param.loc24_23.2 {}
// CHECK:STDOUT: %.loc24_23.4: %A = acquire_value %_.param.loc24_23.1
// CHECK:STDOUT: %F.call: init %A to %.loc24_23.3 = call %F.specific_fn(%.loc24_23.4)
@@ -501,14 +501,14 @@ void G() {
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F__carbon_thunkinst6400006E(%_.param.loc24_23.1: ref %B, %_.param.loc24_23.2: ref %B) {
// CHECK:STDOUT: fn @F__carbon_thunk.36f470e96b413347(%_.param.loc24_23.1: ref %B, %_.param.loc24_23.2: ref %B) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F__carbon_thunkinst6400006E.ref: %F.type = name_ref F__carbon_thunkinst6400006E, file.%F.decl [concrete = constants.%F]
// CHECK:STDOUT: %F__carbon_thunk.36f470e96b413347.ref: %F.type = name_ref F__carbon_thunk.36f470e96b413347, file.%F.decl [concrete = constants.%F]
// CHECK:STDOUT: %I.facet.loc24_23.1: %I.type = facet_value constants.%B, (constants.%I.impl_witness.5b8) [concrete = constants.%I.facet.9f8]
// CHECK:STDOUT: %.loc24_23.1: %I.type = converted constants.%B, %I.facet.loc24_23.1 [concrete = constants.%I.facet.9f8]
// CHECK:STDOUT: %I.facet.loc24_23.2: %I.type = facet_value constants.%B, (constants.%I.impl_witness.5b8) [concrete = constants.%I.facet.9f8]
// CHECK:STDOUT: %.loc24_23.2: %I.type = converted constants.%B, %I.facet.loc24_23.2 [concrete = constants.%I.facet.9f8]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F__carbon_thunkinst6400006E.ref, @F(constants.%I.facet.9f8) [concrete = constants.%F.specific_fn.db2]
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F__carbon_thunk.36f470e96b413347.ref, @F(constants.%I.facet.9f8) [concrete = constants.%F.specific_fn.db2]
// CHECK:STDOUT: %.loc24_23.3: ref %B = splice_block %_.param.loc24_23.2 {}
// CHECK:STDOUT: %.loc24_23.4: %B = acquire_value %_.param.loc24_23.1
// CHECK:STDOUT: %F.call: init %B to %.loc24_23.3 = call %F.specific_fn(%.loc24_23.4)