ast: Make all non-semantic fields const

Annotate those that are set by the TypeDeterminer as "Semantic Info"

Bug: tint:396
Bug: tint:390
Change-Id: I0705c64e8e23d97a6430230728f82e64dd92efb7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35165
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/ast/access_decoration.h b/src/ast/access_decoration.h
index dcf2d95..e58c13a 100644
--- a/src/ast/access_decoration.h
+++ b/src/ast/access_decoration.h
@@ -49,7 +49,7 @@
   AccessDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  AccessControl value_ = ast::AccessControl::kReadWrite;
+  AccessControl const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/array_accessor_expression.h b/src/ast/array_accessor_expression.h
index d35c20a..ebcf9c6 100644
--- a/src/ast/array_accessor_expression.h
+++ b/src/ast/array_accessor_expression.h
@@ -64,8 +64,8 @@
  private:
   ArrayAccessorExpression(const ArrayAccessorExpression&) = delete;
 
-  Expression* array_ = nullptr;
-  Expression* idx_expr_ = nullptr;
+  Expression* const array_;
+  Expression* const idx_expr_;
 };
 
 }  // namespace ast
diff --git a/src/ast/assignment_statement.h b/src/ast/assignment_statement.h
index a91b000..01b5ac5 100644
--- a/src/ast/assignment_statement.h
+++ b/src/ast/assignment_statement.h
@@ -61,8 +61,8 @@
  private:
   AssignmentStatement(const AssignmentStatement&) = delete;
 
-  Expression* lhs_ = nullptr;
-  Expression* rhs_ = nullptr;
+  Expression* const lhs_;
+  Expression* const rhs_;
 };
 
 }  // namespace ast
diff --git a/src/ast/binary_expression.h b/src/ast/binary_expression.h
index 8283a5d..9bce548 100644
--- a/src/ast/binary_expression.h
+++ b/src/ast/binary_expression.h
@@ -127,9 +127,9 @@
  private:
   BinaryExpression(const BinaryExpression&) = delete;
 
-  BinaryOp op_ = BinaryOp::kNone;
-  Expression* lhs_ = nullptr;
-  Expression* rhs_ = nullptr;
+  BinaryOp const op_;
+  Expression* const lhs_;
+  Expression* const rhs_;
 };
 
 inline std::ostream& operator<<(std::ostream& out, BinaryOp op) {
diff --git a/src/ast/binding_decoration.h b/src/ast/binding_decoration.h
index ae4cc45..e4d73e3 100644
--- a/src/ast/binding_decoration.h
+++ b/src/ast/binding_decoration.h
@@ -49,7 +49,7 @@
   BindingDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t value_;
+  uint32_t const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/bitcast_expression.h b/src/ast/bitcast_expression.h
index 5ef92b3..ccee67e 100644
--- a/src/ast/bitcast_expression.h
+++ b/src/ast/bitcast_expression.h
@@ -61,8 +61,8 @@
  private:
   BitcastExpression(const BitcastExpression&) = delete;
 
-  type::Type* type_ = nullptr;
-  Expression* expr_ = nullptr;
+  type::Type* const type_;
+  Expression* const expr_;
 };
 
 }  // namespace ast
diff --git a/src/ast/block_statement.h b/src/ast/block_statement.h
index d485bdf..08e4b06 100644
--- a/src/ast/block_statement.h
+++ b/src/ast/block_statement.h
@@ -83,7 +83,7 @@
  private:
   BlockStatement(const BlockStatement&) = delete;
 
-  StatementList statements_;
+  StatementList const statements_;
 };
 
 }  // namespace ast
diff --git a/src/ast/bool_literal.h b/src/ast/bool_literal.h
index 1b984f5..2896913 100644
--- a/src/ast/bool_literal.h
+++ b/src/ast/bool_literal.h
@@ -52,7 +52,7 @@
   BoolLiteral* Clone(CloneContext* ctx) const override;
 
  private:
