diff -urN c/go/analysis/BUILD.bazel d/go/analysis/BUILD.bazel
--- c/go/analysis/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/BUILD.bazel 2019-10-05 16:16:55.111496592 -0400
@@ -1,10 +1,22 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = [
         "analysis.go",
         "diagnostic.go",
+        "doc.go",
+        "validate.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis",
+    visibility = ["//visibility:public"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "analysis.go",
+        "diagnostic.go",
         "doc.go",
         "validate.go",
     ],
diff -urN c/go/analysis/internal/facts/BUILD.bazel d/go/analysis/internal/facts/BUILD.bazel
--- c/go/analysis/internal/facts/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/internal/facts/BUILD.bazel 2019-10-05 16:16:55.111496592 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -14,6 +14,23 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "facts.go",
+        "imports.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/internal/facts",
+    visibility = [
+        "//go/analysis:__subpackages__",
+        "@io_bazel_rules_go//go/tools/builders:__pkg__",
+    ],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/types/objectpath:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["facts_test.go"],
diff -urN c/go/analysis/passes/asmdecl/BUILD.bazel d/go/analysis/passes/asmdecl/BUILD.bazel
--- c/go/analysis/passes/asmdecl/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/passes/asmdecl/BUILD.bazel 2019-10-05 16:16:55.111496592 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -11,6 +11,17 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["asmdecl.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/asmdecl",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["asmdecl_test.go"],
diff -urN c/go/analysis/passes/assign/BUILD.bazel d/go/analysis/passes/assign/BUILD.bazel
--- c/go/analysis/passes/assign/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/passes/assign/BUILD.bazel 2019-10-05 16:16:55.111496592 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["assign.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/assign",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["assign_test.go"],
diff -urN c/go/analysis/passes/atomic/BUILD.bazel d/go/analysis/passes/atomic/BUILD.bazel
--- c/go/analysis/passes/atomic/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/passes/atomic/BUILD.bazel 2019-10-05 16:16:55.111496592 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["atomic.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomic",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["atomic_test.go"],
diff -urN c/go/analysis/passes/atomicalign/BUILD.bazel d/go/analysis/passes/atomicalign/BUILD.bazel
--- c/go/analysis/passes/atomicalign/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/passes/atomicalign/BUILD.bazel 2019-10-05 16:16:55.111496592 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["atomicalign.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomicalign",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["atomicalign_test.go"],
diff -urN c/go/analysis/passes/bools/BUILD.bazel d/go/analysis/passes/bools/BUILD.bazel
--- c/go/analysis/passes/bools/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/passes/bools/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["bools.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/bools",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["bools_test.go"],
diff -urN c/go/analysis/passes/buildssa/BUILD.bazel d/go/analysis/passes/buildssa/BUILD.bazel
--- c/go/analysis/passes/buildssa/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
+++ d/go/analysis/passes/buildssa/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -11,6 +11,17 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["buildssa.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/buildssa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/ssa:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["buildssa_test.go"],
diff -urN c/go/analysis/passes/buildtag/BUILD.bazel d/go/analysis/passes/buildtag/BUILD.bazel
--- c/go/analysis/passes/buildtag/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/buildtag/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -11,6 +11,17 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["buildtag.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/buildtag",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["buildtag_test.go"],
diff -urN c/go/analysis/passes/cgocall/BUILD.bazel d/go/analysis/passes/cgocall/BUILD.bazel
--- c/go/analysis/passes/cgocall/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/cgocall/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -11,6 +11,17 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["cgocall.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/cgocall",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["cgocall_test.go"],
diff -urN c/go/analysis/passes/composite/BUILD.bazel d/go/analysis/passes/composite/BUILD.bazel
--- c/go/analysis/passes/composite/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/composite/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -15,6 +15,21 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "composite.go",
+        "whitelist.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/composite",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["composite_test.go"],
diff -urN c/go/analysis/passes/copylock/BUILD.bazel d/go/analysis/passes/copylock/BUILD.bazel
--- c/go/analysis/passes/copylock/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/copylock/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["copylock.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/copylock",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["copylock_test.go"],
diff -urN c/go/analysis/passes/ctrlflow/BUILD.bazel d/go/analysis/passes/ctrlflow/BUILD.bazel
--- c/go/analysis/passes/ctrlflow/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/ctrlflow/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -14,6 +14,20 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["ctrlflow.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/ctrlflow",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/cfg:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["ctrlflow_test.go"],
diff -urN c/go/analysis/passes/deepequalerrors/BUILD.bazel d/go/analysis/passes/deepequalerrors/BUILD.bazel
--- c/go/analysis/passes/deepequalerrors/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/deepequalerrors/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["deepequalerrors.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/deepequalerrors",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["deepequalerrors_test.go"],
diff -urN c/go/analysis/passes/errorsas/BUILD.bazel d/go/analysis/passes/errorsas/BUILD.bazel
--- c/go/analysis/passes/errorsas/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/errorsas/BUILD.bazel 2019-10-05 16:52:40.946730971 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["errorsas.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/errorsas",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["errorsas_test.go"],
diff -urN c/go/analysis/passes/findcall/BUILD.bazel d/go/analysis/passes/findcall/BUILD.bazel
--- c/go/analysis/passes/findcall/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/findcall/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -8,6 +8,14 @@
     deps = ["//go/analysis:go_default_library"],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["findcall.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/findcall",
+    visibility = ["//visibility:public"],
+    deps = ["//go/analysis:go_tool_library"],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["findcall_test.go"],
diff -urN c/go/analysis/passes/httpresponse/BUILD.bazel d/go/analysis/passes/httpresponse/BUILD.bazel
--- c/go/analysis/passes/httpresponse/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/httpresponse/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["httpresponse.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/httpresponse",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["httpresponse_test.go"],
diff -urN c/go/analysis/passes/inspect/BUILD.bazel d/go/analysis/passes/inspect/BUILD.bazel
--- c/go/analysis/passes/inspect/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/inspect/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -10,3 +10,14 @@
         "//go/ast/inspector:go_default_library",
     ],
 )
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["inspect.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/inspect",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
diff -urN c/go/analysis/passes/internal/analysisutil/BUILD.bazel d/go/analysis/passes/internal/analysisutil/BUILD.bazel
--- c/go/analysis/passes/internal/analysisutil/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/internal/analysisutil/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,8 +1,15 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = ["util.go"],
     importpath = "golang.org/x/tools/go/analysis/passes/internal/analysisutil",
     visibility = ["//go/analysis/passes:__subpackages__"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["util.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/internal/analysisutil",
+    visibility = ["//go/analysis/passes:__subpackages__"],
 )
diff -urN c/go/analysis/passes/loopclosure/BUILD.bazel d/go/analysis/passes/loopclosure/BUILD.bazel
--- c/go/analysis/passes/loopclosure/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/loopclosure/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["loopclosure.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/loopclosure",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["loopclosure_test.go"],
diff -urN c/go/analysis/passes/lostcancel/BUILD.bazel d/go/analysis/passes/lostcancel/BUILD.bazel
--- c/go/analysis/passes/lostcancel/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
+++ d/go/analysis/passes/lostcancel/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -14,6 +14,20 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["lostcancel.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/lostcancel",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/ctrlflow:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/cfg:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["lostcancel_test.go"],
diff -urN c/go/analysis/passes/nilfunc/BUILD.bazel d/go/analysis/passes/nilfunc/BUILD.bazel
--- c/go/analysis/passes/nilfunc/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/nilfunc/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["nilfunc.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilfunc",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["nilfunc_test.go"],
diff -urN c/go/analysis/passes/nilness/BUILD.bazel d/go/analysis/passes/nilness/BUILD.bazel
--- c/go/analysis/passes/nilness/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/nilness/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["nilness.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilness",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/buildssa:go_tool_library",
+        "//go/ssa:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["nilness_test.go"],
diff -urN c/go/analysis/passes/pkgfact/BUILD.bazel d/go/analysis/passes/pkgfact/BUILD.bazel
--- c/go/analysis/passes/pkgfact/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/pkgfact/BUILD.bazel 2019-10-05 16:16:55.115496503 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -8,6 +8,14 @@
     deps = ["//go/analysis:go_default_library"],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["pkgfact.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/pkgfact",
+    visibility = ["//visibility:public"],
+    deps = ["//go/analysis:go_tool_library"],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["pkgfact_test.go"],
diff -urN c/go/analysis/passes/printf/BUILD.bazel d/go/analysis/passes/printf/BUILD.bazel
--- c/go/analysis/passes/printf/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/printf/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -17,6 +17,23 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "printf.go",
+        "types.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/printf",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["printf_test.go"],
diff -urN c/go/analysis/passes/shadow/BUILD.bazel d/go/analysis/passes/shadow/BUILD.bazel
--- c/go/analysis/passes/shadow/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/shadow/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["shadow.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/shadow",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["shadow_test.go"],
diff -urN c/go/analysis/passes/shift/BUILD.bazel d/go/analysis/passes/shift/BUILD.bazel
--- c/go/analysis/passes/shift/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/shift/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -16,6 +16,22 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "dead.go",
+        "shift.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/shift",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["shift_test.go"],
diff -urN c/go/analysis/passes/sortslice/BUILD.bazel d/go/analysis/passes/sortslice/BUILD.bazel
--- c/go/analysis/passes/sortslice/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/sortslice/BUILD.bazel 2019-10-05 16:51:59.023866935 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["analyzer.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/sortslice",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["analyzer_test.go"],
diff -urN c/go/analysis/passes/stdmethods/BUILD.bazel d/go/analysis/passes/stdmethods/BUILD.bazel
--- c/go/analysis/passes/stdmethods/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/stdmethods/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["stdmethods.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/stdmethods",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["stdmethods_test.go"],
diff -urN c/go/analysis/passes/structtag/BUILD.bazel d/go/analysis/passes/structtag/BUILD.bazel
--- c/go/analysis/passes/structtag/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/structtag/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["structtag.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/structtag",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["structtag_test.go"],
diff -urN c/go/analysis/passes/tests/BUILD.bazel d/go/analysis/passes/tests/BUILD.bazel
--- c/go/analysis/passes/tests/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/tests/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -8,6 +8,14 @@
     deps = ["//go/analysis:go_default_library"],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["tests.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/tests",
+    visibility = ["//visibility:public"],
+    deps = ["//go/analysis:go_tool_library"],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["tests_test.go"],
diff -urN c/go/analysis/passes/unmarshal/BUILD.bazel d/go/analysis/passes/unmarshal/BUILD.bazel
--- c/go/analysis/passes/unmarshal/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/unmarshal/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,9 +13,23 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["unmarshal.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unmarshal",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["unmarshal_test.go"],
     embed = [":go_default_library"],
     deps = ["//go/analysis/analysistest:go_default_library"],
 )
+
diff -urN c/go/analysis/passes/unreachable/BUILD.bazel d/go/analysis/passes/unreachable/BUILD.bazel
--- c/go/analysis/passes/unreachable/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/unreachable/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["unreachable.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unreachable",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["unreachable_test.go"],
diff -urN c/go/analysis/passes/unsafeptr/BUILD.bazel d/go/analysis/passes/unsafeptr/BUILD.bazel
--- c/go/analysis/passes/unsafeptr/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/unsafeptr/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -12,6 +12,18 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["unsafeptr.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unsafeptr",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["unsafeptr_test.go"],
diff -urN c/go/analysis/passes/unusedresult/BUILD.bazel d/go/analysis/passes/unusedresult/BUILD.bazel
--- c/go/analysis/passes/unusedresult/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
+++ d/go/analysis/passes/unusedresult/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -13,6 +13,19 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["unusedresult.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unusedresult",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_tool_library",
+        "//go/analysis/passes/inspect:go_tool_library",
+        "//go/analysis/passes/internal/analysisutil:go_tool_library",
+        "//go/ast/inspector:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = ["unusedresult_test.go"],
diff -urN c/go/ast/astutil/BUILD.bazel d/go/ast/astutil/BUILD.bazel
--- c/go/ast/astutil/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
+++ d/go/ast/astutil/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,10 +1,22 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = [
         "enclosing.go",
         "imports.go",
+        "rewrite.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/go/ast/astutil",
+    visibility = ["//visibility:public"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "enclosing.go",
+        "imports.go",
         "rewrite.go",
         "util.go",
     ],
diff -urN c/go/ast/inspector/BUILD.bazel d/go/ast/inspector/BUILD.bazel
--- c/go/ast/inspector/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
+++ d/go/ast/inspector/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,10 +1,20 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = [
         "inspector.go",
         "typeof.go",
+    ],
+    importpath = "golang.org/x/tools/go/ast/inspector",
+    visibility = ["//visibility:public"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "inspector.go",
+        "typeof.go",
     ],
     importpath = "golang.org/x/tools/go/ast/inspector",
     visibility = ["//visibility:public"],
diff -urN c/go/cfg/BUILD.bazel d/go/cfg/BUILD.bazel
--- c/go/cfg/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
+++ d/go/cfg/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,10 +1,20 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = [
         "builder.go",
         "cfg.go",
+    ],
+    importpath = "golang.org/x/tools/go/cfg",
+    visibility = ["//visibility:public"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "builder.go",
+        "cfg.go",
     ],
     importpath = "golang.org/x/tools/go/cfg",
     visibility = ["//visibility:public"],
diff -urN c/go/gcexportdata/BUILD.bazel d/go/gcexportdata/BUILD.bazel
--- c/go/gcexportdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
+++ d/go/gcexportdata/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -11,6 +11,17 @@
     deps = ["//go/internal/gcimporter:go_default_library"],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "gcexportdata.go",
+        "importer.go",
+    ],
+    importpath = "golang.org/x/tools/go/gcexportdata",
+    visibility = ["//visibility:public"],
+    deps = ["//go/internal/gcimporter:go_tool_library"],
+)
+
 go_test(
     name = "go_default_test",
     srcs = [
diff -urN c/go/internal/gcimporter/BUILD.bazel d/go/internal/gcimporter/BUILD.bazel
--- c/go/internal/gcimporter/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
+++ d/go/internal/gcimporter/BUILD.bazel 2019-10-05 16:36:31.586903381 -0400
@@ -1,10 +1,26 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = [
         "bexport.go",
         "bimport.go",
+        "exportdata.go",
+        "gcimporter.go",
+        "iexport.go",
+        "iimport.go",
+        "newInterface10.go",
+        "newInterface11.go",
+    ],
+    importpath = "golang.org/x/tools/go/internal/gcimporter",
+    visibility = ["//go:__subpackages__"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "bexport.go",
+        "bimport.go",
         "exportdata.go",
         "gcimporter.go",
         "iexport.go",
diff -urN c/go/ssa/BUILD.bazel d/go/ssa/BUILD.bazel
--- c/go/ssa/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
+++ d/go/ssa/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -33,6 +33,39 @@
     ],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "blockopt.go",
+        "builder.go",
+        "const.go",
+        "create.go",
+        "doc.go",
+        "dom.go",
+        "emit.go",
+        "func.go",
+        "identical.go",
+        "identical_17.go",
+        "lift.go",
+        "lvalue.go",
+        "methods.go",
+        "mode.go",
+        "print.go",
+        "sanity.go",
+        "source.go",
+        "ssa.go",
+        "testmain.go",
+        "util.go",
+        "wrappers.go",
+    ],
+    importpath = "golang.org/x/tools/go/ssa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/ast/astutil:go_tool_library",
+        "//go/types/typeutil:go_tool_library",
+    ],
+)
+
 go_test(
     name = "go_default_test",
     srcs = [
diff -urN c/go/types/objectpath/BUILD.bazel d/go/types/objectpath/BUILD.bazel
--- c/go/types/objectpath/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
+++ d/go/types/objectpath/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,10 +1,17 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
     srcs = ["objectpath.go"],
     importpath = "golang.org/x/tools/go/types/objectpath",
     visibility = ["//visibility:public"],
+)
+
+go_tool_library(
+    name = "go_tool_library",
+    srcs = ["objectpath.go"],
+    importpath = "golang.org/x/tools/go/types/objectpath",
+    visibility = ["//visibility:public"],
 )
 
 go_test(
diff -urN c/go/types/typeutil/BUILD.bazel d/go/types/typeutil/BUILD.bazel
--- c/go/types/typeutil/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
+++ d/go/types/typeutil/BUILD.bazel 2019-10-05 16:16:55.119496411 -0400
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", "go_tool_library")
 
 go_library(
     name = "go_default_library",
@@ -14,6 +14,20 @@
     deps = ["//go/ast/astutil:go_default_library"],
 )
 
+go_tool_library(
+    name = "go_tool_library",
+    srcs = [
+        "callee.go",
+        "imports.go",
+        "map.go",
+        "methodsetcache.go",
+        "ui.go",
+    ],
+    importpath = "golang.org/x/tools/go/types/typeutil",
+    visibility = ["//visibility:public"],
+    deps = ["//go/ast/astutil:go_tool_library"],
+)
+
 go_test(
     name = "go_default_test",
     srcs = [
