Skip to content
Snippets Groups Projects
Commit bd1f9a49 authored by Mark Freeman's avatar Mark Freeman Committed by Gopher Robot
Browse files

pkgbits: consolidate doc.go to only relevant details

The stated goal for pkgbits is to implement encoding / decoding of
primitives. However, pkgbits has knowledge of high-level details like
elements, sections, and file layout.

This change starts to clarify pkgbits by paring back documentation to
only those concepts which pkgbits owns. Further CLs are needed to shift
away logic that pkgbits should not own.

Change-Id: Id93003d080f58ffbd6327e2db1a4878500511619
Reviewed-on: https://go-review.googlesource.com/c/go/+/670176


LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Mark Freeman <mark@golang.org>
Reviewed-by: default avatarRobert Griesemer <gri@google.com>
Reviewed-by: default avatarMark Freeman <mark@golang.org>
parent ad7a6f81
No related branches found
No related tags found
No related merge requests found
...@@ -2,29 +2,16 @@ ...@@ -2,29 +2,16 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Package pkgbits implements low-level coding abstractions for // Package pkgbits implements low-level coding abstractions for Unified IR's
// Unified IR's export data format. // (UIR) binary export data format.
// //
// At a low-level, a package is a collection of bitstream elements. // At a low-level, the exported objects of a package are encoded as a byte
// Each element has a "kind" and a dense, non-negative index. // array. This array contains byte representations of primitive, potentially
// Elements can be randomly accessed given their kind and index. // variable-length values, such as integers, booleans, strings, and constants.
// //
// Individual elements are sequences of variable-length values (e.g., // Additionally, the array may contain values which denote indices in the byte
// integers, booleans, strings, go/constant values, cross-references // array itself. These are termed "relocations" and allow for references.
// to other elements). Package pkgbits provides APIs for encoding and
// decoding these low-level values, but the details of mapping
// higher-level Go constructs into elements is left to higher-level
// abstractions.
// //
// Elements may cross-reference each other with "relocations." For // The details of mapping high-level Go constructs to primitives are left to
// example, an element representing a pointer type has a relocation // other packages.
// referring to the element type.
//
// Go constructs may be composed as a constellation of multiple
// elements. For example, a declared function may have one element to
// describe the object (e.g., its name, type, position), and a
// separate element to describe its function body. This allows readers
// some flexibility in efficiently seeking or re-reading data (e.g.,
// inlining requires re-reading the function body for each inlined
// call, without needing to re-read the object-level details).
package pkgbits package pkgbits
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment