From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7630 invoked by alias); 12 Sep 2009 17:38:04 -0000 Received: (qmail 7621 invoked by uid 22791); 12 Sep 2009 17:38:04 -0000 X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=AWL,BAYES_00,DNS_FROM_RFC_BOGUSMX,J_CHICKENPOX_33,J_CHICKENPOX_43,J_CHICKENPOX_83,J_CHICKENPOX_93 X-Spam-Check-By: sourceware.org Received: from sebabeach.org (HELO sebabeach.org) (64.165.110.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Sep 2009 17:37:59 +0000 Received: by sebabeach.org (Postfix, from userid 500) id DEF1B6E3D7; Sat, 12 Sep 2009 10:37:57 -0700 (PDT) From: Doug Evans To: cgen@sourceware.org Subject: mode name vs object cleanup Message-Id: <20090912173757.DEF1B6E3D7@sebabeach.org> Date: Sat, 12 Sep 2009 17:38:00 -0000 X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00097.txt.bz2 Hi. I made a cleanup pass of mode handling. Some functions accepted either a mode name or a object when there was no real need to. And many functions didn't document what form they did take. Blech, Mea culpa. I tested it with all apps (opcodes, sim, sid, intrinsics, gas-test, sim-test, doc). But heads up. 2009-09-12 Doug Evans Cleanup pass of mode handling. Make use of mode name vs object more consistent and clear. * hardware.scm (/keyword-read): Default mode to the mode name, not the object. (/hw-parse-indices): Parse mode name and pass mode object to constructor. (/hw-parse-values): Ditto. ( parse!): Pass mode name to /hw-parse-indices and /hw-parse-values. ( parse!): Ditto. ( parse!): Ditto. * mode.scm (/mode-table): New global, replaces mode-list. Modes stored in hashtable instead of list. (/mode-class-table): New global. (mode-list-non-alias-values): Update. (mode:eq?, mode-compatible?, mode:add!): Update. (mode:lookup): Restrict arg to the mode's name. All callers updated. (mode-maybe-lookup): New function. (mode-real-name): Restrict arg to a object. All callers updated. (mode-real-mode, mode-sem-mode, mode-bigger?): Ditto. (mode-find, mode-set-word-modes!): Update (mode-ensure-word-sizes-defined): Update. (/sort-mode-classes!): New function. (mode-builtin!): Update. Sort mode classes here. (mode-finish!): Sort mode classes here too. * rtl-c.scm (/rtl-c-get): Restrict mode arg to a object. All callers updated. (rtl-c-set-quiet): Allow mode to be name of object. (rtl-c-set-trace): Ditto. * rtl-traverse.scm (rtl-eval-with-estate): Restrict mode arg to object. All callers updated. * rtl.scm (rtx-sem-mode): Restrict arg to object. (rtx-lazy-sem-mode): Ditto. ( make!): Assert mode arg is a object. (rtx-env-make): Allow var-list modes to be name or object. * sem-frags.scm (/frag-expr-assq-locals): New function. (/frag-compute-locals!): Call it. (/sfrag-create-cse-mapping): Renamed from sfrag-create-cse-mapping. All callers updated. * semantics.scm (/build-mem-operand!): Handle mode aliases.