github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/internal/objabi/pkgspecial.go (about)

     1  // Copyright 2023 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 objabi
     6  
     7  // PkgSpecial indicates special build properties of a given runtime-related
     8  // package.
     9  type PkgSpecial struct {
    10  	// Runtime indicates that this package is "runtime" or imported by
    11  	// "runtime". This has several effects (which maybe should be split out):
    12  	//
    13  	// - Implicit allocation is disallowed.
    14  	//
    15  	// - Various runtime pragmas are enabled.
    16  	//
    17  	// - Optimizations are always enabled.
    18  	//
    19  	// This should be set for runtime and all packages it imports, and may be
    20  	// set for additional packages.
    21  	Runtime bool
    22  
    23  	// NoInstrument indicates this package should not receive sanitizer
    24  	// instrumentation. In many of these, instrumentation could cause infinite
    25  	// recursion. This is all runtime packages, plus those that support the
    26  	// sanitizers.
    27  	NoInstrument bool
    28  
    29  	// NoRaceFunc indicates functions in this package should not get
    30  	// racefuncenter/racefuncexit instrumentation Memory accesses in these
    31  	// packages are either uninteresting or will cause false positives.
    32  	NoRaceFunc bool
    33  
    34  	// AllowAsmABI indicates that assembly in this package is allowed to use ABI
    35  	// selectors in symbol names. Generally this is needed for packages that
    36  	// interact closely with the runtime package or have performance-critical
    37  	// assembly.
    38  	AllowAsmABI bool
    39  }
    40  
    41  // LookupPkgSpecial returns special build properties for the given package path.
    42  func LookupPkgSpecial(pkgPath string) PkgSpecial