mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 22:02:41 +01:00
Fix `pattern_block_id` and `call_params_id` for C++ function decl
import, to get the correct SemIR printout for the C++ functions i.e.
1) Fill in missing parameter info in the function decls:
```
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
// CHECK:STDOUT: %a.patt: %pattern_type.2f8 = binding_pattern a [concrete]
// CHECK:STDOUT: %a.param_patt: %pattern_type.2f8 = value_param_pattern %a.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %a.param: %i16 = value_param call_param0
// CHECK:STDOUT: %.1: type = splice_block %i16 [concrete = constants.%i16] {
// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a: %i16 = bind_name a, %a.param
// CHECK:STDOUT: }
```
2) Print the params and return values:
```
// CHECK:STDOUT: fn @foo_short() -> %i16;
```
```
// CHECK:STDOUT: fn @foo(%a.param: %i16);
```
Closes #5449