From patchwork Wed Jan 8 18:58:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 308400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8A33E2C00BC for ; Thu, 9 Jan 2014 05:58:30 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=VWWjfspbsb2pIH3JHaUyA4XazJhMV8m6HaFQc7ULAFk JC/Mah1rSBnMr//r/1++SFifcrBO/NxpjZJT8g4csCwf4ZerpJHl7lDXI6DPtshr Cp6G6AMzE76X+F1OH79HSjnKoVu3XDtZmVZe8DUXJ2uyGbAX0W9gVemZnjhmjWtg = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=cfRwURjJur1+ofmCEBbi1ADbzSo=; b=ZmWyB/zoQJ1mPFAV4 J5ybLm9VxHfdmZSKLt0cVQwD1JsYW5GhS8G9mcMpfPc8bhwrc1YRNmi9q2IDYdZQ 9IbzOyonrMhaJn55AtRx/eU+PeViQykyDa7OocpUuBm5RxfZKNGY6GvuYznA+CB2 hMpYIi9CbwIp1aI4XCOstQqsaU= Received: (qmail 11125 invoked by alias); 8 Jan 2014 18:58:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11111 invoked by uid 89); 8 Jan 2014 18:58:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f178.google.com Received: from mail-ig0-f178.google.com (HELO mail-ig0-f178.google.com) (209.85.213.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 08 Jan 2014 18:58:22 +0000 Received: by mail-ig0-f178.google.com with SMTP id ut6so5392699igb.5 for ; Wed, 08 Jan 2014 10:58:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=UUrI7JbVamQntk/NnAN0qEphZsBYUzDkmD+WmwXAsDE=; b=JUpQt0FEfvaxWGAW0mZxYHsIMhADo3mCsgITYQroqjcgmzJTt5Zj60KjUPwoqTWsEG 757C1Nr54ZrsK3X4yOjFooLZx8KZjhH+lgWtrgFeUhuqPAtXg39kb8D66kegZMojMesM m88sMQDhnySTIy6CB23rVf7KW7EhYPfWPEjGZLmrxUxWd5tS8xG1HtOUJeY5eJS0y/GW Z2+t8IdpFL55he5EE+bxQrRMSYlYnj4DMdy4WMvBva7WwWU8FwA7jinqn/ph/Cc7tlfO yscZTk/0/0a0+0omxQqOfPiwJdMEsoq1a0pN8GvnCVVABdDlG0MZcGRHpKXRQt1IPeIq 3W/Q== X-Gm-Message-State: ALoCoQkwHUOY4nrZSDadB+sJSmpsRrb16uHyCJFjDLV8rwNAwck7UFWUbPWbP7PMU+Q+QgurMz7GiY1fFEyj44a8JVhHEwc0Ek7fh9lxXdshm2KOFYWSblkANGb5YHS1XIHvHwzfQSEOLqnk7bJ8n3xATJ11qj6DO94rre9QAbXhNTmZc0ulveXNBvM/DQBSAgVsr8uqXcHeSVckrW+4sg0ruHrG05dahw== MIME-Version: 1.0 X-Received: by 10.50.73.136 with SMTP id l8mr34375844igv.7.1389207500485; Wed, 08 Jan 2014 10:58:20 -0800 (PST) Received: by 10.64.229.35 with HTTP; Wed, 8 Jan 2014 10:58:20 -0800 (PST) Date: Wed, 8 Jan 2014 10:58:20 -0800 Message-ID: Subject: [GOOGLE] Remove mod_id_to_name map From: Dehao Chen To: GCC Patches Cc: David Li X-IsSubscribed: yes This patch removes mod_id_to_name map because the info is already there in module_infos. And also, AutoFDO don't have access to update this map because its a file-static structure. Bootstrapped and passed regression test. OK for google branch? Thanks, Dehao Index: gcc/coverage.c =================================================================== --- gcc/coverage.c (revision 206366) +++ gcc/coverage.c (working copy) @@ -615,37 +615,17 @@ reorder_module_groups (const char *imports_file, u module_name_tab.dispose (); } -typedef struct { - unsigned int mod_id; - const char *mod_name; -} mod_id_to_name_t; - -static vec *mod_names; - -static void -record_module_name (unsigned int mod_id, const char *name) -{ - mod_id_to_name_t t; - - t.mod_id = mod_id; - t.mod_name = xstrdup (name); - if (!mod_names) - vec_alloc (mod_names, 10); - mod_names->safe_push (t); -} - /* Return the module name for module with MOD_ID. */ const char * get_module_name (unsigned int mod_id) { size_t i; - mod_id_to_name_t *elt; - for (i = 0; mod_names->iterate (i, &elt); i++) + for (i = 0; i < num_in_fnames; i++) { - if (elt->mod_id == mod_id) - return elt->mod_name; + if (module_infos[i]->ident == mod_id) + return lbasename (module_infos[i]->source_filename); } gcc_assert (0); @@ -927,9 +907,6 @@ read_counts_file (const char *da_file_name, unsign } } - record_module_name (mod_info->ident, - lbasename (mod_info->source_filename)); - if (dump_enabled_p ()) { dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location,