-  bool value_;
+  bool const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/builtin_decoration.h b/src/ast/builtin_decoration.h
index 5a1419b..7c437d5 100644
--- a/src/ast/builtin_decoration.h
+++ b/src/ast/builtin_decoration.h
@@ -48,7 +48,7 @@
   BuiltinDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  Builtin builtin_ = Builtin::kNone;
+  Builtin const builtin_;
 };
 
 }  // namespace ast
diff --git a/src/ast/call_expression.h b/src/ast/call_expression.h
index c5547e9..d52ab4e 100644
--- a/src/ast/call_expression.h
+++ b/src/ast/call_expression.h
@@ -60,8 +60,8 @@
  private:
   CallExpression(const CallExpression&) = delete;
 
-  Expression* func_ = nullptr;
-  ExpressionList params_;
+  Expression* const func_;
+  ExpressionList const params_;
 };
 
 }  // namespace ast
diff --git a/src/ast/call_statement.h b/src/ast/call_statement.h
index 59f7bed..c8aa837 100644
--- a/src/ast/call_statement.h
+++ b/src/ast/call_statement.h
@@ -57,7 +57,7 @@
  private:
   CallStatement(const CallStatement&) = delete;
 
-  CallExpression* call_ = nullptr;
+  CallExpression* const call_;
 };
 
 }  // namespace ast
diff --git a/src/ast/case_statement.h b/src/ast/case_statement.h
index c9c424e..b793342 100644
--- a/src/ast/case_statement.h
+++ b/src/ast/case_statement.h
@@ -73,8 +73,8 @@
  private:
   CaseStatement(const CaseStatement&) = delete;
 
-  CaseSelectorList selectors_;
-  BlockStatement* body_ = nullptr;
+  CaseSelectorList const selectors_;
+  BlockStatement* const body_;
 };
 
 /// A list of case statements
diff --git a/src/ast/constant_id_decoration.h b/src/ast/constant_id_decoration.h
index bb990ae..0d2b407 100644
--- a/src/ast/constant_id_decoration.h
+++ b/src/ast/constant_id_decoration.h
@@ -48,7 +48,7 @@
   ConstantIdDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t value_ = 0;
+  uint32_t const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/else_statement.h b/src/ast/else_statement.h
index 6466720..7b08fa5 100644
--- a/src/ast/else_statement.h
+++ b/src/ast/else_statement.h
@@ -69,8 +69,8 @@
  private:
   ElseStatement(const ElseStatement&) = delete;
 
-  Expression* condition_ = nullptr;
-  BlockStatement* body_ = nullptr;
+  Expression* const condition_;
+  BlockStatement* const body_;
 };
 
 /// A list of else statements
diff --git a/src/ast/expression.h b/src/ast/expression.h
index 5809d2e..12e038c 100644
--- a/src/ast/expression.h
+++ b/src/ast/expression.h
@@ -52,7 +52,7 @@
  private:
   Expression(const Expression&) = delete;
 
-  type::Type* result_type_ = nullptr;
+  type::Type* result_type_ = nullptr;  // Semantic info
 };
 
 /// A list of expressions
diff --git a/src/ast/float_literal.h b/src/ast/float_literal.h
index ad33124..bbf58f8 100644
--- a/src/ast/float_literal.h
+++ b/src/ast/float_literal.h
@@ -50,7 +50,7 @@
   FloatLiteral* Clone(CloneContext* ctx) const override;
 
  private:
-  float value_;
+  float const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/function.h b/src/ast/function.h
index 14b6789..4f22016 100644
--- a/src/ast/function.h
+++ b/src/ast/function.h
@@ -202,15 +202,16 @@
   const std::vector<std::pair<Variable*, Function::BindingInfo>>
   ReferencedSampledTextureVariablesImpl(bool multisampled) const;
 
