tint/ast: Generate ast::BuiltinValue from intrinsics.def

Emit unit tests for parsing and printing.
Emit benchmarks for parsing.
Uses intrinsics.def as a single-source-of-truth.
The generators provide a way to optimize the enum parsers.

Change-Id: Ic95177b8b60a51f0bcd6dab4138984f54f30ed6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97201
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index c4b2313..072d38a 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -23,6 +23,23 @@
 // Enumerators                                                                //
 ////////////////////////////////////////////////////////////////////////////////
 
+// https://gpuweb.github.io/gpuweb/wgsl/#builtin-values
+enum builtin_value {
+  position
+  vertex_index
+  instance_index
+  front_facing
+  frag_depth
+  local_invocation_id
+  local_invocation_index
+  global_invocation_id
+  workgroup_id
+  num_workgroups
+  sample_index
+  sample_mask
+  @internal point_size
+}
+
 // https://gpuweb.github.io/gpuweb/wgsl/#extension
 enum extension {
   // WGSL Extension "f16"