Moving iree/base/flatcc.h to iree/base/internal/.
diff --git a/iree/base/BUILD b/iree/base/BUILD
index 216c4be..7c1e301 100644
--- a/iree/base/BUILD
+++ b/iree/base/BUILD
@@ -14,9 +14,6 @@
 
 # Common types and utilities used in the IREE codebase.
 
-load("//build_tools/bazel:iree_flatcc.bzl", "iree_flatbuffer_c_library")
-load("//build_tools/bazel:run_binary_test.bzl", "run_binary_test")
-
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
@@ -68,26 +65,6 @@
 #===------------------------------------------------------------------------===#
 
 cc_library(
-    name = "flatcc",
-    hdrs = ["flatcc.h"],
-    deps = [
-        ":flatcc_dummy",
-        "@com_github_dvidelabs_flatcc//:runtime",
-    ],
-)
-
-iree_flatbuffer_c_library(
-    name = "flatcc_dummy",
-    srcs = ["flatcc.fbs"],
-    flatcc_args = [
-        "--reader",
-        "--builder",
-        "--verifier",
-        "--json",
-    ],
-)
-
-cc_library(
     name = "logging",
     srcs = ["logging.cc"],
     hdrs = ["logging.h"],
diff --git a/iree/base/CMakeLists.txt b/iree/base/CMakeLists.txt
index ffec492..9c5f093 100644
--- a/iree/base/CMakeLists.txt
+++ b/iree/base/CMakeLists.txt
@@ -52,30 +52,6 @@
 
 iree_cc_library(
   NAME
-    flatcc
-  HDRS
-    "flatcc.h"
-  DEPS
-    ::flatcc_dummy
-    flatcc::runtime
-  PUBLIC
-)
-
-flatbuffer_c_library(
-  NAME
-    flatcc_dummy
-  SRCS
-    "flatcc.fbs"
-  FLATCC_ARGS
-    "--reader"
-    "--builder"
-    "--verifier"
-    "--json"
-  PUBLIC
-)
-
-iree_cc_library(
-  NAME
     logging
   HDRS
     "logging.h"
diff --git a/iree/base/internal/BUILD b/iree/base/internal/BUILD
index d945356..8008a64 100644
--- a/iree/base/internal/BUILD
+++ b/iree/base/internal/BUILD
@@ -16,6 +16,8 @@
 # These are not part of the IREE API. Though they may be used by external
 # projects their API may change at any time.
 
+load("//build_tools/bazel:iree_flatcc.bzl", "iree_flatbuffer_c_library")
+load("//build_tools/bazel:run_binary_test.bzl", "run_binary_test")
 load("//iree:lit_test.bzl", "iree_lit_test_suite")
 
 package(
@@ -184,6 +186,26 @@
 )
 
 cc_library(
+    name = "flatcc",
+    hdrs = ["flatcc.h"],
+    deps = [
+        ":flatcc_dummy",
+        "@com_github_dvidelabs_flatcc//:runtime",
+    ],
+)
+
+iree_flatbuffer_c_library(
+    name = "flatcc_dummy",
+    srcs = ["flatcc.fbs"],
+    flatcc_args = [
+        "--reader",
+        "--builder",
+        "--verifier",
+        "--json",
+    ],
+)
+
+cc_library(
     name = "main",
     srcs = [
         "main_posix.cc",
diff --git a/iree/base/internal/CMakeLists.txt b/iree/base/internal/CMakeLists.txt
index 944a451..13865c0 100644
--- a/iree/base/internal/CMakeLists.txt
+++ b/iree/base/internal/CMakeLists.txt
@@ -179,6 +179,30 @@
 
 iree_cc_library(
   NAME
+    flatcc
+  HDRS
+    "flatcc.h"
+  DEPS
+    ::flatcc_dummy
+    flatcc::runtime
+  PUBLIC
+)
+
+flatbuffer_c_library(
+  NAME
+    flatcc_dummy
+  SRCS
+    "flatcc.fbs"
+  FLATCC_ARGS
+    "--reader"
+    "--builder"
+    "--verifier"
+    "--json"
+  PUBLIC
+)
+
+iree_cc_library(
+  NAME
     main
   HDRS
     "main.h"
diff --git a/iree/base/flatcc.fbs b/iree/base/internal/flatcc.fbs
similarity index 93%
rename from iree/base/flatcc.fbs
rename to iree/base/internal/flatcc.fbs
index 590afb4..b7c2b18 100644
--- a/iree/base/flatcc.fbs
+++ b/iree/base/internal/flatcc.fbs
@@ -18,7 +18,7 @@
 // when pulled in via generated headers. So here we give ourselves something to
 // include that's always available and cheap.
 //
-// Instead of directly including this file use iree/base/flatcc.h.
+// Instead of directly including this file use iree/base/internal/flatcc.h.
 //
 // Normally including any generated file will include the appropriate headers in
 // the required order (as they are non-hermetic), but that requires that we have
diff --git a/iree/base/flatcc.h b/iree/base/internal/flatcc.h
similarity index 80%
rename from iree/base/flatcc.h
rename to iree/base/internal/flatcc.h
index 0940517..1192e32 100644
--- a/iree/base/flatcc.h
+++ b/iree/base/internal/flatcc.h
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef IREE_BASE_FLATCC_H_
-#define IREE_BASE_FLATCC_H_
+#ifndef IREE_BASE_INTERNAL_FLATCC_H_
+#define IREE_BASE_INTERNAL_FLATCC_H_
 
 //===----------------------------------------------------------------------===//
 // flatcc include order fixes
@@ -30,21 +30,21 @@
 // clang-format off
 
 #include "flatcc/reflection/flatbuffers_common_reader.h"
-#include "iree/base/flatcc_reader.h"
+#include "iree/base/internal/flatcc_reader.h"
 
 #include "flatcc/flatcc_verifier.h"
-#include "iree/base/flatcc_verifier.h"
+#include "iree/base/internal/flatcc_verifier.h"
 
 #include "flatcc/flatcc_builder.h"
 #include "flatcc/reflection/flatbuffers_common_builder.h"
-#include "iree/base/flatcc_builder.h"
+#include "iree/base/internal/flatcc_builder.h"
 
 #include "flatcc/flatcc_json_parser.h"
-#include "iree/base/flatcc_json_parser.h"
+#include "iree/base/internal/flatcc_json_parser.h"
 
 #include "flatcc/flatcc_json_printer.h"
-#include "iree/base/flatcc_json_printer.h"
+#include "iree/base/internal/flatcc_json_printer.h"
 
 // clang-format on
 
-#endif  // IREE_BASE_FLATCC_H_
+#endif  // IREE_BASE_INTERNAL_FLATCC_H_
diff --git a/iree/compiler/Dialect/HAL/Target/CUDA/BUILD b/iree/compiler/Dialect/HAL/Target/CUDA/BUILD
index 862989b..c697b27 100644
--- a/iree/compiler/Dialect/HAL/Target/CUDA/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/CUDA/BUILD
@@ -37,7 +37,7 @@
         "CUDATarget.h",
     ],
     deps = [
-        "//iree/base:flatcc",
+        "//iree/base/internal:flatcc",
         "//iree/compiler/Conversion/LinalgToNVVM",
         "//iree/compiler/Dialect/HAL/Target",
         "//iree/compiler/Utils",
diff --git a/iree/compiler/Dialect/HAL/Target/CUDA/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/CUDA/CMakeLists.txt
index 00e2225..06b60b3 100644
--- a/iree/compiler/Dialect/HAL/Target/CUDA/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/CUDA/CMakeLists.txt
@@ -33,7 +33,7 @@
     MLIRPass
     MLIRSupport
     MLIRTargetLLVMIRExport
-    iree::base::flatcc
+    iree::base::internal::flatcc
     iree::compiler::Conversion::LinalgToNVVM
     iree::compiler::Dialect::HAL::Target
     iree::compiler::Utils
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/BUILD b/iree/compiler/Dialect/HAL/Target/LLVM/BUILD
index 376b51a..51541a9 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/BUILD
@@ -42,7 +42,7 @@
         ":LLVMIRPasses",
         ":LLVMTargetOptions",
         ":LinkerTool",
-        "//iree/base:flatcc",
+        "//iree/base/internal:flatcc",
         "//iree/compiler/Conversion/CodegenUtils",
         "//iree/compiler/Conversion/Common",
         "//iree/compiler/Conversion/LinalgToLLVM",
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
index 6a00714..ce22cdb 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
@@ -42,7 +42,7 @@
     MLIRLLVMIR
     MLIRLLVMToLLVMIRTranslation
     MLIRTargetLLVMIRExport
-    iree::base::flatcc
+    iree::base::internal::flatcc
     iree::compiler::Conversion::CodegenUtils
     iree::compiler::Conversion::Common
     iree::compiler::Conversion::LinalgToLLVM
diff --git a/iree/compiler/Dialect/HAL/Target/VMLA/BUILD b/iree/compiler/Dialect/HAL/Target/VMLA/BUILD
index c3fde9d..5081805 100644
--- a/iree/compiler/Dialect/HAL/Target/VMLA/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/VMLA/BUILD
@@ -37,7 +37,7 @@
         "VMLATarget.h",
     ],
     deps = [
-        "//iree/base:flatcc",
+        "//iree/base/internal:flatcc",
         "//iree/compiler/Dialect/Flow/IR",
         "//iree/compiler/Dialect/HAL/Target",
         "//iree/compiler/Dialect/VM/Conversion",
diff --git a/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt
index 6ddfc58..d24651c 100644
--- a/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt
@@ -26,7 +26,7 @@
     MLIRIR
     MLIRPass
     MLIRSupport
-    iree::base::flatcc
+    iree::base::internal::flatcc
     iree::compiler::Dialect::Flow::IR
     iree::compiler::Dialect::HAL::Target
     iree::compiler::Dialect::VM::Conversion
diff --git a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD
index 92792eb..bdb193e 100644
--- a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD
@@ -37,7 +37,7 @@
         "VulkanSPIRVTarget.h",
     ],
     deps = [
-        "//iree/base:flatcc",
+        "//iree/base/internal:flatcc",
         "//iree/compiler/Conversion/Common",
         "//iree/compiler/Conversion/LinalgToSPIRV",
         "//iree/compiler/Conversion/LinalgToSPIRV:CodeGenOptionUtils",
diff --git a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt
index 8bd189f..a4892fa 100644
--- a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt
@@ -32,7 +32,7 @@
     MLIRSPIRVSerialization
     MLIRSupport
     MLIRVector
-    iree::base::flatcc
+    iree::base::internal::flatcc
     iree::compiler::Conversion::Common
     iree::compiler::Conversion::LinalgToSPIRV
     iree::compiler::Conversion::LinalgToSPIRV::CodeGenOptionUtils
diff --git a/iree/compiler/Utils/BUILD b/iree/compiler/Utils/BUILD
index 1319046..27917d1 100644
--- a/iree/compiler/Utils/BUILD
+++ b/iree/compiler/Utils/BUILD
@@ -33,8 +33,8 @@
         "TracingUtils.h",
     ],
     deps = [
-        "//iree/base:flatcc",
         "//iree/base:tracing",
+        "//iree/base/internal:flatcc",
         "//iree/compiler/Dialect/IREE/IR",
         "@llvm-project//llvm:Support",
         "@llvm-project//mlir:IR",
diff --git a/iree/compiler/Utils/CMakeLists.txt b/iree/compiler/Utils/CMakeLists.txt
index ee86c83..e9036b7 100644
--- a/iree/compiler/Utils/CMakeLists.txt
+++ b/iree/compiler/Utils/CMakeLists.txt
@@ -29,7 +29,7 @@
     MLIRSupport
     MLIRTransformUtils
     MLIRTransforms
-    iree::base::flatcc
+    iree::base::internal::flatcc
     iree::base::tracing
     iree::compiler::Dialect::IREE::IR
   PUBLIC
diff --git a/iree/compiler/Utils/FlatbufferUtils.h b/iree/compiler/Utils/FlatbufferUtils.h
index 783bffb..dae406d 100644
--- a/iree/compiler/Utils/FlatbufferUtils.h
+++ b/iree/compiler/Utils/FlatbufferUtils.h
@@ -25,7 +25,7 @@
 #include "mlir/Support/LogicalResult.h"
 
 // NOTE: order matters here as some of the LLVM includes conflict.
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 
 namespace mlir {
 namespace iree_compiler {
diff --git a/iree/hal/cuda/BUILD b/iree/hal/cuda/BUILD
index 68b6389..c52b0a2 100644
--- a/iree/hal/cuda/BUILD
+++ b/iree/hal/cuda/BUILD
@@ -65,12 +65,12 @@
         ":dynamic_symbols",
         "//iree/base",
         "//iree/base:core_headers",
-        "//iree/base:flatcc",
         "//iree/base:logging",
         "//iree/base:status",
-        "//iree/base/internal:synchronization",
         "//iree/base:tracing",
         "//iree/base/internal",
+        "//iree/base/internal:flatcc",
+        "//iree/base/internal:synchronization",
         "//iree/hal",
         "//iree/schemas:cuda_executable_def_c_fbs",
     ],
diff --git a/iree/hal/cuda/CMakeLists.txt b/iree/hal/cuda/CMakeLists.txt
index 33616db..a056aa5 100644
--- a/iree/hal/cuda/CMakeLists.txt
+++ b/iree/hal/cuda/CMakeLists.txt
@@ -49,8 +49,8 @@
     ::dynamic_symbols
     iree::base
     iree::base::core_headers
-    iree::base::flatcc
     iree::base::internal
+    iree::base::internal::flatcc
     iree::base::internal::synchronization
     iree::base::logging
     iree::base::status
diff --git a/iree/hal/cuda/native_executable.c b/iree/hal/cuda/native_executable.c
index 063bca3..7ce7a13 100644
--- a/iree/hal/cuda/native_executable.c
+++ b/iree/hal/cuda/native_executable.c
@@ -18,7 +18,7 @@
 #include "iree/hal/cuda/status_util.h"
 
 // flatcc schemas:
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 #include "iree/schemas/cuda_executable_def_reader.h"
 #include "iree/schemas/cuda_executable_def_verifier.h"
 
diff --git a/iree/hal/local/loaders/BUILD b/iree/hal/local/loaders/BUILD
index f7df668..2fd8ca1 100644
--- a/iree/hal/local/loaders/BUILD
+++ b/iree/hal/local/loaders/BUILD
@@ -50,9 +50,9 @@
     deps = [
         "//iree/base",
         "//iree/base:core_headers",
-        "//iree/base:flatcc",
         "//iree/base:tracing",
         "//iree/base/internal:dynamic_library",
+        "//iree/base/internal:flatcc",
         "//iree/hal",
         "//iree/hal/local",
         "//iree/schemas:dylib_executable_def_c_fbs",
@@ -83,9 +83,9 @@
     ],
     deps = [
         "//iree/base",
-        "//iree/base:flatcc",
         "//iree/base:tracing",
         "//iree/base/internal:file_io",
+        "//iree/base/internal:flatcc",
         "//iree/hal",
         "//iree/hal/local",
     ],
@@ -107,8 +107,8 @@
     ],
     deps = [
         "//iree/base",
-        "//iree/base:flatcc",
         "//iree/base:tracing",
+        "//iree/base/internal:flatcc",
         "//iree/hal",
         "//iree/hal/local",
         "//iree/modules/vmla:op_module",
diff --git a/iree/hal/local/loaders/CMakeLists.txt b/iree/hal/local/loaders/CMakeLists.txt
index 862ad0b..a62d987 100644
--- a/iree/hal/local/loaders/CMakeLists.txt
+++ b/iree/hal/local/loaders/CMakeLists.txt
@@ -39,8 +39,8 @@
   DEPS
     iree::base
     iree::base::core_headers
-    iree::base::flatcc
     iree::base::internal::dynamic_library
+    iree::base::internal::flatcc
     iree::base::tracing
     iree::hal
     iree::hal::local
@@ -76,8 +76,8 @@
     "system_library_loader.c"
   DEPS
     iree::base
-    iree::base::flatcc
     iree::base::internal::file_io
+    iree::base::internal::flatcc
     iree::base::tracing
     iree::hal
     iree::hal::local
@@ -97,7 +97,7 @@
     "vmla_module_loader.cc"
   DEPS
     iree::base
-    iree::base::flatcc
+    iree::base::internal::flatcc
     iree::base::tracing
     iree::hal
     iree::hal::local
diff --git a/iree/hal/local/loaders/legacy_library_loader.c b/iree/hal/local/loaders/legacy_library_loader.c
index aca8993..a3dd781 100644
--- a/iree/hal/local/loaders/legacy_library_loader.c
+++ b/iree/hal/local/loaders/legacy_library_loader.c
@@ -20,7 +20,7 @@
 #include "iree/hal/local/local_executable.h"
 
 // flatcc schemas:
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 #include "iree/schemas/dylib_executable_def_reader.h"
 #include "iree/schemas/dylib_executable_def_verifier.h"
 
diff --git a/iree/hal/local/loaders/system_library_loader.c b/iree/hal/local/loaders/system_library_loader.c
index f57d0b7..148b529 100644
--- a/iree/hal/local/loaders/system_library_loader.c
+++ b/iree/hal/local/loaders/system_library_loader.c
@@ -18,7 +18,7 @@
 #include "iree/hal/local/local_executable.h"
 
 // flatcc schemas:
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 
 //===----------------------------------------------------------------------===//
 // iree_hal_system_executable_t
diff --git a/iree/hal/local/loaders/vmla_module_loader.cc b/iree/hal/local/loaders/vmla_module_loader.cc
index f0b2205..947a9dd 100644
--- a/iree/hal/local/loaders/vmla_module_loader.cc
+++ b/iree/hal/local/loaders/vmla_module_loader.cc
@@ -21,7 +21,7 @@
 #include "iree/vm/bytecode_module.h"
 
 // flatcc schemas:
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 #include "iree/schemas/vmla_executable_def_reader.h"
 #include "iree/schemas/vmla_executable_def_verifier.h"
 
diff --git a/iree/hal/vulkan/BUILD b/iree/hal/vulkan/BUILD
index 313d3ca..e35e4d8 100644
--- a/iree/hal/vulkan/BUILD
+++ b/iree/hal/vulkan/BUILD
@@ -93,12 +93,12 @@
         ":dynamic_symbols",
         "//iree/base",
         "//iree/base:core_headers",
-        "//iree/base:flatcc",
         "//iree/base:logging",
         "//iree/base:status",
-        "//iree/base/internal:synchronization",
         "//iree/base:tracing",
         "//iree/base/internal",
+        "//iree/base/internal:flatcc",
+        "//iree/base/internal:synchronization",
         "//iree/hal",
         "//iree/hal/vulkan/util:arena",
         "//iree/hal/vulkan/util:intrusive_list",
diff --git a/iree/hal/vulkan/CMakeLists.txt b/iree/hal/vulkan/CMakeLists.txt
index d1cc349..c6ece6e 100644
--- a/iree/hal/vulkan/CMakeLists.txt
+++ b/iree/hal/vulkan/CMakeLists.txt
@@ -77,8 +77,8 @@
     absl::strings
     iree::base
     iree::base::core_headers
-    iree::base::flatcc
     iree::base::internal
+    iree::base::internal::flatcc
     iree::base::internal::synchronization
     iree::base::logging
     iree::base::status
diff --git a/iree/hal/vulkan/native_executable.cc b/iree/hal/vulkan/native_executable.cc
index 0b93ad3..5886597 100644
--- a/iree/hal/vulkan/native_executable.cc
+++ b/iree/hal/vulkan/native_executable.cc
@@ -20,7 +20,7 @@
 #include "iree/hal/vulkan/status_util.h"
 
 // flatcc schemas:
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 #include "iree/schemas/spirv_executable_def_reader.h"
 #include "iree/schemas/spirv_executable_def_verifier.h"
 
diff --git a/iree/vm/BUILD b/iree/vm/BUILD
index eebd2ed..b26fe70 100644
--- a/iree/vm/BUILD
+++ b/iree/vm/BUILD
@@ -190,9 +190,9 @@
         ":vm",
         "//iree/base",
         "//iree/base:core_headers",
-        "//iree/base:flatcc",
         "//iree/base:tracing",
         "//iree/base/internal",
+        "//iree/base/internal:flatcc",
         "//iree/schemas:bytecode_module_def_c_fbs",
     ],
 )
diff --git a/iree/vm/CMakeLists.txt b/iree/vm/CMakeLists.txt
index 27a67ae..8a095b3 100644
--- a/iree/vm/CMakeLists.txt
+++ b/iree/vm/CMakeLists.txt
@@ -168,8 +168,8 @@
     ::vm
     iree::base
     iree::base::core_headers
-    iree::base::flatcc
     iree::base::internal
+    iree::base::internal::flatcc
     iree::base::tracing
     iree::schemas::bytecode_module_def_c_fbs
   PUBLIC
diff --git a/iree/vm/bytecode_module_impl.h b/iree/vm/bytecode_module_impl.h
index ef78209..1b1fd6c 100644
--- a/iree/vm/bytecode_module_impl.h
+++ b/iree/vm/bytecode_module_impl.h
@@ -27,7 +27,7 @@
 #include "iree/vm/api.h"
 
 // NOTE: include order matters:
-#include "iree/base/flatcc.h"
+#include "iree/base/internal/flatcc.h"
 #include "iree/schemas/bytecode_module_def_reader.h"
 #include "iree/schemas/bytecode_module_def_verifier.h"