From 3d8c4d1ed095ef10e24e1a81cdbe53c3600d4834 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 28 Sep 2023 10:12:40 -0400 Subject: [PATCH] preproc/domain: Eliminate duplicate domain generation I have long forgotten about this system. It converts typedefs into a more generic domain, but the way in which it does so causes duplicate domains, for two reasons: - Both `preproc:mkdomain` and the caller (`preproc:expand`) recurse into unions and generate domains; and - Each `preproc:expand` pass generates domains. So, for example, if there are two `preproc:expand` passes on a union, then the outer typedef (union) will have domains generated twice (once for each pass), and the inner typedefs will have domains generated four times (for each expansion pass, and twice for each pass). This resolves the issue before the next commit makes further changes to move this into a generated header file. --- src/current/include/preproc/domain.xsl | 5 ++--- src/current/include/preproc/expand.xsl | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/current/include/preproc/domain.xsl b/src/current/include/preproc/domain.xsl index 435532e8..308bbb08 100644 --- a/src/current/include/preproc/domain.xsl +++ b/src/current/include/preproc/domain.xsl @@ -54,7 +54,6 @@ " mode="preproc:mkdomain" priority="5"> - @@ -70,7 +69,7 @@ + select="$union-types" /> -