-  Symbol symbol_;
-  std::string name_;
-  VariableList params_;
-  type::Type* return_type_ = nullptr;
-  BlockStatement* body_ = nullptr;
-  std::vector<Variable*> referenced_module_vars_;
-  std::vector<Variable*> local_referenced_module_vars_;
-  std::vector<Symbol> ancestor_entry_points_;
-  FunctionDecorationList decorations_;
+  Symbol const symbol_;
+  std::string const name_;
+  VariableList const params_;
+  type::Type* const return_type_;
+  BlockStatement* const body_;
+
+  std::vector<Variable*> referenced_module_vars_;        // Semantic info
+  std::vector<Variable*> local_referenced_module_vars_;  // Semantic info
+  std::vector<Symbol> ancestor_entry_points_;            // Semantic info
+  FunctionDecorationList decorations_;                   // Semantic info
 };
 
 /// A list of functions
diff --git a/src/ast/identifier_expression.h b/src/ast/identifier_expression.h
index 40750da..b30c4cc 100644
--- a/src/ast/identifier_expression.h
+++ b/src/ast/identifier_expression.h
@@ -83,10 +83,11 @@
  private:
   IdentifierExpression(const IdentifierExpression&) = delete;
 
-  Intrinsic intrinsic_ = Intrinsic::kNone;
-  std::unique_ptr<intrinsic::Signature> intrinsic_sig_;
-  Symbol sym_;
-  std::string name_;
+  Symbol const sym_;
+  std::string const name_;
+
+  Intrinsic intrinsic_ = Intrinsic::kNone;               // Semantic info
+  std::unique_ptr<intrinsic::Signature> intrinsic_sig_;  // Semantic info
 };
 
 }  // namespace ast
diff --git a/src/ast/if_statement.h b/src/ast/if_statement.h
index f489c4a..11515ab 100644
--- a/src/ast/if_statement.h
+++ b/src/ast/if_statement.h
@@ -51,8 +51,6 @@
 
   /// @returns the else statements
   const ElseStatementList& else_statements() const { return else_statements_; }
-  /// @returns the else statements
-  ElseStatementList& else_statements() { return else_statements_; }
 
   /// @returns true if there are else statements
   bool has_else_statements() const { return !else_statements_.empty(); }
@@ -76,9 +74,9 @@
  private:
   IfStatement(const IfStatement&) = delete;
 
-  Expression* condition_ = nullptr;
-  BlockStatement* body_ = nullptr;
-  ElseStatementList else_statements_;
+  Expression* const condition_;
+  BlockStatement* const body_;
+  ElseStatementList const else_statements_;
 };
 
 }  // namespace ast
diff --git a/src/ast/literal.h b/src/ast/literal.h
index dea8a63..f5127ef 100644
--- a/src/ast/literal.h
+++ b/src/ast/literal.h
@@ -52,7 +52,7 @@
   explicit Literal(const Source& source, type::Type* type);
 
  private:
-  type::Type* type_ = nullptr;
+  type::Type* const type_;
 };
 
 }  // namespace ast
diff --git a/src/ast/location_decoration.h b/src/ast/location_decoration.h
index f6583ea..fc24963 100644
--- a/src/ast/location_decoration.h
+++ b/src/ast/location_decoration.h
@@ -49,7 +49,7 @@
   LocationDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t value_;
+  uint32_t const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/loop_statement.h b/src/ast/loop_statement.h
index 6eb4b39..e80eb94 100644
--- a/src/ast/loop_statement.h
+++ b/src/ast/loop_statement.h
@@ -71,8 +71,8 @@
  private:
   LoopStatement(const LoopStatement&) = delete;
 
-  BlockStatement* body_ = nullptr;
-  BlockStatement* continuing_ = nullptr;
+  BlockStatement* const body_;
+  BlockStatement* const continuing_;
 };
 
 }  // namespace ast
diff --git a/src/ast/member_accessor_expression.h b/src/ast/member_accessor_expression.h
index 982fc66..d9aef79 100644
--- a/src/ast/member_accessor_expression.h
+++ b/src/ast/member_accessor_expression.h
@@ -64,8 +64,8 @@
  private:
   MemberAccessorExpression(const MemberAccessorExpression&) = delete;
 
-  Expression* struct_ = nullptr;
-  IdentifierExpression* member_ = nullptr;
+  Expression* const struct_;
+  IdentifierExpression* const member_;
 };
 
 }  // namespace ast
