mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.unified] cmd/compile: allow inlining to fail gracefully
Change-Id: I20c7df52d110fb88eb22d57bdad9264d0c5e22fe Reviewed-on: https://go-review.googlesource.com/c/go/+/419674 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
831fdf1dff
commit
f2851c67fd
2 changed files with 9 additions and 5 deletions
|
|
@ -2227,7 +2227,12 @@ func InlineCall(call *ir.CallExpr, fn *ir.Func, inlIndex int) *ir.InlinedCallExp
|
|||
|
||||
pri, ok := bodyReader[fn]
|
||||
if !ok {
|
||||
base.FatalfAt(call.Pos(), "missing function body for call to %v", fn)
|
||||
// TODO(mdempsky): Reconsider this diagnostic's wording, if it's
|
||||
// to be included in Go 1.20.
|
||||
if base.Flag.LowerM != 0 {
|
||||
base.WarnfAt(call.Pos(), "cannot inline call to %v: missing inline body", fn)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if fn.Inl.Body == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue