]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/noder: begin filling in SectionObj
authorMark Freeman <mark@golang.org>
Thu, 29 May 2025 20:06:27 +0000 (16:06 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 2 Jun 2025 18:58:30 +0000 (11:58 -0700)
SectionObj has to encode the definition information for each object
type, so it will be a bit long.

Change-Id: I9b9514d58a284a4e64020f99fd1b2a92f7752338
Reviewed-on: https://go-review.googlesource.com/c/go/+/677377
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <mark@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/noder/doc.go

index 05fcddadc5198b43249f5c4cf5cc0b565dc03ad5..142f40c28a71852aa089ec85b4f9b1871fbbdcaf 100644 (file)
@@ -27,7 +27,7 @@ determines its index in the series.
                   SectionPkg
                   SectionName
                   SectionType    // TODO(markfreeman) Define.
-                  SectionObj     // TODO(markfreeman) Define.
+                  SectionObj
                   SectionObjExt  // TODO(markfreeman) Define.
                   SectionObjDict // TODO(markfreeman) Define.
                   SectionBody    // TODO(markfreeman) Define.
@@ -159,6 +159,23 @@ for objects.
                   Uint64    // the object's type (e.g. Var, Func, etc.)
                   .
 
+### Definition Section
+The definition section holds definitions for objects defined by the
+target package; it does not contain definitions for imported objects.
+
+    SectionObj = { ObjectDef } .
+
+Object definitions can be one of several formats. To determine the
+correct format, the name section must be referenced for the object's
+type.
+
+    ObjectDef = ObjectDefConst     // TODO(markfreeman) Define.
+              | ObjectDefFunc      // TODO(markfreeman) Define.
+              | ObjectDefAlias     // TODO(markfreeman) Define.
+              | ObjectDefNamedType // TODO(markfreeman) Define.
+              | ObjectDefVar       // TODO(markfreeman) Define.
+                .
+
 # References
 A reference table precedes every element. Each entry in the table
 contains a (section, index) pair denoting the location of the