Debian Codegraph @

internal/pkgbits/version.go

raw symbols SCIP
1 // Copyright 2024 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 pkgbitsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/
6
7 // Version indicates a version of a unified IR bitstream.
8 // Each Version indicates the addition, removal, or change of
9 // new data in the bitstream.
10 //
11 // These are serialized to disk and the interpretation remains fixed.
12 type Versionscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Version# uint32
13
14 const (
15 // V0: initial prototype.
16 //
17 // All data that is not assigned a Field is in version V0
18 // and has not been deprecated.
19 V0scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V0. Versionscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Version# = iota
20
21 // V1: adds the Flags uint32 word
22 V1scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V1.
23
24 // V2: removes unused legacy fields and supports type parameters for aliases.
25 // - remove the legacy "has init" bool from the public root
26 // - remove obj's "derived func instance" bool
27 // - add a TypeParamNames field to ObjAlias
28 // - remove derived info "needed" bool
29 V2scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V2.
30
31 // V3: introduces a more compact format for composite literal element lists
32 // - negative lengths indicate that (some) elements may have keys
33 // - positive lengths indicate that no element has a key
34 // - a negative struct field index indicates an embedded field
35 V3scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V3.
36
37 // V4: encodes generic methods as standalone function objects
38 V4scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V4.
39
40 numVersionsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/numVersions. = iota
41 )
42
43 // Field denotes a unit of data in the serialized unified IR bitstream.
44 // It is conceptually a like field in a structure.
45 //
46 // We only really need Fields when the data may or may not be present
47 // in a stream based on the Version of the bitstream.
48 //
49 // Unlike much of pkgbits, Fields are not serialized and
50 // can change values as needed.
51 type Fieldscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Field# int
52
53 const (
54 // Flags in a uint32 in the header of a bitstream
55 // that is used to indicate whether optional features are enabled.
56 Flagsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Flags. Fieldscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Field# = iota
57
58 // Deprecated: HasInit was a bool indicating whether a package
59 // has any init functions.
60 HasInitscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/HasInit.
61
62 // Deprecated: DerivedFuncInstance was a bool indicating
63 // whether an object was a function instance.
64 DerivedFuncInstancescip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/DerivedFuncInstance.
65
66 // ObjAlias has a list of TypeParamNames.
67 AliasTypeParamNamesscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/AliasTypeParamNames.
68
69 // Deprecated: DerivedInfoNeeded was a bool indicating
70 // whether a type was a derived type.
71 DerivedInfoNeededscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/DerivedInfoNeeded.
72
73 // Composite literals use a more compact format for element lists.
74 CompactCompLiteralsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/CompactCompLiterals.
75
76 // Generic methods may appear as standalone function objects.
77 GenericMethodsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/GenericMethods.
78
79 numFieldsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/numFields. = iota
80 )
81
82 // introduced is the version a field was added.
83 var introducedscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/introduced. = [numFieldsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/numFields.]Versionscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Version#{
84 Flagsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Flags.: V1scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V1.,
85 AliasTypeParamNamesscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/AliasTypeParamNames.: V2scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V2.,
86 CompactCompLiteralsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/CompactCompLiterals.: V3scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V3.,
87 GenericMethodsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/GenericMethods.: V4scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V4.,
88 }
89
90 // removed is the version a field was removed in or 0 for fields
91 // that have not yet been deprecated.
92 // (So removed[f]-1 is the last version it is included in.)
93 var removedscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/removed. = [numFieldsscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/numFields.]Versionscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Version#{
94 HasInitscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/HasInit.: V2scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V2.,
95 DerivedFuncInstancescip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/DerivedFuncInstance.: V2scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V2.,
96 DerivedInfoNeededscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/DerivedInfoNeeded.: V2scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V2.,
97 }
98
99 // Has reports whether field f is present in a bitstream at version v.
100 func (v Versionscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Version#) Hasscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Version#Has().(f Fieldscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/Field#) bool {
101 return introducedscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/introduced.[f] <= v && (v < removedscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/removed.[f] || removedscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/removed.[f] == V0scip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/pkgbits`/V0.)
102 }