From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id AA9F3388A029 for ; Thu, 29 Apr 2021 12:47:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA9F3388A029 Received: by mail-pf1-x434.google.com with SMTP id c19so1367697pfv.2 for ; Thu, 29 Apr 2021 05:47:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=BM04R8x3QsPAfjwFJ6uGwFTs8hBj2awyeFIxBl6t0V0=; b=TTWLxc9Qo3Hfgjrq6OsOC0ujyGaH9mM2DLT4LOxOnC1BzEKjaTzOZIceNpRcTsFkaZ t+xIS7IR93D0CkEUOGKPY42gzEJk0lfz5KKccEbHqpimO0B6Fjp7BvckgAEWOMTqTsSW 3TR0V75crk/MWbsrL63kpVYzEPwXc/37t6o5GF5AP2W2J2bZnbDfIXsz/cnayjoiNxXO 23569bU4X7XuTOO+1Ir2jTRO4pgt7ojRzg/28pgSRkM3JHwMGcSeXGkqnR4K22KMRU+6 NR38XRvzOg/aYCxfWdwY++NA0qM7xNIvinGW6YnpZsxGrYYZ6yYXp7iC4PY0JrP5Sxuu cQJA== X-Gm-Message-State: AOAM5303yjIvrOsTrhF+Ro9ZuhHadNvuQ5SSP0Y6uTBZGw3DpZmBuoqG wr0JFomToryZ8oVWO/D0w0YU+8wibmBDIw== X-Google-Smtp-Source: ABdhPJwkR4kH3UAReMR/zox0q7xOJRkmDHpjKhawtBQkRtJenHoY/gE6TjVMHeoulGcEqyPYa4zKeg== X-Received: by 2002:a63:5115:: with SMTP id f21mr7809342pgb.92.1619700455402; Thu, 29 Apr 2021 05:47:35 -0700 (PDT) Received: from [192.168.1.2] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id d22sm6347119pjr.2.2021.04.29.05.47.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Apr 2021 05:47:35 -0700 (PDT) Subject: Re: [PATCH v2 11/21] libcc1: unify compiler handling To: Tom Tromey , gcc-patches@gcc.gnu.org References: <20210428010119.806184-1-tom@tromey.com> <20210428010119.806184-12-tom@tromey.com> From: Jeff Law Message-ID: <1d137016-46a0-8859-3a4c-f4ede20010eb@gmail.com> Date: Thu, 29 Apr 2021 06:47:34 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <20210428010119.806184-12-tom@tromey.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2021 12:47:38 -0000 On 4/27/2021 7:01 PM, Tom Tromey wrote: > Both libcc1 plugins have nearly identical copies of code to find the > underlying compiler. This seemed wasteful to me, so this patch > unifies the copies. > > Two minor API changes were needed. > > First, the old code used a back-link from the compiler object to the > plugin object to check the 'verbose' setting. This patch adds a > 'verbose' setting directly to the compiler object instead. > > Second, the 'find' method implicitly knew which compiler base name > ("gcc" or "g++") to use. This patch makes this a parameter that is > passed in by the plugin. > > libcc1/ChangeLog > 2021-04-27 Tom Tromey > > * libcc1.cc (compiler, compiler_triplet_regexp) > (compiler_driver_filename): Remove. > (libcp1::libcp1): Update. > (make_regexp, libcp1::compiler::find) > (libcp1::compiler_triplet_regexp::find) > (libcp1::compiler_driver_filename::find): Remove. > (libcp1_set_verbose, libcp1_set_arguments) > (libcp1_set_triplet_regexp, libcp1_set_driver_filename): Update. > * libcc1.cc (compiler, compiler_triplet_regexp) > (compiler_driver_filename): Remove. > (libcc1::libcc1): Update. > (make_regexp, libcc1::compiler::find) > (libcc1::compiler_triplet_regexp::find) > (libcc1::compiler_driver_filename::find): Remove. > (libcc1_set_verbose, libcc1_set_arguments) > (libcc1_set_triplet_regexp, libcc1_set_driver_filename): Update. > * compiler.cc: New file. > * compiler.hh: New file. > * Makefile.in: Rebuild. > * Makefile.am (libcc1_la_SOURCES): Add compiler.hh, compiler.cc. OK Jeff