aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iimport.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-04-26 14:32:23 -0700
committerDan Scales <danscales@google.com>2021-05-07 21:35:41 +0000
commitf24eac47710b0170fd45611ab1867e87701e0a95 (patch)
tree485a45d4d3be76ca28f3fc6d0f18e994b86b25d4 /src/cmd/compile/internal/typecheck/iimport.go
parent3980c4db192783c6aefa0a5978e553046c9c7dea (diff)
downloadgo-f24eac47710b0170fd45611ab1867e87701e0a95.tar.gz
go-f24eac47710b0170fd45611ab1867e87701e0a95.zip
cmd/compile: improving the documentation of various fields and functions
This is only changes to comments, so should be fine to go into 1.17. Change-Id: I01e28dc76b03fb3ca846d976f8ac84bc2acb2ea2 Reviewed-on: https://go-review.googlesource.com/c/go/+/318009 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iimport.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index 00f6a6e483..a5ddbb5a74 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -42,6 +42,9 @@ var (
inlineImporter = map[*types.Sym]iimporterAndOffset{}
)
+// expandDecl returns immediately if n is already a Name node. Otherwise, n should
+// be an Ident node, and expandDecl reads in the definition of the specified
+// identifier from the appropriate package.
func expandDecl(n ir.Node) ir.Node {
if n, ok := n.(*ir.Name); ok {
return n
@@ -61,6 +64,8 @@ func expandDecl(n ir.Node) ir.Node {
return r.doDecl(n.Sym())
}
+// ImportBody reads in the dcls and body of an imported function (which should not
+// yet have been read in).
func ImportBody(fn *ir.Func) {
if fn.Inl.Body != nil {
base.Fatalf("%v already has inline body", fn)