summaryrefslogtreecommitdiff
path: root/abi/map_select_swiss.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-19 04:40:49 -0500
committerJeff Carr <[email protected]>2025-03-19 04:40:49 -0500
commit17119d9298e132aa309f1cc95e439f29f61214b0 (patch)
tree578abd95ba2cfe0cdcec3f6e51d609ccb9e2f36b /abi/map_select_swiss.go
day1v0.0.1
Diffstat (limited to 'abi/map_select_swiss.go')
-rw-r--r--abi/map_select_swiss.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/abi/map_select_swiss.go b/abi/map_select_swiss.go
new file mode 100644
index 0000000..88a0bb2
--- /dev/null
+++ b/abi/map_select_swiss.go
@@ -0,0 +1,22 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build goexperiment.swissmap
+
+package abi
+
+// Select the map type that this binary is built using. This is for common
+// lookup methods like Type.Key to know which type to use.
+//
+// Note that mapType *must not be used by any functions called in the
+// compiler to build a target program* because the compiler must use the map
+// type determined by run-time GOEXPERIMENT, not the build tags used to build
+// the compiler.
+//
+// TODO(prattmic): This package is rather confusing because it has many
+// functions that can't be used by the compiler (e.g., Type.Uncommon depends on
+// the layout of type + uncommon objects in the binary. It would be incorrect
+// for an ad-hoc local Type object). It may be best to move code that isn't
+// usable by the compiler out of the package.
+type mapType = SwissMapType