carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

C++ function params and return values not printed in the SemIR anymore

Open ivanaivanovska opened this issue 6 months ago • 5 comments
trafficstars

Description of the bug:

Parameters and return values were printed in the SemIR for the C++ function declarations as well, but they are not printed anymore.

E.g. in toolchain/check/testdata/interop/cpp/function_decl.carbon:

  • Case 1: Function params:
// --- single_int_param_function_decl.h

auto foo(int b) -> void;

Before: // CHECK:STDOUT: fn @foo[](%b.param_patt: %i32);

Now: // CHECK:STDOUT: fn @foo();

  • Case 2: Return values
// --- int_return_function_decl.h

auto foo_int() -> int;

Before: // CHECK:STDOUT: fn @foo_int[]() -> %i32;

Now: // CHECK:STDOUT: fn @foo_int();

The tests still work, the issue seems to be only in the printed SemIR.

It is still useful to be able to see the C++ parameter/return values types, especially for the ongoing efforts of enabling these types.

ivanaivanovska avatar May 08 '25 13:05 ivanaivanovska