Remove indirection through NameRefs when building a thunk call (#6965)

This reduces the SemIR size of the thunk call, and ensures that the
emitted SemIR remains correct if `pretty_name_id` is not populated.
This commit is contained in:
Geoff Romer
2026-03-26 19:17:05 +00:00
committed by GitHub
parent 18f87e4f79
commit 262e24a2a0
9 changed files with 37 additions and 93 deletions
+2 -3
View File
@@ -324,9 +324,8 @@ fn EqualWitnesses(p: Wrap(Cpp.PublicDestructor)*) -> Wrap(Cpp.PublicDestructor)*
// CHECK:STDOUT: fn @TrivialDestructor.Op(%self.param: ref %TrivialDestructor) [thunk imports.%TrivialDestructor.cpp_destructor.decl] {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %Op.ref: %TrivialDestructor.cpp_destructor.type = name_ref Op, imports.%TrivialDestructor.cpp_destructor.decl [concrete = constants.%TrivialDestructor.cpp_destructor]
// CHECK:STDOUT: %self.ref: ref %TrivialDestructor = name_ref self, %self.param
// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.bound: <bound method> = bound_method %self.ref, %Op.ref
// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.call: init %empty_tuple.type = call %TrivialDestructor.cpp_destructor.bound(%self.ref)
// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.bound: <bound method> = bound_method %self.param, %Op.ref
// CHECK:STDOUT: %TrivialDestructor.cpp_destructor.call: init %empty_tuple.type = call %TrivialDestructor.cpp_destructor.bound(%self.param)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: