mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 19:01:07 +01:00
Fix indirect import handling for functions. (#4258)
The particular test this focused on is indirect_two_file in toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon. This removes `parent_scope_id_for_new_inst` because I think it's returning unhelpful results. The use was at the root of incorrect results for the indirect import chain. `name_id_for_new_inst` is actually wrapping a union, so it's more important. The merging of `is_extern` and `first_owning_decl_id` in `handle_function.cpp` feels like it's less correct with the changes that've been made to `extern`. This ripples in tests, because the error recovery shifts. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
2a7c2c5df2
commit
bed5fdcbbe
@@ -724,17 +724,17 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %e: ref %.1 = bind_name e, %e.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @A();
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @B(%b: i32) -> i32;
|
||||
// CHECK:STDOUT: fn @B(%b: i32) -> i32;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @C(%c: %.3) -> %.4;
|
||||
// CHECK:STDOUT: fn @C(%c: %.3) -> %.4;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @D();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @E();
|
||||
// CHECK:STDOUT: fn @E();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
|
||||
Reference in New Issue
Block a user