From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta037.useast.a.cloudfilter.net (omta037.useast.a.cloudfilter.net [44.202.169.36]) by sourceware.org (Postfix) with ESMTPS id 0CA503858C2D for ; Sat, 19 Aug 2023 19:24:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CA503858C2D 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-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTP id XINXqkd5PWU1cXRYaq6C7M; Sat, 19 Aug 2023 19:24:20 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id XRYZq1FLMY1LGXRYZqI4UC; Sat, 19 Aug 2023 19:24:20 +0000 X-Authority-Analysis: v=2.4 cv=FYgkeby6 c=1 sm=1 tr=0 ts=64e116e4 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=UttIx32zK-AA:10 a=Qbun_eYptAEA:10 a=GmF8L8sxCXQBugCSs70A: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=PQorWXH7pHmCoZjSkRu2ozSSACVHiam0/xPD9k2n470=; b=vctriELetf2X3iutNzwbGWIQIe D2HLyTjGS6+B60gA/OGSsyJ8Shp6xub4xRBwdRSAHjb9BjDx2Lt5nHu5JSsArzPwmg6aFIKRbYbTR 2bz4k4b5r+hyjh1bPU9zGCXFQ; Received: from 75-166-142-177.hlrn.qwest.net ([75.166.142.177]:36658 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 1qXQ4V-003yFg-2K; Sat, 19 Aug 2023 11:49:11 -0600 From: Tom Tromey To: cgen@sourceware.org Cc: Tom Tromey Subject: [RFC 06/14] Remove support for old versions of Guile Date: Sat, 19 Aug 2023 11:42:05 -0600 Message-ID: <20230819174900.866436-7-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: 1qXQ4V-003yFg-2K X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-142-177.hlrn.qwest.net (localhost.localdomain) [75.166.142.177]:36658 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: MS4xfB6o/0xYqskKIIehoUVPGBRMkWyY3g8FykWNL4oW5AJIVt+Qc0idjQMS5Exqx6Abyou0zudbmk6/ipBy7Ct1GJyF2wZjl0iHUbHCSYlFWKSvPBzlB5Bn qISwPonGuaWho/4LW5zgj3nQr73MxJsWPLjbtyuARZAopyVCDI92UVzv7NBMsp5o11GUSFbppBECtQ== X-Spam-Status: No, score=-3025.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,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 removes support for older versions of Guile. --- README | 2 +- cos.scm | 9 +------ guile.scm | 71 +++++-------------------------------------------------- 3 files changed, 8 insertions(+), 74 deletions(-) diff --git a/README b/README index cc286d4..e9f9c7f 100644 --- a/README +++ b/README @@ -43,7 +43,7 @@ Binutils/GDB developers wishing to use CGEN must configure Binutils/GDB with opcodes/Makefile and sim//Makefile for the supported processors. CGEN uses Guile so Guile must be installed. -CGEN has been tested with Guile 1.4.1, 1.6.8, and 1.8.5. +CGEN has been tested with Guile 3.0.7. Support for older versions of Guile will be removed in time. Source Layout diff --git a/cos.scm b/cos.scm index 0210b20..1ba4c54 100644 --- a/cos.scm +++ b/cos.scm @@ -1263,11 +1263,4 @@ ;; Misc. internal utilities. -;; We need a fast vector copy operation. -;; If `vector-copy' doesn't exist (which is assumed to be the fast one), -;; provide a simple version. - -(if (defined? 'vector-copy) - (define /object-vector-copy vector-copy) - (define (/object-vector-copy v) (list->vector (vector->list v))) -) +(define /object-vector-copy vector-copy) diff --git a/guile.scm b/guile.scm index 85c37d4..9d7c64c 100644 --- a/guile.scm +++ b/guile.scm @@ -3,56 +3,14 @@ ; This file is part of CGEN. ; See file COPYING.CGEN for details. -(define *guile-major-version* (string->number (major-version))) -(define *guile-minor-version* (string->number (minor-version))) +(define (eval1 expr) + (eval expr (current-module))) -; eval takes a module argument in 1.6 and later +(define load primitive-load-path) -(if (or (> *guile-major-version* 1) - (>= *guile-minor-version* 6)) - (define (eval1 expr) - (eval expr (current-module))) - (define (eval1 expr) - (eval expr)) -) +(define %stat stat) -; symbol-bound? is deprecated in 1.6 - -(if (or (> *guile-major-version* 1) - (>= *guile-minor-version* 6)) - (define (symbol-bound? table s) - (if table - (error "must pass #f for symbol-bound? first arg")) - ; FIXME: Not sure this is 100% correct. - (module-defined? (current-module) s)) -) - -(if (symbol-bound? #f 'load-from-path) - (begin - (define (load file) - (begin - ;(load-from-path file) - (primitive-load-path file) - )) - ) -) - -(if (not (symbol-bound? #f '%stat)) - (begin - (define %stat stat) - ) -) - -(if (symbol-bound? #f 'debug-enable) - (debug-enable 'backtrace) -) - -; Guile 1.3 has reverse!, Guile 1.2 has list-reverse!. -; CGEN uses reverse! -(if (and (not (symbol-bound? #f 'reverse!)) - (symbol-bound? #f 'list-reverse!)) - (define reverse! list-reverse!) -) +(debug-enable 'backtrace) (define (debug-write . objs) (map (lambda (o) @@ -60,28 +18,11 @@ objs) (newline (current-error-port))) -;; Guile 1.8 no longer has "." in %load-path so relative path loads -;; no longer work. - -(if (or (> *guile-major-version* 1) - (>= *guile-minor-version* 8)) - (set! %load-path (append %load-path (list "."))) -) +(add-to-load-path ".") ;;; Enabling and disabling debugging features of the host Scheme. -;;; For the initial load proces, turn everything on. We'll disable it -;;; before we start doing the heavy computation. -(if (memq 'debug-extensions *features*) - (begin - (debug-enable 'backtrace) - (debug-enable 'debug) - (debug-enable 'backwards) - (debug-set! depth 2000) - (debug-set! maxdepth 2000) - (debug-set! stack 100000) - (debug-set! frames 10))) (read-enable 'positions) ;;; Call THUNK, with debugging enabled if FLAG is true, or disabled if -- 2.41.0