diff --git a/src/ast/node.h b/src/ast/node.h
index b4f6120..b3d5cde 100644
--- a/src/ast/node.h
+++ b/src/ast/node.h
@@ -75,7 +75,7 @@
  private:
   Node(const Node&) = delete;
 
-  Source source_;
+  Source const source_;
 };
 
 }  // namespace ast
diff --git a/src/ast/return_statement.cc b/src/ast/return_statement.cc
index 3583138..93f9b4f 100644
--- a/src/ast/return_statement.cc
+++ b/src/ast/return_statement.cc
@@ -22,7 +22,8 @@
 namespace tint {
 namespace ast {
 
-ReturnStatement::ReturnStatement(const Source& source) : Base(source) {}
+ReturnStatement::ReturnStatement(const Source& source)
+    : Base(source), value_(nullptr) {}
 
 ReturnStatement::ReturnStatement(const Source& source, Expression* value)
     : Base(source), value_(value) {}
diff --git a/src/ast/return_statement.h b/src/ast/return_statement.h
index 8b00e2a..5a56ba6 100644
--- a/src/ast/return_statement.h
+++ b/src/ast/return_statement.h
@@ -62,7 +62,7 @@
  private:
   ReturnStatement(const ReturnStatement&) = delete;
 
-  Expression* value_ = nullptr;
+  Expression* const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/scalar_constructor_expression.h b/src/ast/scalar_constructor_expression.h
index ee7e835..5c96ef9 100644
--- a/src/ast/scalar_constructor_expression.h
+++ b/src/ast/scalar_constructor_expression.h
@@ -58,7 +58,7 @@
  private:
   ScalarConstructorExpression(const ScalarConstructorExpression&) = delete;
 
-  Literal* literal_ = nullptr;
+  Literal* const literal_;
 };
 
 }  // namespace ast
diff --git a/src/ast/set_decoration.h b/src/ast/set_decoration.h
index 1ea07b2..ec97a32 100644
--- a/src/ast/set_decoration.h
+++ b/src/ast/set_decoration.h
@@ -48,7 +48,7 @@
   SetDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t value_;
+  uint32_t const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/sint_literal.h b/src/ast/sint_literal.h
index cf4ac57..2df717d 100644
--- a/src/ast/sint_literal.h
+++ b/src/ast/sint_literal.h
@@ -50,7 +50,7 @@
   SintLiteral* Clone(CloneContext* ctx) const override;
 
  private:
-  int32_t value_;
+  int32_t const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/stage_decoration.h b/src/ast/stage_decoration.h
index a8ee49f..4208c7d 100644
--- a/src/ast/stage_decoration.h
+++ b/src/ast/stage_decoration.h
@@ -47,7 +47,7 @@
   StageDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  PipelineStage stage_ = PipelineStage::kNone;
+  PipelineStage const stage_;
 };
 
 }  // namespace ast
diff --git a/src/ast/stride_decoration.h b/src/ast/stride_decoration.h
index dc89978..ad99778 100644
--- a/src/ast/stride_decoration.h
+++ b/src/ast/stride_decoration.h
@@ -48,7 +48,7 @@
   StrideDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t stride_;
+  uint32_t const stride_;
 };
 
 }  // namespace ast
diff --git a/src/ast/struct.h b/src/ast/struct.h
index 36e78ba..260bfb6 100644
--- a/src/ast/struct.h
+++ b/src/ast/struct.h
@@ -74,8 +74,8 @@
  private:
   Struct(const Struct&) = delete;
 
-  StructMemberList members_;
-  StructDecorationList decorations_;
+  StructMemberList const members_;
+  StructDecorationList const decorations_;
 };
 
 }  // namespace ast
diff --git a/src/ast/struct_member.h b/src/ast/struct_member.h
index 73470b6..fb72fb1 100644
--- a/src/ast/struct_member.h
+++ b/src/ast/struct_member.h
@@ -77,9 +77,9 @@
  private:
   StructMember(const StructMember&) = delete;
 
