mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
This works by creating a faux FunctionDecl in the context of the current IR, which seems to be working for function calls. Deduced params are there, but won't really be tested until classes are up and running. Also I may need to look further at return_slot_id to ensure it's working. But the basics, I think, are here. Reorganizes some other ImportRef work from `has_unresolved` that'd relied on manual calls to a more detection-based `HasUnresolved` approach that doesn't require as much checking.
24 lines
684 B
Plaintext
24 lines
684 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
|
|
fn Foo();
|
|
|
|
fn Foo() {}
|
|
|
|
// CHECK:STDOUT: --- forward_decl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace {.Foo = %Foo.loc7} [template]
|
|
// CHECK:STDOUT: %Foo.loc7: <function> = fn_decl @Foo [template]
|
|
// CHECK:STDOUT: %Foo.loc9: <function> = fn_decl @Foo [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Foo() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|