From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta37.uswest2.a.cloudfilter.net (omta37.uswest2.a.cloudfilter.net [35.89.44.36]) by sourceware.org (Postfix) with ESMTPS id 64C0B385840C for ; Sat, 19 Aug 2023 20:20:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64C0B385840C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from eig-obgw-6005a.ext.cloudfilter.net ([10.0.30.201]) by cmsmtp with ESMTP id XRGdqEKFgQFHRXSQiqYmxh; Sat, 19 Aug 2023 20:20:16 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id XSQiqfI4nWlkNXSQiqSR0s; Sat, 19 Aug 2023 20:20:16 +0000 X-Authority-Analysis: v=2.4 cv=IeyU5Ema c=1 sm=1 tr=0 ts=64e12400 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=UttIx32zK-AA:10 a=Qbun_eYptAEA:10 a=g9haMxYq3JGd-zuspEMA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TegoBAiOwHoLPmz3RuJUNoYOMRInt+64EsdaJy/hYrQ=; b=wVvibGIMGlHpZz7F6AE+EuLywQ onGy/rZYw8BtLKjzydTQALQrMNLkKST95Gv1kw9Ip0pQgUulvirY2VlVlCIw5CYTnJYFqRLhFU3SR wuXMyQrXz3Ejgec9QD88Rspwx; Received: from 75-166-142-177.hlrn.qwest.net ([75.166.142.177]:36668 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qXQ4X-003yKO-38; Sat, 19 Aug 2023 11:49:14 -0600 From: Tom Tromey To: cgen@sourceware.org Cc: Tom Tromey Subject: [RFC 13/14] Load macros before uses Date: Sat, 19 Aug 2023 11:42:12 -0600 Message-ID: <20230819174900.866436-14-tom@tromey.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230819174900.866436-1-tom@tromey.com> References: <20230819174900.866436-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.142.177 X-Source-L: No X-Exim-ID: 1qXQ4X-003yKO-38 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-142-177.hlrn.qwest.net (localhost.localdomain) [75.166.142.177]:36668 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHpmIQWmZf9AQzgMnrDPR+9VPCxAziLVwpcRb55FNYrY1PtJ4QILnyELUjFWYJcXZ5QfuUuRt7d6ky4YUaTiJt2b3Wwbnj2bNHTUMMiEU7qFOYfIyKU5 +rAlQo2EjCVuj/koI6gl7nvCAeus1hWAbE2UBJS7gP1gh1jXu5mMu1kXp6tVAmLiKnUfYoQgFJy7hg== X-Spam-Status: No, score=-3025.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This hoists the various calls to 'load' to an earlier spot in read.scm. Without this patch, the call to logit /cmd-define-rtl-version would not be expanded, leading to a mysterious error about trying to 'apply' a syntax transformer. That is, this is another situation where the old code assumed that macro expansion could be interleaved with evaluation. --- read.scm | 72 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/read.scm b/read.scm index 8856da0..e6c2bde 100644 --- a/read.scm +++ b/read.scm @@ -62,6 +62,42 @@ ;; Variables representing misc. global constants. +;; Load the base cgen files. + +(load "pmacros") +(load "cos") +(load "slib/logical") +(load "slib/sort") +;; Used to pretty-print debugging messages. +(load "slib/pp") +;; Used by pretty-print. +(load "slib/random") +(load "slib/genwrite") +(load "utils") +(load "utils-cgen") +(load "attr") +(load "enum") +(load "mach") +(load "model") +(load "types") +(load "mode") +(load "ifield") +(load "iformat") +(load "hardware") +(load "operand") +(load "insn") +(load "minsn") +(load "decode") +(load "rtl") +(load "rtl-traverse") +(load "rtl-xform") +(load "rtx-funcs") +(load "rtl-c") +(load "semantics") +(load "sem-frags") +(load "utils-gen") +(load "pgmr-tools") + ;; A list of three numbers designating the cgen version: major minor fixlevel. ;; The "50" is a generic indicator that we're between 1.1 and 1.2. (define /CGEN-VERSION '(1 1 50)) @@ -122,42 +158,6 @@ ;; This is mostly for descriptive purposes. (define APPLICATION 'UNKNOWN) -;; Load the base cgen files. - -(load "pmacros") -(load "cos") -(load "slib/logical") -(load "slib/sort") -;; Used to pretty-print debugging messages. -(load "slib/pp") -;; Used by pretty-print. -(load "slib/random") -(load "slib/genwrite") -(load "utils") -(load "utils-cgen") -(load "attr") -(load "enum") -(load "mach") -(load "model") -(load "types") -(load "mode") -(load "ifield") -(load "iformat") -(load "hardware") -(load "operand") -(load "insn") -(load "minsn") -(load "decode") -(load "rtl") -(load "rtl-traverse") -(load "rtl-xform") -(load "rtx-funcs") -(load "rtl-c") -(load "semantics") -(load "sem-frags") -(load "utils-gen") -(load "pgmr-tools") - ;; Reader state data. ;; All state regarding the reading of a .cpu file is kept in an object of ;; class . -- 2.41.0