-  std::string name_;
-  type::Type* type_ = nullptr;
-  StructMemberDecorationList decorations_;
+  std::string const name_;
+  type::Type* const type_;
+  StructMemberDecorationList const decorations_;
 };
 
 /// A list of struct members
diff --git a/src/ast/struct_member_offset_decoration.h b/src/ast/struct_member_offset_decoration.h
index 001d777..445483b 100644
--- a/src/ast/struct_member_offset_decoration.h
+++ b/src/ast/struct_member_offset_decoration.h
@@ -49,7 +49,7 @@
   StructMemberOffsetDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t offset_;
+  uint32_t const offset_;
 };
 
 }  // namespace ast
diff --git a/src/ast/switch_statement.h b/src/ast/switch_statement.h
index 917d6aa..b964724 100644
--- a/src/ast/switch_statement.h
+++ b/src/ast/switch_statement.h
@@ -46,8 +46,6 @@
   bool IsDefault() const { return condition_ == nullptr; }
 
   /// @returns the Switch body
-  CaseStatementList& body() { return body_; }
-  /// @returns the Switch body
   const CaseStatementList& body() const { return body_; }
 
   /// Clones this node and all transitive child nodes using the `CloneContext`
@@ -69,8 +67,8 @@
  private:
   SwitchStatement(const SwitchStatement&) = delete;
 
-  Expression* condition_ = nullptr;
-  CaseStatementList body_;
+  Expression* const condition_;
+  CaseStatementList const body_;
 };
 
 }  // namespace ast
diff --git a/src/ast/type/access_control_type.h b/src/ast/type/access_control_type.h
index bffd44e..e018b95 100644
--- a/src/ast/type/access_control_type.h
+++ b/src/ast/type/access_control_type.h
@@ -66,8 +66,8 @@
   AccessControl* Clone(CloneContext* ctx) const override;
 
  private:
-  ast::AccessControl access_ = ast::AccessControl::kReadOnly;
-  Type* subtype_ = nullptr;
+  ast::AccessControl const access_;
+  Type* const subtype_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/alias_type.h b/src/ast/type/alias_type.h
index 2fcd45c..d90a99e 100644
--- a/src/ast/type/alias_type.h
+++ b/src/ast/type/alias_type.h
@@ -63,9 +63,9 @@
   Alias* Clone(CloneContext* ctx) const override;
 
  private:
-  Symbol symbol_;
-  std::string name_;
-  Type* subtype_ = nullptr;
+  Symbol const symbol_;
+  std::string const name_;
+  Type* const subtype_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/array_type.h b/src/ast/type/array_type.h
index a120a46..eafb204 100644
--- a/src/ast/type/array_type.h
+++ b/src/ast/type/array_type.h
@@ -76,9 +76,9 @@
   Array* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* subtype_ = nullptr;
-  uint32_t size_ = 0;
-  ArrayDecorationList decos_;
+  Type* const subtype_;
+  uint32_t const size_;
+  ArrayDecorationList const decos_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/matrix_type.h b/src/ast/type/matrix_type.h
index ef39c1a..500f43e 100644
--- a/src/ast/type/matrix_type.h
+++ b/src/ast/type/matrix_type.h
@@ -61,9 +61,9 @@
   Matrix* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* subtype_ = nullptr;
-  uint32_t rows_ = 2;
-  uint32_t columns_ = 2;
+  Type* const subtype_;
+  uint32_t const rows_;
+  uint32_t const columns_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/multisampled_texture_type.h b/src/ast/type/multisampled_texture_type.h
index cdbfdb4..4fb45e2 100644
--- a/src/ast/type/multisampled_texture_type.h
+++ b/src/ast/type/multisampled_texture_type.h
@@ -46,7 +46,7 @@
   MultisampledTexture* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* type_ = nullptr;
+  Type* const type_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/pointer_type.h b/src/ast/type/pointer_type.h
index b22b130..7a9a61b 100644
--- a/src/ast/type/pointer_type.h
+++ b/src/ast/type/pointer_type.h
@@ -50,8 +50,8 @@
   Pointer* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* subtype_;
