1
2
3
4
5
6
7 package noder
8
9 import (
10 "fmt"
11 "strings"
12 )
13
14
15
16
17
18
19
20
21
22
23 const enableSync = true
24
25
26 func fmtFrames(pcs ...uintptr) []string {
27 res := make([]string, 0, len(pcs))
28 walkFrames(pcs, func(file string, line int, name string, offset uintptr) {
29
30 name = strings.TrimPrefix(name, "cmd/compile/internal/noder.")
31
32 res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset))
33 })
34 return res
35 }
36
37 type frameVisitor func(file string, line int, name string, offset uintptr)
38
39
40
41
42 type syncMarker int
43
44
45
46
47
48
49
50 const (
51 _ syncMarker = iota
52 syncNode
53 syncBool
54 syncInt64
55 syncUint64
56 syncString
57 syncPos
58 syncPkg
59 syncSym
60 syncSelector
61 syncKind
62 syncType
63 syncTypePkg
64 syncSignature
65 syncParam
66 syncOp
67 syncObject
68 syncExpr
69 syncStmt
70 syncDecl
71 syncConstDecl
72 syncFuncDecl
73 syncTypeDecl
74 syncVarDecl
75 syncPragma
76 syncValue
77 syncEOF
78 syncMethod
79 syncFuncBody
80 syncUse
81 syncUseObj
82 syncObjectIdx
83 syncTypeIdx
84 syncBOF
85 syncEntry
86 syncOpenScope
87 syncCloseScope
88 syncGlobal
89 syncLocal
90 syncDefine
91 syncDefLocal
92 syncUseLocal
93 syncDefGlobal
94 syncUseGlobal
95 syncTypeParams
96 syncUseLabel
97 syncDefLabel
98 syncFuncLit
99 syncCommonFunc
100 syncBodyRef
101 syncLinksymExt
102 syncHack
103 syncSetlineno
104 syncName
105 syncImportDecl
106 syncDeclNames
107 syncDeclName
108 syncExprList
109 syncExprs
110 syncWrapname
111 syncTypeExpr
112 syncTypeExprOrNil
113 syncChanDir
114 syncParams
115 syncCloseAnotherScope
116 syncSum
117 syncUnOp
118 syncBinOp
119 syncStructType
120 syncInterfaceType
121 syncPackname
122 syncEmbedded
123 syncStmts
124 syncStmtsFall
125 syncStmtFall
126 syncBlockStmt
127 syncIfStmt
128 syncForStmt
129 syncSwitchStmt
130 syncRangeStmt
131 syncCaseClause
132 syncCommClause
133 syncSelectStmt
134 syncDecls
135 syncLabeledStmt
136 syncCompLit
137
138 sync1
139 sync2
140 sync3
141 sync4
142
143 syncN
144 syncDefImplicit
145 syncUseName
146 syncUseObjLocal
147 syncAddLocal
148 syncBothSignature
149 syncSetUnderlying
150 syncLinkname
151 syncStmt1
152 syncStmtsEnd
153 syncDeclare
154 syncTopDecls
155 syncTopConstDecl
156 syncTopFuncDecl
157 syncTopTypeDecl
158 syncTopVarDecl
159 syncObject1
160 syncAddBody
161 syncLabel
162 syncFuncExt
163 syncMethExt
164 syncOptLabel
165 syncScalar
166 syncStmtDecls
167 syncDeclLocal
168 syncObjLocal
169 syncObjLocal1
170 syncDeclareLocal
171 syncPublic
172 syncPrivate
173 syncRelocs
174 syncReloc
175 syncUseReloc
176 syncVarExt
177 syncPkgDef
178 syncTypeExt
179 syncVal
180 syncCodeObj
181 syncPosBase
182 syncLocalIdent
183 syncTypeParamNames
184 syncTypeParamBounds
185 syncImplicitTypes
186 syncObjectName
187 )
188
View as plain text