From patchwork Mon May 22 12:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 765391 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 3wWdGM49SPz9s7r for ; Mon, 22 May 2017 22:27:38 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="r6aVHK/1"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=wjj//Nn+aFDOLzBoM7xM9JPNPZ+lY9ufi2t7PiXnRepbT1PIca HmpAihpZLIlEtTbO4vIKXgD/4sNOtzsk0OJ4H2qJx5gXDgf0YgmOfmGBthdZIgQY /P08bbtIEV+C9v3m0/x5tBbjGtESuFAB+7Dl4PoLLApR9IcgUps87Kuo0= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=9XCWHO+wbYreppn3tTUzgL6FbmA=; b=r6aVHK/17YCKrdZSEIHG m7em8L03d/nanTwjR2mWYeNFS24yb2A4TeA00QBdsLbEfj4WLcamqDt4pTgeO3R8 n8X1W8j+otHjyt/Yj8qzRNGHSPtryI054W3TkLRRT8B7jQglLL7h9YGrY7oP8/jx UVp2WNMIMdPgBp4sT6dUQfA= Received: (qmail 102050 invoked by alias); 22 May 2017 12:27:25 -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 100968 invoked by uid 89); 22 May 2017 12:27:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yw0-f169.google.com Received: from mail-yw0-f169.google.com (HELO mail-yw0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 May 2017 12:27:23 +0000 Received: by mail-yw0-f169.google.com with SMTP id p73so48137854ywp.0 for ; Mon, 22 May 2017 05:27:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:cc:from:subject:message-id:date :user-agent:mime-version:content-language; bh=XpjbEKKzttkAxzSlmVgchTlO+JBLrq+X8Gc6ORMNTUs=; b=mMpzZNmnM2VyyBDorGJAduVUEJR0DT9S2Rj17OtNb70ZkETLG1BrKOGsYXgVbHUJVR tsX3dViwVm4R5T40H3v3YYLFMQ3UxfHKwHcGwpln8qgHpqMQ6u9zQsdQbWBVxsGFJ4IZ TpKpQDGeukwz0vAZg+zEsf7PftaUfKdkcX7hmC+mGxpG7NIUg7FVx61qc40tUjA08CYC 6BsZlyiRjSMHM72RWDuRDPnLf6SW43PgAU78z09gQKaMPZV7UzGJbN99O4Tsh6GOgd5Q tzv/ZNPR5gQwU004uBFklzOXBiuR6cUcKnzPDOJzWoBmaADFN0kM76YCj/SOFxo4V8I3 204g== X-Gm-Message-State: AODbwcCtqwAV7Z/A6qTPf3HT87KuwlKx04VPk7GzjtKg0GR4JnnoXfud t7H2C80dkUB31A== X-Received: by 10.129.152.16 with SMTP id p16mr19992357ywg.103.1495456044928; Mon, 22 May 2017 05:27:24 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::94]) by smtp.googlemail.com with ESMTPSA id e67sm6055122ywa.62.2017.05.22.05.27.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 May 2017 05:27:24 -0700 (PDT) To: GCC Patches Cc: =?UTF-8?Q?mliska@suse.cz_>>_Martin_Li=c5=a1ka?= From: Nathan Sidwell Subject: [DUMP PATCH]: Move fdump-translation-unit to C++ FE only Message-ID: <727dfa11-9082-54fa-0b0f-58effc06ddb4@acm.org> Date: Mon, 22 May 2017 08:27:23 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 This patch moves the -fdump-translation-unit into the new langhook for registering dumps. On the way the option gets renamed to -fdump-lang-raw. Committed as obvious. nathan 2017-05-22 Nathan Sidwell gcc/ * doc/invoke.texi (fdump-translation-unit): Delete documentation. (fdump-lang): Document 'raw' option. * dumpfile.h (TDI_tu): Delete. * dumpfile.c (dump_files): Remove translation-unit. (FIRST_AUTO_NUMBERED_DUMP): Decrement. gcc/cp/ * cp-objcp-common.c (cp_register_dumps): Register raw dumper. * cp-tree.h (raw_dump_id): Declare. * decl2.c (raw_dump_id): Define. (dump_tu): Use raw_dump_id. gcc/c/ * c-decl.c (c_parse_final_cleanups): Drop TDI_tu handling. Index: c/c-decl.c =================================================================== --- c/c-decl.c (revision 248332) +++ c/c-decl.c (working copy) @@ -11214,18 +11214,6 @@ c_parse_final_cleanups (void) dump_ada_specs (collect_all_refs, NULL); } - if (ext_block) - { - tree tmp = BLOCK_VARS (ext_block); - dump_flags_t flags; - FILE * stream = dump_begin (TDI_tu, &flags); - if (stream && tmp) - { - dump_node (tmp, flags & ~TDF_SLIM, stream); - dump_end (TDI_tu, stream); - } - } - /* Process all file scopes in this compilation, and the external_scope, through wrapup_global_declarations. */ FOR_EACH_VEC_ELT (*all_translation_units, i, t) Index: cp/cp-objcp-common.c =================================================================== --- cp/cp-objcp-common.c (revision 248332) +++ cp/cp-objcp-common.c (working copy) @@ -359,6 +359,9 @@ cp_register_dumps (gcc::dump_manager *du { class_dump_id = dumps->dump_register (".class", "lang-class", "lang-class", DK_lang, OPTGROUP_NONE, false); + + raw_dump_id = dumps->dump_register + (".raw", "lang-raw", "lang-raw", DK_lang, OPTGROUP_NONE, false); } void Index: cp/cp-tree.h =================================================================== --- cp/cp-tree.h (revision 248332) +++ cp/cp-tree.h (working copy) @@ -5776,6 +5776,7 @@ extern cp_parameter_declarator *no_param /* Various dump ids. */ extern int class_dump_id; +extern int raw_dump_id; /* in call.c */ extern bool check_dtor_name (tree, tree); Index: cp/decl2.c =================================================================== --- cp/decl2.c (revision 248332) +++ cp/decl2.c (working copy) @@ -49,6 +49,9 @@ along with GCC; see the file COPYING3. #include "c-family/c-ada-spec.h" #include "asan.h" +/* Id for dumping the raw trees. */ +int raw_dump_id; + extern cpp_reader *parse_in; /* This structure contains information about the initializations @@ -4362,12 +4365,10 @@ static void dump_tu (void) { dump_flags_t flags; - FILE *stream = dump_begin (TDI_tu, &flags); - - if (stream) + if (FILE *stream = dump_begin (raw_dump_id, &flags)) { dump_node (global_namespace, flags & ~TDF_SLIM, stream); - dump_end (TDI_tu, stream); + dump_end (raw_dump_id, stream); } } Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 248332) +++ doc/invoke.texi (working copy) @@ -550,7 +550,6 @@ Objective-C and Objective-C++ Dialects}. -fdump-passes @gol -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol -fdump-statistics @gol --fdump-translation-unit@r{[}-@var{n}@r{]} @gol -fdump-tree-all @gol -fdump-tree-@var{switch} @gol -fdump-tree-@var{switch}-@var{options} @gol @@ -12972,7 +12971,7 @@ Dump after function inlining. @opindex fdump-lang Control the dumping of language-specific information. The @var{options} and @var{filename} portions behave as described in the -`@option{-fdump-tree} option. The following @var{switch} values are +@option{-fdump-tree} option. The following @var{switch} values are accepted: @table @samp @@ -12984,6 +12983,9 @@ Enable all language-specific dumps. Dump class hierarchy information. Virtual table information is emitted unless '@option{slim}' is specified. This option is applicable to C++ only. +@item raw +Dump the raw internal tree data. This option is applicable to C++ only. + @end table @item -fdump-passes @@ -13002,16 +13004,6 @@ whole compilation unit while @samp{-deta the passes generate them. The default with no option is to sum counters for each function compiled. -@item -fdump-translation-unit @r{(C++ only)} -@itemx -fdump-translation-unit-@var{options} @r{(C++ only)} -@opindex fdump-translation-unit -Dump a representation of the tree structure for the entire translation -unit to a file. The file name is made by appending @file{.tu} to the -source file name, and the file is created in the same directory as the -output file. If the @samp{-@var{options}} form is used, @var{options} -controls the details of the dump as described for the -@option{-fdump-tree} options. - @item -fdump-tree-all @itemx -fdump-tree-@var{switch} @itemx -fdump-tree-@var{switch}-@var{options} Index: dumpfile.c =================================================================== --- dumpfile.c (revision 248332) +++ dumpfile.c (working copy) @@ -73,11 +73,10 @@ static struct dump_file_info dump_files[ dump_file_info (".cgraph", "ipa-cgraph", DK_ipa, 0), dump_file_info (".type-inheritance", "ipa-type-inheritance", DK_ipa, 0), dump_file_info (".ipa-clones", "ipa-clones", DK_ipa, 0), - dump_file_info (".tu", "translation-unit", DK_lang, 1), dump_file_info (".original", "tree-original", DK_tree, 3), dump_file_info (".gimple", "tree-gimple", DK_tree, 4), dump_file_info (".nested", "tree-nested", DK_tree, 5), -#define FIRST_AUTO_NUMBERED_DUMP 4 +#define FIRST_AUTO_NUMBERED_DUMP 3 dump_file_info (NULL, "lang-all", DK_lang, 0), dump_file_info (NULL, "tree-all", DK_tree, 0), Index: dumpfile.h =================================================================== --- dumpfile.h (revision 248332) +++ dumpfile.h (working copy) @@ -30,7 +30,6 @@ enum tree_dump_index TDI_cgraph, /* dump function call graph. */ TDI_inheritance, /* dump type inheritance graph. */ TDI_clones, /* dump IPA cloning decisions. */ - TDI_tu, /* dump the whole translation unit. */ TDI_original, /* dump each function before optimizing it */ TDI_generic, /* dump each function after genericizing it */ TDI_nested, /* dump each function after unnesting it */