From 5c67547d670eb31c66d94793474497f230f2765e Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Sat, 5 Jan 2019 17:23:56 -0800 Subject: [PATCH] doc: add package-level doc comments (#9) --- build/doc.go | 2 ++ doc.go | 2 ++ examples/add/doc.go | 2 ++ examples/args/doc.go | 2 ++ examples/complex/doc.go | 2 ++ examples/data/doc.go | 2 ++ examples/dot/doc.go | 2 ++ examples/fnv1a/doc.go | 2 ++ examples/geohash/doc.go | 2 ++ examples/returns/doc.go | 2 ++ examples/sha1/doc.go | 2 ++ examples/sum/doc.go | 2 ++ internal/gen/doc.go | 2 ++ internal/inst/doc.go | 2 ++ internal/load/doc.go | 2 ++ internal/opcodescsv/doc.go | 2 ++ internal/opcodesxml/opcodesxml.go | 1 + internal/prnt/printer.go | 1 + internal/stack/stack.go | 1 + internal/test/utils.go | 1 + operand/doc.go | 2 ++ reg/doc.go | 2 ++ tests/cast/doc.go | 2 ++ tests/textflag/doc.go | 2 ++ x86/doc.go | 2 ++ 25 files changed, 46 insertions(+) create mode 100644 build/doc.go create mode 100644 doc.go create mode 100644 examples/add/doc.go create mode 100644 examples/args/doc.go create mode 100644 examples/complex/doc.go create mode 100644 examples/data/doc.go create mode 100644 examples/dot/doc.go create mode 100644 examples/fnv1a/doc.go create mode 100644 examples/geohash/doc.go create mode 100644 examples/returns/doc.go create mode 100644 examples/sha1/doc.go create mode 100644 examples/sum/doc.go create mode 100644 internal/gen/doc.go create mode 100644 internal/inst/doc.go create mode 100644 internal/load/doc.go create mode 100644 internal/opcodescsv/doc.go create mode 100644 operand/doc.go create mode 100644 reg/doc.go create mode 100644 tests/cast/doc.go create mode 100644 tests/textflag/doc.go create mode 100644 x86/doc.go diff --git a/build/doc.go b/build/doc.go new file mode 100644 index 00000000..8b9a6047 --- /dev/null +++ b/build/doc.go @@ -0,0 +1,2 @@ +// Package build provides an assembly-like interface for incremental building of avo Files. +package build diff --git a/doc.go b/doc.go new file mode 100644 index 00000000..4ffb3759 --- /dev/null +++ b/doc.go @@ -0,0 +1,2 @@ +// Package avo is a high-level x86 assembly generator. +package avo diff --git a/examples/add/doc.go b/examples/add/doc.go new file mode 100644 index 00000000..43645a74 --- /dev/null +++ b/examples/add/doc.go @@ -0,0 +1,2 @@ +// Package add demonstrates an Add function in avo. +package add diff --git a/examples/args/doc.go b/examples/args/doc.go new file mode 100644 index 00000000..de9fbf99 --- /dev/null +++ b/examples/args/doc.go @@ -0,0 +1,2 @@ +// Package args demonstrates how to load function arguments in avo. +package args diff --git a/examples/complex/doc.go b/examples/complex/doc.go new file mode 100644 index 00000000..fb2f9cf0 --- /dev/null +++ b/examples/complex/doc.go @@ -0,0 +1,2 @@ +// Package complex shows how to work with complex types in avo. +package complex diff --git a/examples/data/doc.go b/examples/data/doc.go new file mode 100644 index 00000000..40cf4948 --- /dev/null +++ b/examples/data/doc.go @@ -0,0 +1,2 @@ +// Package data shows how to define DATA sections in avo. +package data diff --git a/examples/dot/doc.go b/examples/dot/doc.go new file mode 100644 index 00000000..097d47a9 --- /dev/null +++ b/examples/dot/doc.go @@ -0,0 +1,2 @@ +// Package dot implements vector dot product in avo. +package dot diff --git a/examples/fnv1a/doc.go b/examples/fnv1a/doc.go new file mode 100644 index 00000000..35729725 --- /dev/null +++ b/examples/fnv1a/doc.go @@ -0,0 +1,2 @@ +// Package fnv1a implements FNV-1a in avo. +package fnv1a diff --git a/examples/geohash/doc.go b/examples/geohash/doc.go new file mode 100644 index 00000000..2914e972 --- /dev/null +++ b/examples/geohash/doc.go @@ -0,0 +1,2 @@ +// Package geohash implements integer geohash encoding in avo. +package geohash diff --git a/examples/returns/doc.go b/examples/returns/doc.go new file mode 100644 index 00000000..beea4df8 --- /dev/null +++ b/examples/returns/doc.go @@ -0,0 +1,2 @@ +// Package returns demonstrates how to write function return values in avo. +package returns diff --git a/examples/sha1/doc.go b/examples/sha1/doc.go new file mode 100644 index 00000000..11850004 --- /dev/null +++ b/examples/sha1/doc.go @@ -0,0 +1,2 @@ +// Package sha1 implements the SHA-1 hash in avo. +package sha1 diff --git a/examples/sum/doc.go b/examples/sum/doc.go new file mode 100644 index 00000000..60cf3805 --- /dev/null +++ b/examples/sum/doc.go @@ -0,0 +1,2 @@ +// Package sum sums a slice in avo. +package sum diff --git a/internal/gen/doc.go b/internal/gen/doc.go new file mode 100644 index 00000000..cb196308 --- /dev/null +++ b/internal/gen/doc.go @@ -0,0 +1,2 @@ +// Package gen provides code generators based on the instruction database. +package gen diff --git a/internal/inst/doc.go b/internal/inst/doc.go new file mode 100644 index 00000000..37ff6aea --- /dev/null +++ b/internal/inst/doc.go @@ -0,0 +1,2 @@ +// Package inst is the avo instruction database. +package inst diff --git a/internal/load/doc.go b/internal/load/doc.go new file mode 100644 index 00000000..7e81b3e9 --- /dev/null +++ b/internal/load/doc.go @@ -0,0 +1,2 @@ +// Package load loads the instruction database from external sources. +package load diff --git a/internal/opcodescsv/doc.go b/internal/opcodescsv/doc.go new file mode 100644 index 00000000..3300252c --- /dev/null +++ b/internal/opcodescsv/doc.go @@ -0,0 +1,2 @@ +// Package opcodescsv extracts data from the Go x86.csv database. +package opcodescsv diff --git a/internal/opcodesxml/opcodesxml.go b/internal/opcodesxml/opcodesxml.go index ae59ba8e..a324cde3 100644 --- a/internal/opcodesxml/opcodesxml.go +++ b/internal/opcodesxml/opcodesxml.go @@ -1,3 +1,4 @@ +// Package opcodesxml is a reader for the Opcodes XML database. package opcodesxml import ( diff --git a/internal/prnt/printer.go b/internal/prnt/printer.go index 86b46316..12cc6db9 100644 --- a/internal/prnt/printer.go +++ b/internal/prnt/printer.go @@ -1,3 +1,4 @@ +// Package prnt provides common functionality for code generators. package prnt import ( diff --git a/internal/stack/stack.go b/internal/stack/stack.go index 5944c893..8445ba5c 100644 --- a/internal/stack/stack.go +++ b/internal/stack/stack.go @@ -1,3 +1,4 @@ +// Package stack provides helpers for querying the callstack. package stack import ( diff --git a/internal/test/utils.go b/internal/test/utils.go index f56babef..cf5c87c2 100644 --- a/internal/test/utils.go +++ b/internal/test/utils.go @@ -1,3 +1,4 @@ +// Package test provides testing utilities. package test import ( diff --git a/operand/doc.go b/operand/doc.go new file mode 100644 index 00000000..51c44dfb --- /dev/null +++ b/operand/doc.go @@ -0,0 +1,2 @@ +// Package operand provides types for instruction operands. +package operand diff --git a/reg/doc.go b/reg/doc.go new file mode 100644 index 00000000..1c0aee37 --- /dev/null +++ b/reg/doc.go @@ -0,0 +1,2 @@ +// Package reg provides types for physical and virtual registers, and definitions of x86-64 register families. +package reg diff --git a/tests/cast/doc.go b/tests/cast/doc.go new file mode 100644 index 00000000..d841839d --- /dev/null +++ b/tests/cast/doc.go @@ -0,0 +1,2 @@ +// Package cast tests casting virtual registers to different sizes. +package cast diff --git a/tests/textflag/doc.go b/tests/textflag/doc.go new file mode 100644 index 00000000..41e64f33 --- /dev/null +++ b/tests/textflag/doc.go @@ -0,0 +1,2 @@ +// Package textflag tests that avo attribute constants agree with textflag.h. +package textflag diff --git a/x86/doc.go b/x86/doc.go new file mode 100644 index 00000000..6e4c8ee8 --- /dev/null +++ b/x86/doc.go @@ -0,0 +1,2 @@ +// Package x86 provides constructors for all x86-64 instructions. +package x86