github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/noder/unified.go (about) 1 // Copyright 2021 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package noder 6 7 import ( 8 "github.com/shogo82148/std/cmd/compile/internal/ir" 9 ) 10 11 // LookupMethodFunc returns the ir.Func for an arbitrary full symbol name if 12 // that function exists in the set of available export data. 13 // 14 // This allows lookup of arbitrary functions and methods that aren't otherwise 15 // referenced by the local package and thus haven't been read yet. 16 // 17 // TODO(prattmic): Does not handle instantiation of generic types. Currently 18 // profiles don't contain the original type arguments, so we won't be able to 19 // create the runtime dictionaries. 20 // 21 // TODO(prattmic): Hit rate of this function is usually fairly low, and errors 22 // are only used when debug logging is enabled. Consider constructing cheaper 23 // errors by default. 24 func LookupFunc(fullName string) (*ir.Func, error)