-  StorageClass storage_class_;
+  Type* const subtype_;
+  StorageClass const storage_class_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/sampled_texture_type.h b/src/ast/type/sampled_texture_type.h
index 54d9da4..cdc93fa 100644
--- a/src/ast/type/sampled_texture_type.h
+++ b/src/ast/type/sampled_texture_type.h
@@ -46,7 +46,7 @@
   SampledTexture* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* type_ = nullptr;
+  Type* const type_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/sampler_type.h b/src/ast/type/sampler_type.h
index 4e71fbb..28a60e8 100644
--- a/src/ast/type/sampler_type.h
+++ b/src/ast/type/sampler_type.h
@@ -58,7 +58,7 @@
   Sampler* Clone(CloneContext* ctx) const override;
 
  private:
-  SamplerKind kind_ = SamplerKind::kSampler;
+  SamplerKind const kind_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/storage_texture_type.h b/src/ast/type/storage_texture_type.h
index 9f88b4d..33e1815 100644
--- a/src/ast/type/storage_texture_type.h
+++ b/src/ast/type/storage_texture_type.h
@@ -101,9 +101,10 @@
   StorageTexture* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* type_ = nullptr;
-  ast::AccessControl access_ = ast::AccessControl::kReadOnly;
-  ImageFormat image_format_ = ImageFormat::kRgba32Float;
+  ast::AccessControl const access_;
+  ImageFormat const image_format_;
+
+  Type* type_ = nullptr;  // Semantic info
 };
 
 }  // namespace type
diff --git a/src/ast/type/struct_type.h b/src/ast/type/struct_type.h
index d372c1c..d1a939c 100644
--- a/src/ast/type/struct_type.h
+++ b/src/ast/type/struct_type.h
@@ -68,9 +68,9 @@
   Struct* Clone(CloneContext* ctx) const override;
 
  private:
-  Symbol symbol_;
-  std::string name_;
-  ast::Struct* struct_ = nullptr;
+  Symbol const symbol_;
+  std::string const name_;
+  ast::Struct* const struct_;
 
   uint64_t LargestMemberBaseAlignment(MemoryLayout mem_layout) const;
 };
diff --git a/src/ast/type/texture_type.h b/src/ast/type/texture_type.h
index ccac6de..88af3fa 100644
--- a/src/ast/type/texture_type.h
+++ b/src/ast/type/texture_type.h
@@ -56,7 +56,7 @@
   TextureDimension dim() const { return dim_; }
 
  private:
-  TextureDimension dim_ = TextureDimension::k1d;
+  TextureDimension const dim_;
 };
 
 }  // namespace type
diff --git a/src/ast/type/vector_type.h b/src/ast/type/vector_type.h
index 9634f43..4228c59 100644
--- a/src/ast/type/vector_type.h
+++ b/src/ast/type/vector_type.h
@@ -58,8 +58,8 @@
   Vector* Clone(CloneContext* ctx) const override;
 
  private:
-  Type* subtype_ = nullptr;
-  uint32_t size_ = 2;
+  Type* const subtype_;
+  uint32_t const size_;
 };
 
 }  // namespace type
diff --git a/src/ast/type_constructor_expression.h b/src/ast/type_constructor_expression.h
index 3863adc..66f45b1 100644
--- a/src/ast/type_constructor_expression.h
+++ b/src/ast/type_constructor_expression.h
@@ -63,8 +63,8 @@
  private:
   TypeConstructorExpression(const TypeConstructorExpression&) = delete;
 
-  type::Type* type_ = nullptr;
-  ExpressionList values_;
+  type::Type* const type_;
+  ExpressionList const values_;
 };
 
 }  // namespace ast
diff --git a/src/ast/uint_literal.h b/src/ast/uint_literal.h
index 9010b6d..3464a88 100644
--- a/src/ast/uint_literal.h
+++ b/src/ast/uint_literal.h
@@ -50,7 +50,7 @@
   UintLiteral* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t value_;
+  uint32_t const value_;
 };
 
 }  // namespace ast
