Function decl lowering for incomplete parameter/return types (#5038) (#5066)

While current examples of this could also be addressed by emitting
declarations on use (by which stage the associated types would have to
be complete by construction) - it's expected that future examples
(vtables, function pointers) will need to work in this case anyway, so
might as well implement this feature.
This commit is contained in:
David Blaikie
2025-03-05 20:02:14 +00:00
committed by GitHub
parent 10a87c045a
commit e71d5942bc
3 changed files with 81 additions and 39 deletions
@@ -12,6 +12,10 @@ fn F(n: i32);
fn G(n: i32) { F(n); }
class A;
fn H(n: A);
fn I() -> A;
// CHECK:STDOUT: ; ModuleID = 'simple.carbon'
// CHECK:STDOUT: source_filename = "simple.carbon"
// CHECK:STDOUT:
@@ -23,6 +27,10 @@ fn G(n: i32) { F(n); }
// CHECK:STDOUT: ret void, !dbg !8
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_CH.Main()
// CHECK:STDOUT:
// CHECK:STDOUT: declare void @_CI.Main()
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1}
// CHECK:STDOUT: !llvm.dbg.cu = !{!2}
// CHECK:STDOUT: