Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/812815/?format=api
{ "id": 812815, "url": "http://patchwork.ozlabs.org/api/patches/812815/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/0bbbc933-257c-77eb-5267-237f403758ea@acm.org/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<0bbbc933-257c-77eb-5267-237f403758ea@acm.org>", "list_archive_url": null, "date": "2017-09-12T12:17:43", "name": "[C++] small METHOD_VEC cleanup", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cf3bfb06d092531b327765f91e33dbce2ba13cb8", "submitter": { "id": 9970, "url": "http://patchwork.ozlabs.org/api/people/9970/?format=api", "name": "Nathan Sidwell", "email": "nathan@acm.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/0bbbc933-257c-77eb-5267-237f403758ea@acm.org/mbox/", "series": [ { "id": 2685, "url": "http://patchwork.ozlabs.org/api/series/2685/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=2685", "date": "2017-09-12T12:17:43", "name": "[C++] small METHOD_VEC cleanup", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2685/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/812815/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/812815/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-461910-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461910-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"tmegvd/h\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs3j30Vh4z9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 22:17:57 +1000 (AEST)", "(qmail 1000 invoked by alias); 12 Sep 2017 12:17:50 -0000", "(qmail 984 invoked by uid 89); 12 Sep 2017 12:17:49 -0000", "from mail-yw0-f173.google.com (HELO mail-yw0-f173.google.com)\n\t(209.85.161.173) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 12 Sep 2017 12:17:47 +0000", "by mail-yw0-f173.google.com with SMTP id s62so27787461ywg.0 for\n\t<gcc-patches@gcc.gnu.org>; Tue, 12 Sep 2017 05:17:47 -0700 (PDT)", "from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254?\n\t([2620:10d:c091:200::a68b]) by smtp.googlemail.com with\n\tESMTPSA id x4sm3740936ywa.58.2017.09.12.05.17.44\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256\n\tbits=128/128); Tue, 12 Sep 2017 05:17:45 -0700 (PDT)" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:to\n\t:from:subject:message-id:date:mime-version:content-type; q=dns;\n\ts=default; b=d7ygFIKsmFRPJjM3VSqW9CzHs4w6psA45Fqj/TRvHaUPr5KFXn\n\tjG3scps04ZC8Irjn0smp1VMmSljYI40xUTDPilLA2sUxnTARVMU40srSpjtc/xWn\n\tWp8t18irbIR9+yt2gkaXE+PRv7jQzTtvyL8hYOZpGqYZrvelWNN7LYOrc=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:to\n\t:from:subject:message-id:date:mime-version:content-type; s=\n\tdefault; bh=cptlAUCr2tVUF/jHOtIjrKE4X2U=; b=tmegvd/ht3ZfUfGa5+R8\n\tlmqHuhjS31lnOpV+0cYsE2nYAkhzqW0Sna2wuXluzjqgXkUa8Wanolxv3C5SugPZ\n\teDaSib1KuVvLI35HvZyekO11sj4icUvjdvf0TnoDlrdTnT32+e4s755LiLknHn2u\n\th7eqN0XEBOohmDTvxTOQSto=", "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>", "Sender": "gcc-patches-owner@gcc.gnu.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-11.4 required=5.0 tests=BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=U*nathan,\n\tH*MI:5267, H*M:5267, Resort", "X-HELO": "mail-yw0-f173.google.com", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:sender:to:from:subject:message-id:date\n\t:user-agent:mime-version:content-language;\n\tbh=4aKJlqpzkR47lxDzELnO2WS8fVLCCjBtneFMIVBIv/k=;\n\tb=UjWiC5xnhRp2Yi/gN1kTbkJkTtrEgB2g+KcW6b17hR66Ci7mK5SnFL145fDTksZ54S\n\tVRPjkHBuB7z+Us+5uBCnxpgwBCWqOtZtP+wiYet56PHEwLs30E6dze9oB0bw+4LqbvCJ\n\tbd9vxloZ46TdTY14x1rx5zZG2PqFxMJB0pAb7lL+xTspfZL3dfJWg32NN7Q6zD3CqMB/\n\toBjj3wtarWfzqOfeNy4lN9/rSWD1/PKqOVoRZg5Jz4S0kzaaXvPwFIaqLwmGWk57v3zX\n\txKN8pVFaLawUq55EC7jlX2353GWGoacOgIxigm95V8AYMKoVrewcwRykzTQZZXYAuB7m\n\t0vTA==", "X-Gm-Message-State": "AHPjjUhqV4INyZ1pQ78DSDHH+UsXzwGEz1Bc9TGDmakxCb+Q9Li6mtH8\tU4Cc8RnicKAOSA==", "X-Google-Smtp-Source": "ADKCNb5jiXG5ndN6dc5Yc8mnX8CPvjcUghnl0WL8fF6r9dbeAYhKZ5YWMP8qLmiLsLqHkMA2EBwH0w==", "X-Received": "by 10.37.22.70 with SMTP id 67mr12277837ybw.32.1505218665957;\n\tTue, 12 Sep 2017 05:17:45 -0700 (PDT)", "To": "GCC Patches <gcc-patches@gcc.gnu.org>", "From": "Nathan Sidwell <nathan@acm.org>", "Subject": "[C++ PATCH] small METHOD_VEC cleanup", "Message-ID": "<0bbbc933-257c-77eb-5267-237f403758ea@acm.org>", "Date": "Tue, 12 Sep 2017 08:17:43 -0400", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64;\n\trv:52.0) Gecko/20100101 Thunderbird/52.2.1", "MIME-Version": "1.0", "Content-Type": "multipart/mixed;\n\tboundary=\"------------521FD1E607AF8970B7DCC374\"" }, "content": "It turned out I wasn't quite at the point of committing my sorted_fields \nkilling patch. This one just cleans up some functions affected by \nthat, and I've applied it separately to reduce the churn.\n\nnathan", "diff": "2017-09-12 Nathan Sidwell <nathan@acm.org>\n\n\t* name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for\n\tconsistency.\n\t(restort_data): Move later.\n\t(method_name_cmp, resort_method_name_cmp): Simplify.\n\t(resort_type_method_vec): Reformat.\n\nIndex: name-lookup.c\n===================================================================\n--- name-lookup.c\t(revision 252002)\n+++ name-lookup.c\t(working copy)\n@@ -1311,36 +1311,37 @@ get_class_binding_direct (tree klass, tr\n special function creation as necessary. */\n \n tree\n-get_class_binding (tree type, tree name, int type_or_fns)\n+get_class_binding (tree klass, tree name, int type_or_fns)\n {\n- type = complete_type (type);\n+ klass = complete_type (klass);\n \n- if (COMPLETE_TYPE_P (type))\n+ if (COMPLETE_TYPE_P (klass))\n {\n+ /* Lazily declare functions, if we're going to search these. */\n if (IDENTIFIER_CTOR_P (name))\n \t{\n-\t if (CLASSTYPE_LAZY_DEFAULT_CTOR (type))\n-\t lazily_declare_fn (sfk_constructor, type);\n-\t if (CLASSTYPE_LAZY_COPY_CTOR (type))\n-\t lazily_declare_fn (sfk_copy_constructor, type);\n-\t if (CLASSTYPE_LAZY_MOVE_CTOR (type))\n-\t lazily_declare_fn (sfk_move_constructor, type);\n+\t if (CLASSTYPE_LAZY_DEFAULT_CTOR (klass))\n+\t lazily_declare_fn (sfk_constructor, klass);\n+\t if (CLASSTYPE_LAZY_COPY_CTOR (klass))\n+\t lazily_declare_fn (sfk_copy_constructor, klass);\n+\t if (CLASSTYPE_LAZY_MOVE_CTOR (klass))\n+\t lazily_declare_fn (sfk_move_constructor, klass);\n \t}\n- else if (name == cp_assignment_operator_id (NOP_EXPR))\n+ else if (IDENTIFIER_DTOR_P (name))\n \t{\n-\t if (CLASSTYPE_LAZY_COPY_ASSIGN (type))\n-\t lazily_declare_fn (sfk_copy_assignment, type);\n-\t if (CLASSTYPE_LAZY_MOVE_ASSIGN (type))\n-\t lazily_declare_fn (sfk_move_assignment, type);\n+\t if (CLASSTYPE_LAZY_DESTRUCTOR (klass))\n+\t lazily_declare_fn (sfk_destructor, klass);\n \t}\n- else if (IDENTIFIER_DTOR_P (name))\n+ else if (name == cp_assignment_operator_id (NOP_EXPR))\n \t{\n-\t if (CLASSTYPE_LAZY_DESTRUCTOR (type))\n-\t lazily_declare_fn (sfk_destructor, type);\n+\t if (CLASSTYPE_LAZY_COPY_ASSIGN (klass))\n+\t lazily_declare_fn (sfk_copy_assignment, klass);\n+\t if (CLASSTYPE_LAZY_MOVE_ASSIGN (klass))\n+\t lazily_declare_fn (sfk_move_assignment, klass);\n \t}\n }\n \n- return get_class_binding_direct (type, name, type_or_fns);\n+ return get_class_binding_direct (klass, name, type_or_fns);\n }\n \n /* Find the slot containing overloads called 'NAME'. If there is no\n@@ -1411,56 +1412,58 @@ get_method_slot (tree klass, tree name)\n return slot;\n }\n \n-static struct {\n- gt_pointer_operator new_value;\n- void *cookie;\n-} resort_data;\n-\n-/* Comparison function to compare two TYPE_METHOD_VEC entries by name. */\n+/* Comparison function to compare two TYPE_METHOD_VEC entries by\n+ name. */\n \n static int\n-method_name_cmp (const void* m1_p, const void* m2_p)\n+method_name_cmp (const void *a_p, const void *b_p)\n {\n- const tree *const m1 = (const tree *) m1_p;\n- const tree *const m2 = (const tree *) m2_p;\n+ tree a = *(const tree *)a_p;\n+ tree b = *(const tree *)b_p;\n+ tree name_a = DECL_NAME (TREE_CODE (a) == OVERLOAD ? OVL_FUNCTION (a) : a);\n+ tree name_b = DECL_NAME (TREE_CODE (b) == OVERLOAD ? OVL_FUNCTION (b) : b);\n \n- if (OVL_NAME (*m1) < OVL_NAME (*m2))\n- return -1;\n- return 1;\n+ gcc_checking_assert (name_a && name_b && name_a != name_b);\n+ return name_a < name_b ? -1 : +1;\n }\n \n+static struct {\n+ gt_pointer_operator new_value;\n+ void *cookie;\n+} resort_data;\n+\n /* This routine compares two fields like method_name_cmp but using the\n- pointer operator in resort_field_decl_data. */\n+ pointer operator in resort_field_decl_data. We don't have to deal\n+ with duplicates here. */\n \n static int\n-resort_method_name_cmp (const void* m1_p, const void* m2_p)\n+resort_method_name_cmp (const void *a_p, const void *b_p)\n {\n- const tree *const m1 = (const tree *) m1_p;\n- const tree *const m2 = (const tree *) m2_p;\n+ tree a = *(const tree *)a_p;\n+ tree b = *(const tree *)b_p;\n+ tree name_a = OVL_NAME (a);\n+ tree name_b = OVL_NAME (b);\n+\n+ resort_data.new_value (&name_a, resort_data.cookie);\n+ resort_data.new_value (&name_b, resort_data.cookie);\n+\n+ gcc_checking_assert (name_a != name_b);\n \n- tree n1 = OVL_NAME (*m1);\n- tree n2 = OVL_NAME (*m2);\n- resort_data.new_value (&n1, resort_data.cookie);\n- resort_data.new_value (&n2, resort_data.cookie);\n- if (n1 < n2)\n- return -1;\n- return 1;\n+ return name_a < name_b ? -1 : +1;\n }\n \n /* Resort TYPE_METHOD_VEC because pointers have been reordered. */\n \n void\n-resort_type_method_vec (void* obj,\n-\t\t\tvoid* /*orig_obj*/,\n-\t\t\tgt_pointer_operator new_value,\n-\t\t\tvoid* cookie)\n+resort_type_method_vec (void *obj, void */*orig_obj*/,\n+\t\t\tgt_pointer_operator new_value, void* cookie)\n {\n if (vec<tree, va_gc> *method_vec = (vec<tree, va_gc> *) obj)\n {\n resort_data.new_value = new_value;\n resort_data.cookie = cookie;\n- qsort (method_vec->address (), method_vec->length (), sizeof (tree),\n-\t resort_method_name_cmp);\n+ qsort (method_vec->address (), method_vec->length (),\n+\t sizeof (tree), resort_method_name_cmp);\n }\n }\n \n", "prefixes": [ "C++" ] }