mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
tint: Rename and move builtin_table and builtin-gen
• Rename 'builtin-gen' back to 'intrinsic-gen', as 'intrinsics' now include both builtins and operators. • Move the intrinsic definitions, and IntrinsicTable to the resolver package, where it belongs. Bug: tint:1504 Change-Id: I5ad5c285c1e360a224ee1235c293ccd55eb2693d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/89025 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
7f7234afad
commit
e132516e6f
@@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/tok"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/tok"
|
||||
)
|
||||
|
||||
// AST is the parsed syntax tree of the intrinsic definition file
|
||||
@@ -17,7 +17,7 @@ package gen
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/list"
|
||||
"dawn.googlesource.com/dawn/tools/src/lut"
|
||||
)
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"text/template"
|
||||
"unicode"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/sem"
|
||||
)
|
||||
|
||||
type generator struct {
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/fileutils"
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"unicode"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/tok"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/tok"
|
||||
)
|
||||
|
||||
// Lex produces a list of tokens for the given source code
|
||||
@@ -18,8 +18,8 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/lexer"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/tok"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/lexer"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/tok"
|
||||
)
|
||||
|
||||
func TestLexTokens(t *testing.T) {
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// builtin-gen parses the <tint>/src/tint/builtins.def file, then scans the
|
||||
// intrinsic-gen parses the <tint>/src/tint/intrinsics.def file, then scans the
|
||||
// project directory for '<file>.tmpl' files, to produce '<file>' source code
|
||||
// files.
|
||||
package main
|
||||
@@ -25,14 +25,14 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/gen"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/parser"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/resolver"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/gen"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/parser"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/resolver"
|
||||
"dawn.googlesource.com/dawn/tools/src/fileutils"
|
||||
"dawn.googlesource.com/dawn/tools/src/glob"
|
||||
)
|
||||
|
||||
const defProjectRelPath = "src/tint/builtins.def"
|
||||
const defProjectRelPath = "src/tint/intrinsics.def"
|
||||
|
||||
func main() {
|
||||
if err := run(); err != nil {
|
||||
@@ -43,13 +43,13 @@ func main() {
|
||||
|
||||
func showUsage() {
|
||||
fmt.Println(`
|
||||
builtin-gen generates the builtin table for the Tint compiler
|
||||
intrinsic-gen generates the intrinsic table for the Tint compiler
|
||||
|
||||
builtin-gen parses the <tint>/src/tint/builtins.def file, then scans the project
|
||||
intrinsic-gen parses the <tint>/src/tint/intrinsics.def file, then scans the project
|
||||
directory for '<file>.tmpl' files, to produce '<file>' source code files.
|
||||
|
||||
usage:
|
||||
builtin-gen
|
||||
intrinsic-gen
|
||||
|
||||
optional flags:`)
|
||||
flag.PrintDefaults()
|
||||
@@ -161,10 +161,10 @@ const header = `// Copyright 2021 The Tint Authors.
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/builtin-gen
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// %v
|
||||
// and the builtin defintion file:
|
||||
// and the intrinsic defintion file:
|
||||
// %v
|
||||
//
|
||||
// Do not modify this file directly
|
||||
@@ -19,9 +19,9 @@ package parser
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/lexer"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/tok"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/lexer"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/tok"
|
||||
)
|
||||
|
||||
// Parse produces a list of tokens for the given source code
|
||||
@@ -17,8 +17,8 @@ package parser_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/parser"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/parser"
|
||||
)
|
||||
|
||||
func TestParser(t *testing.T) {
|
||||
@@ -18,9 +18,9 @@ import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/tok"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/sem"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/tok"
|
||||
)
|
||||
|
||||
type resolver struct {
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/parser"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/resolver"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/parser"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/resolver"
|
||||
)
|
||||
|
||||
func TestResolver(t *testing.T) {
|
||||
@@ -17,7 +17,7 @@ package sem
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/builtin-gen/ast"
|
||||
"dawn.googlesource.com/dawn/tools/src/cmd/intrinsic-gen/ast"
|
||||
)
|
||||
|
||||
// Sem is the root of the semantic tree
|
||||
Reference in New Issue
Block a user