From c12ab7a6749da1acddf8739a08e145163d20ce5b Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 12 Jul 2020 14:08:11 -0700 Subject: [PATCH] Rearrange ast::node_t fields to improve packing --- src/ast.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ast.h b/src/ast.h index 9a5227d12..9d92fc569 100644 --- a/src/ast.h +++ b/src/ast.h @@ -211,15 +211,15 @@ void accept_field_visitor(FieldVisitor &v, bool reverse, Field &field, Rest &... /// node_t is the base node of all AST nodes. /// It is not a template: it is possible to work concretely with this type. struct node_t { + /// The parent node, or null if this is root. + const node_t *parent{nullptr}; + /// The type of this node. const type_t type; /// The category of this node. const category_t category; - /// The parent node, or null if this is root. - const node_t *parent{nullptr}; - constexpr explicit node_t(type_t t, category_t c) : type(t), category(c) {} /// Disallow copying, etc.