r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic)
pkg := r.pkg()
- r.Bool() // TODO(mdempsky): Remove; was "has init"
+
+ if r.Version().Has(pkgbits.HasInit) {
+ r.Bool()
+ }
for i, n := 0, r.Len(); i < n; i++ {
// As if r.obj(), but avoiding the Scope.Lookup call,
// to avoid eager loading of imports.
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool())
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
r.p.objIdx(r.Reloc(pkgbits.RelocObj))
assert(r.Len() == 0)
}
func (r *reader) obj() (types2.Object, []types2.Type) {
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool())
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj))
obj := pkg.Scope().Lookup(name)
// and returns the encoded reference to it, without instantiating it.
func (r *reader) objInfo() objInfo {
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool()) // TODO(mdempsky): Remove; was derived func inst.
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
idx := r.Reloc(pkgbits.RelocObj)
explicits := make([]typeInfo, r.Len())
{
w := publicRootWriter
w.pkg(pkg)
- w.Bool(false) // TODO(mdempsky): Remove; was "has init"
+
+ if w.Version().Has(pkgbits.HasInit) {
+ w.Bool(false)
+ }
scope := pkg.Scope()
names := scope.Names()
base.ErrorExit()
}
- r.Bool() // TODO(mdempsky): Remove; was "has init"
+ if r.Version().Has(pkgbits.HasInit) {
+ r.Bool()
+ }
for i, n := 0, r.Len(); i < n; i++ {
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool())
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
idx := r.Reloc(pkgbits.RelocObj)
assert(r.Len() == 0)
r.Sync(pkgbits.SyncPkg)
selfPkgIdx = l.relocIdx(pr, pkgbits.RelocPkg, r.Reloc(pkgbits.RelocPkg))
- r.Bool() // TODO(mdempsky): Remove; was "has init"
+ if r.Version().Has(pkgbits.HasInit) {
+ r.Bool()
+ }
for i, n := 0, r.Len(); i < n; i++ {
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool())
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
idx := r.Reloc(pkgbits.RelocObj)
assert(r.Len() == 0)
w.Sync(pkgbits.SyncPkg)
w.Reloc(pkgbits.RelocPkg, selfPkgIdx)
- w.Bool(false) // TODO(mdempsky): Remove; was "has init"
+
+ if w.Version().Has(pkgbits.HasInit) {
+ w.Bool(false)
+ }
w.Len(len(idxs))
for _, idx := range idxs {
w.Sync(pkgbits.SyncObject)
- w.Bool(false)
+ if w.Version().Has(pkgbits.DerivedFuncInstance) {
+ w.Bool(false)
+ }
w.Reloc(pkgbits.RelocObj, idx)
w.Len(0)
}
// bitstream.
func (w *writer) objInfo(info objInfo) {
w.Sync(pkgbits.SyncObject)
- w.Bool(false) // TODO(mdempsky): Remove; was derived func inst.
+ if w.Version().Has(pkgbits.DerivedFuncInstance) {
+ w.Bool(false)
+ }
w.Reloc(pkgbits.RelocObj, info.idx)
w.Len(len(info.explicits))
r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic)
pkg := r.pkg()
- r.Bool() // TODO(mdempsky): Remove; was "has init"
+ if r.Version().Has(pkgbits.HasInit) {
+ r.Bool()
+ }
for i, n := 0, r.Len(); i < n; i++ {
// As if r.obj(), but avoiding the Scope.Lookup call,
// to avoid eager loading of imports.
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool())
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
r.p.objIdx(r.Reloc(pkgbits.RelocObj))
assert(r.Len() == 0)
}
func (r *reader) obj() (types.Object, []types.Type) {
r.Sync(pkgbits.SyncObject)
- assert(!r.Bool())
+ if r.Version().Has(pkgbits.DerivedFuncInstance) {
+ assert(!r.Bool())
+ }
pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj))
obj := pkgScope(pkg).Lookup(name)