diff options
| author | Mark Freeman <mark@golang.org> | 2025-05-12 12:21:03 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-05-12 13:46:33 -0700 |
| commit | 52624e533fe52329da5ba6ebb9c37712048168e0 (patch) | |
| tree | 5877bf6903dd8f5b13a210ef286db9d18fd42e5e /src/cmd/compile/internal/noder/reader.go | |
| parent | 019d79872681d49de7ea192ac2dbc02f0ce679fc (diff) | |
| download | go-52624e533fe52329da5ba6ebb9c37712048168e0.tar.xz | |
internal/pkgbits: rename Reloc* to Section*
This is a basic refactoring. This enumeration refers primarily to
the different sections of a UIR file, so this naming is a bit more
direct.
Change-Id: Ib70ab054e97effaabc035450d246ae4354da8075
Reviewed-on: https://go-review.googlesource.com/c/go/+/671935
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Mark Freeman <mark@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/reader.go')
| -rw-r--r-- | src/cmd/compile/internal/noder/reader.go | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go index 43163e16e5..05052651c6 100644 --- a/src/cmd/compile/internal/noder/reader.go +++ b/src/cmd/compile/internal/noder/reader.go @@ -55,9 +55,9 @@ func newPkgReader(pr pkgbits.PkgDecoder) *pkgReader { return &pkgReader{ PkgDecoder: pr, - posBases: make([]*src.PosBase, pr.NumElems(pkgbits.RelocPosBase)), - pkgs: make([]*types.Pkg, pr.NumElems(pkgbits.RelocPkg)), - typs: make([]*types.Type, pr.NumElems(pkgbits.RelocType)), + posBases: make([]*src.PosBase, pr.NumElems(pkgbits.SectionPosBase)), + pkgs: make([]*types.Pkg, pr.NumElems(pkgbits.SectionPkg)), + typs: make([]*types.Type, pr.NumElems(pkgbits.SectionType)), newindex: make([]index, pr.TotalElems()), } @@ -255,7 +255,7 @@ func (r *reader) pos0() src.Pos { // posBase reads a position base from the bitstream. func (r *reader) posBase() *src.PosBase { - return r.inlPosBase(r.p.posBaseIdx(r.Reloc(pkgbits.RelocPosBase))) + return r.inlPosBase(r.p.posBaseIdx(r.Reloc(pkgbits.SectionPosBase))) } // posBaseIdx returns the specified position base, reading it first if @@ -265,7 +265,7 @@ func (pr *pkgReader) posBaseIdx(idx index) *src.PosBase { return b } - r := pr.newReader(pkgbits.RelocPosBase, idx, pkgbits.SyncPosBase) + r := pr.newReader(pkgbits.SectionPosBase, idx, pkgbits.SyncPosBase) var b *src.PosBase absFilename := r.String() @@ -336,7 +336,7 @@ func (r *reader) inlPos(xpos src.XPos) src.XPos { // pkg reads a package reference from the bitstream. func (r *reader) pkg() *types.Pkg { r.Sync(pkgbits.SyncPkg) - return r.p.pkgIdx(r.Reloc(pkgbits.RelocPkg)) + return r.p.pkgIdx(r.Reloc(pkgbits.SectionPkg)) } // pkgIdx returns the specified package from the export data, reading @@ -346,7 +346,7 @@ func (pr *pkgReader) pkgIdx(idx index) *types.Pkg { return pkg } - pkg := pr.newReader(pkgbits.RelocPkg, idx, pkgbits.SyncPkgDef).doPkg() + pkg := pr.newReader(pkgbits.SectionPkg, idx, pkgbits.SyncPkgDef).doPkg() pr.pkgs[idx] = pkg return pkg } @@ -393,7 +393,7 @@ func (r *reader) typInfo() typeInfo { if r.Bool() { return typeInfo{idx: index(r.Len()), derived: true} } - return typeInfo{idx: r.Reloc(pkgbits.RelocType), derived: false} + return typeInfo{idx: r.Reloc(pkgbits.SectionType), derived: false} } // typListIdx returns a list of the specified types, resolving derived @@ -423,7 +423,7 @@ func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict, wrapped bool) *type return typ } - r := pr.newReader(pkgbits.RelocType, idx, pkgbits.SyncTypeIdx) + r := pr.newReader(pkgbits.SectionType, idx, pkgbits.SyncTypeIdx) r.dict = dict typ := r.doTyp() @@ -643,7 +643,7 @@ func (r *reader) objInfo() objInfo { if r.Version().Has(pkgbits.DerivedFuncInstance) { assert(!r.Bool()) } - idx := r.Reloc(pkgbits.RelocObj) + idx := r.Reloc(pkgbits.SectionObj) explicits := make([]typeInfo, r.Len()) for i := range explicits { @@ -685,7 +685,7 @@ func (pr *pkgReader) objIdx(idx index, implicits, explicits []*types.Type, shape // Other sources of internal failure (such as duplicate definitions) still fail // the build. func (pr *pkgReader) objIdxMayFail(idx index, implicits, explicits []*types.Type, shaped bool) (ir.Node, error) { - rname := pr.newReader(pkgbits.RelocName, idx, pkgbits.SyncObject1) + rname := pr.newReader(pkgbits.SectionName, idx, pkgbits.SyncObject1) _, sym := rname.qualifiedIdent() tag := pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj)) @@ -714,8 +714,8 @@ func (pr *pkgReader) objIdxMayFail(idx index, implicits, explicits []*types.Type return sym.Def.(*ir.Name), nil } - r := pr.newReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) - rext := pr.newReader(pkgbits.RelocObjExt, idx, pkgbits.SyncObject1) + r := pr.newReader(pkgbits.SectionObj, idx, pkgbits.SyncObject1) + rext := pr.newReader(pkgbits.SectionObjExt, idx, pkgbits.SyncObject1) r.dict = dict rext.dict = dict @@ -959,7 +959,7 @@ func shapify(targ *types.Type, basic bool) *types.Type { // objDictIdx reads and returns the specified object dictionary. func (pr *pkgReader) objDictIdx(sym *types.Sym, idx index, implicits, explicits []*types.Type, shaped bool) (*readerDict, error) { - r := pr.newReader(pkgbits.RelocObjDict, idx, pkgbits.SyncObject1) + r := pr.newReader(pkgbits.SectionObjDict, idx, pkgbits.SyncObject1) dict := readerDict{ shaped: shaped, @@ -984,7 +984,7 @@ func (pr *pkgReader) objDictIdx(sym *types.Sym, idx index, implicits, explicits dict.derived = make([]derivedInfo, r.Len()) dict.derivedTypes = make([]*types.Type, len(dict.derived)) for i := range dict.derived { - dict.derived[i] = derivedInfo{idx: r.Reloc(pkgbits.RelocType)} + dict.derived[i] = derivedInfo{idx: r.Reloc(pkgbits.SectionType)} if r.Version().Has(pkgbits.DerivedInfoNeeded) { assert(!r.Bool()) } @@ -1278,7 +1278,7 @@ func (r *reader) addBody(fn *ir.Func, method *types.Sym) { // generic functions; see comment in funcExt. assert(fn.Nname.Defn != nil) - idx := r.Reloc(pkgbits.RelocBody) + idx := r.Reloc(pkgbits.SectionBody) pri := pkgReaderIndex{r.p, idx, r.dict, method, nil} bodyReader[fn] = pri @@ -1292,7 +1292,7 @@ func (r *reader) addBody(fn *ir.Func, method *types.Sym) { } func (pri pkgReaderIndex) funcBody(fn *ir.Func) { - r := pri.asReader(pkgbits.RelocBody, pkgbits.SyncFuncBody) + r := pri.asReader(pkgbits.SectionBody, pkgbits.SyncFuncBody) r.funcBody(fn) } @@ -2591,7 +2591,7 @@ func (r *reader) funcInst(pos src.XPos) (wrapperFn, baseFn, dictPtr ir.Node) { } func (pr *pkgReader) objDictName(idx index, implicits, explicits []*types.Type) *ir.Name { - rname := pr.newReader(pkgbits.RelocName, idx, pkgbits.SyncObject1) + rname := pr.newReader(pkgbits.SectionName, idx, pkgbits.SyncObject1) _, sym := rname.qualifiedIdent() tag := pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj)) @@ -3437,7 +3437,7 @@ func unifiedInlineCall(callerfn *ir.Func, call *ir.CallExpr, fn *ir.Func, inlInd expandInline(fn, pri) } - r := pri.asReader(pkgbits.RelocBody, pkgbits.SyncFuncBody) + r := pri.asReader(pkgbits.SectionBody, pkgbits.SyncFuncBody) tmpfn := ir.NewFunc(fn.Pos(), fn.Nname.Pos(), callerfn.Sym(), fn.Type()) @@ -3626,7 +3626,7 @@ func expandInline(fn *ir.Func, pri pkgReaderIndex) { tmpfn.ClosureVars = fn.ClosureVars { - r := pri.asReader(pkgbits.RelocBody, pkgbits.SyncFuncBody) + r := pri.asReader(pkgbits.SectionBody, pkgbits.SyncFuncBody) // Don't change parameter's Sym/Nname fields. r.funarghack = true |