diff --git a/src/ast/unary_op_expression.h b/src/ast/unary_op_expression.h
index 5ec3dcf..0a9d352 100644
--- a/src/ast/unary_op_expression.h
+++ b/src/ast/unary_op_expression.h
@@ -61,8 +61,8 @@
  private:
   UnaryOpExpression(const UnaryOpExpression&) = delete;
 
-  UnaryOp op_ = UnaryOp::kNegation;
-  Expression* expr_ = nullptr;
+  UnaryOp const op_;
+  Expression* const expr_;
 };
 
 }  // namespace ast
diff --git a/src/ast/variable.cc b/src/ast/variable.cc
index e31b02e..c94a97d 100644
--- a/src/ast/variable.cc
+++ b/src/ast/variable.cc
@@ -34,11 +34,11 @@
                    VariableDecorationList decorations)
     : Base(source),
       name_(name),
-      storage_class_(sc),
       type_(type),
       is_const_(is_const),
       constructor_(constructor),
-      decorations_(std::move(decorations)) {}
+      decorations_(std::move(decorations)),
+      storage_class_(sc) {}
 
 Variable::Variable(Variable&&) = default;
 
diff --git a/src/ast/variable.h b/src/ast/variable.h
index b15d222..bf8c1db 100644
--- a/src/ast/variable.h
+++ b/src/ast/variable.h
@@ -162,13 +162,14 @@
  private:
   Variable(const Variable&) = delete;
 
-  std::string name_;
-  StorageClass storage_class_ = StorageClass::kNone;
+  std::string const name_;
   // The value type if a const or formal paramter, and the store type if a var
-  type::Type* type_ = nullptr;
-  bool is_const_ = false;
-  Expression* constructor_ = nullptr;
-  VariableDecorationList decorations_;
+  type::Type* const type_;
+  bool const is_const_;
+  Expression* const constructor_;
+  VariableDecorationList const decorations_;
+
+  StorageClass storage_class_ = StorageClass::kNone;  // Semantic info
 };
 
 /// A list of variables
diff --git a/src/ast/variable_decl_statement.h b/src/ast/variable_decl_statement.h
index 88bef80..bc2bed7 100644
--- a/src/ast/variable_decl_statement.h
+++ b/src/ast/variable_decl_statement.h
@@ -59,7 +59,7 @@
  private:
   VariableDeclStatement(const VariableDeclStatement&) = delete;
 
-  Variable* variable_ = nullptr;
+  Variable* const variable_;
 };
 
 }  // namespace ast
diff --git a/src/ast/workgroup_decoration.cc b/src/ast/workgroup_decoration.cc
index 63fdf20..1e0e5d0 100644
--- a/src/ast/workgroup_decoration.cc
+++ b/src/ast/workgroup_decoration.cc
@@ -23,12 +23,12 @@
 namespace ast {
 
 WorkgroupDecoration::WorkgroupDecoration(const Source& source, uint32_t x)
-    : Base(source), x_(x) {}
+    : WorkgroupDecoration(source, x, 1, 1) {}
 
 WorkgroupDecoration::WorkgroupDecoration(const Source& source,
                                          uint32_t x,
                                          uint32_t y)
-    : Base(source), x_(x), y_(y) {}
+    : WorkgroupDecoration(source, x, y, 1) {}
 
 WorkgroupDecoration::WorkgroupDecoration(const Source& source,
                                          uint32_t x,
diff --git a/src/ast/workgroup_decoration.h b/src/ast/workgroup_decoration.h
index 9946108..d394215 100644
--- a/src/ast/workgroup_decoration.h
+++ b/src/ast/workgroup_decoration.h
@@ -64,9 +64,9 @@
   WorkgroupDecoration* Clone(CloneContext* ctx) const override;
 
  private:
-  uint32_t x_ = 1;
-  uint32_t y_ = 1;
-  uint32_t z_ = 1;
+  uint32_t const x_;
+  uint32_t const y_;
+  uint32_t const z_;
 };
 
 }  // namespace ast