get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/808977/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 808977,
    "url": "http://patchwork.ozlabs.org/api/patches/808977/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/60382486-9f30-4c5f-59ab-5db22a0eacbd@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": "<60382486-9f30-4c5f-59ab-5db22a0eacbd@acm.org>",
    "list_archive_url": null,
    "date": "2017-09-01T19:02:42",
    "name": "[C++ PATCH[ move METHOD_VEC handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ead7e76e66a2a6f27ef8a3effeaabfbb2e3e9c6b",
    "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/60382486-9f30-4c5f-59ab-5db22a0eacbd@acm.org/mbox/",
    "series": [
        {
            "id": 1100,
            "url": "http://patchwork.ozlabs.org/api/series/1100/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=1100",
            "date": "2017-09-01T19:02:42",
            "name": "[C++ PATCH[ move METHOD_VEC handling",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1100/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808977/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808977/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-461327-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-461327-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=\"RH52D6v9\"; 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 3xkTCP576Yz9sRY\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 05:02:56 +1000 (AEST)",
            "(qmail 62152 invoked by alias); 1 Sep 2017 19:02:49 -0000",
            "(qmail 62136 invoked by uid 89); 1 Sep 2017 19:02:49 -0000",
            "from mail-yw0-f180.google.com (HELO mail-yw0-f180.google.com)\n\t(209.85.161.180) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tFri, 01 Sep 2017 19:02:46 +0000",
            "by mail-yw0-f180.google.com with SMTP id b142so615838ywa.0 for\n\t<gcc-patches@gcc.gnu.org>; Fri, 01 Sep 2017 12:02:46 -0700 (PDT)",
            "from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254?\n\t([2620:10d:c091:200::1:d19a]) by smtp.googlemail.com with\n\tESMTPSA id u34sm309666ywh.99.2017.09.01.12.02.43\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256\n\tbits=128/128); Fri, 01 Sep 2017 12:02:44 -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=N0eg4xi2csVYbW5SGMBEXfXd6kjgvhnQMPuB50Tqm1rXdHFKAV\n\t5vSUIXwvFkkPidVcdpvCRu3xdwaZF/gHt6fiDefCHazeGygvtAKCwStkE+Pb+oFh\n\tnviQ46HZ6WPnuOo97rfRCbRKdI119fn4E7XLZ9IZfeLUsGaftePYI7TAQ=",
        "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=Hxe3e1Tqlx1nNA+Bg7Dt8CDl5IA=; b=RH52D6v91nQfuYi2uZvg\n\tDXLFBBYzK/JEPw4sCy0gaEDdV8sTZtJ+C0+dzDpPeoKB0aZ77NRzPBnBSczwHfPP\n\tNtAhd/xpNXf8e/Ls9Za507igmTQsMMEpXk/23EW2AO8CAsRd2153M7I1laCHavB2\n\tJIxiM0Ssu2/m4KvbFKnZ/L0=",
        "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=-10.6 required=5.0 tests=BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=Lose",
        "X-HELO": "mail-yw0-f180.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=Xg/s7iR125iLTGeDUvMJjt1laXdjTDAcfhvdFUhgotc=;\n\tb=ZAIwOJ4Olhx+HhIbXZC30qXjwyviPdYLMgqlkFErWSqKLyWXZlI4vvylvxXNUXjjX7\n\t/j14PmmZXX3frF55cR/7zprRz7gJV0wEeXEqnuWl1aQLk/eZbmmLZ8wv4vXAP1etN6NX\n\tPsl2wk1pzk0a7yZxd8ztgbJGGfkHsmD4cdW/X/ifSXvyGvxyeFlfZDQtBfPPrn8F33ER\n\tY1NKgHklEu9E43xSw6EVtd80lSNpCx6akokpi2TBO+QcgcPlsEAWC7iyYQccJ6N8PCcX\n\tVuZ4sVXwh4RPJUPjmOq2+HFgCVxA1M/cLNj+CICcmEC9e1OOdoFbsk8MLwPl35lxeQ0T\n\tnVoQ==",
        "X-Gm-Message-State": "AHPjjUiztKsixFcD34+kW/JtM92muMjU3Omula5cAPBZV00OZPL8h5t8\tpwhLjjvkrEZ+jA==",
        "X-Google-Smtp-Source": "ADKCNb6bRz+eRYjHRiLUQoD4Xi0sfobfLtWbeLVlT8WsfaY99cgti+8hdapjCpwGSac9kyU/MwdU7g==",
        "X-Received": "by 10.37.48.133 with SMTP id w127mr2469743ybw.182.1504292565106;\n\tFri, 01 Sep 2017 12:02:45 -0700 (PDT)",
        "To": "GCC Patches <gcc-patches@gcc.gnu.org>",
        "From": "Nathan Sidwell <nathan@acm.org>",
        "Subject": "[C++ PATCH[ move METHOD_VEC handling",
        "Message-ID": "<60382486-9f30-4c5f-59ab-5db22a0eacbd@acm.org>",
        "Date": "Fri, 1 Sep 2017 15:02:42 -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=\"------------F3AA3962C25A2C89A3729DA5\""
    },
    "content": "This patch moves the CLASSTYPE_METHOD_VEC sorting functions from class.c \nto name-lookup.c.  It also merges the intial sort call into \nset_class_bindings, leaving that function in control of arranging the \npost-definition lookup data objects.\n\nApplied to trunk.\n\nnathan",
    "diff": "2017-09-01  Nathan Sidwell  <nathan@acm.org>\n\n\t* cp-tree.h (resort_type_method_vec): Move declaration to ...\n\t* name-lookup.h (resort_type_method_vec): ... here.\n\t(set_class_bindings): Lose 2nd arg.\n\t* class.c (finish_struct_1, finish_struct): Adjust\n\tset_class_bindings call.  Don't call finish_struct_methods.\n\t(resort_data, method_name_cmp, resort_method_name_cmp,\n\tresort_type_method_vec, finish_struct_methods): Move to ...\n\t* name-lookup.c (resort_data, method_name_cmp,\n\tresort_method_name_cmp, resort_type_method_vec): ... here.\n\t(set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.\n\nIndex: class.c\n===================================================================\n--- class.c\t(revision 251608)\n+++ class.c\t(working copy)\n@@ -129,10 +129,7 @@ static void handle_using_decl (tree, tre\n static tree dfs_modify_vtables (tree, void *);\n static tree modify_all_vtables (tree, tree);\n static void determine_primary_bases (tree);\n-static void finish_struct_methods (tree);\n static void maybe_warn_about_overly_private_class (tree);\n-static int method_name_cmp (const void *, const void *);\n-static int resort_method_name_cmp (const void *, const void *);\n static void add_implicitly_declared_members (tree, tree*, int, int);\n static tree fixed_type_or_null (tree, int *, int *);\n static tree build_simple_base_path (tree expr, tree binfo);\n@@ -2247,76 +2244,6 @@ maybe_warn_about_overly_private_class (t\n     }\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-\n-static int\n-method_name_cmp (const void* m1_p, const void* m2_p)\n-{\n-  const tree *const m1 = (const tree *) m1_p;\n-  const tree *const m2 = (const tree *) m2_p;\n-\n-  if (OVL_NAME (*m1) < OVL_NAME (*m2))\n-    return -1;\n-  return 1;\n-}\n-\n-/* This routine compares two fields like method_name_cmp but using the\n-   pointer operator in resort_field_decl_data.  */\n-\n-static int\n-resort_method_name_cmp (const void* m1_p, const void* m2_p)\n-{\n-  const tree *const m1 = (const tree *) m1_p;\n-  const tree *const m2 = (const tree *) m2_p;\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-}\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-{\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-    }\n-}\n-\n-/* Warn about duplicate methods in fn_fields.\n-\n-   Sort methods that are not special (i.e., constructors, destructors,\n-   and type conversion operators) so that we can find them faster in\n-   search.  */\n-\n-static void\n-finish_struct_methods (tree t)\n-{\n-  vec<tree, va_gc> *method_vec = CLASSTYPE_METHOD_VEC (t);\n-  if (!method_vec)\n-    return;\n-\n-  qsort (method_vec->address (), method_vec->length (),\n-\t sizeof (tree), method_name_cmp);\n-}\n-\n /* Make BINFO's vtable have N entries, including RTTI entries,\n    vbase and vcall offsets, etc.  Set its type and call the back end\n    to lay it out.  */\n@@ -6966,8 +6893,7 @@ finish_struct_1 (tree t)\n   layout_class_type (t, &virtuals);\n   /* COMPLETE_TYPE_P is now true.  */\n \n-  finish_struct_methods (t);\n-  set_class_bindings (t, TYPE_FIELDS (t));\n+  set_class_bindings (t);\n \n   if (CLASSTYPE_AS_BASE (t) != t)\n     /* We use the base type for trivial assignments, and hence it\n@@ -7187,8 +7113,7 @@ finish_struct (tree t, tree attributes)\n       TYPE_SIZE_UNIT (t) = size_zero_node;\n       /* COMPLETE_TYPE_P is now true.  */\n \n-      finish_struct_methods (t);\n-      set_class_bindings (t, TYPE_FIELDS (t));\n+      set_class_bindings (t);\n \n       /* We need to emit an error message if this type was used as a parameter\n \t and it is an abstract type, even if it is a template. We construct\nIndex: cp-tree.h\n===================================================================\n--- cp-tree.h\t(revision 251592)\n+++ cp-tree.h\t(working copy)\n@@ -5952,8 +5952,6 @@ extern tree convert_to_base_statically\n extern tree build_vtbl_ref\t\t\t(tree, tree);\n extern tree build_vfn_ref\t\t\t(tree, tree);\n extern tree get_vtable_decl\t\t\t(tree, int);\n-extern void resort_type_method_vec\t\t(void *, void *,\n-\t\t\t\t\t\t gt_pointer_operator, void *);\n extern bool add_method\t\t\t\t(tree, tree, bool);\n extern tree declared_access\t\t\t(tree);\n extern tree currently_open_class\t\t(tree);\nIndex: name-lookup.c\n===================================================================\n--- name-lookup.c\t(revision 251592)\n+++ name-lookup.c\t(working copy)\n@@ -1312,6 +1312,59 @@ lookup_fnfields_slot (tree type, tree na\n   return lookup_fnfields_slot_nolazy (type, name);\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+\n+static int\n+method_name_cmp (const void* m1_p, const void* m2_p)\n+{\n+  const tree *const m1 = (const tree *) m1_p;\n+  const tree *const m2 = (const tree *) m2_p;\n+\n+  if (OVL_NAME (*m1) < OVL_NAME (*m2))\n+    return -1;\n+  return 1;\n+}\n+\n+/* This routine compares two fields like method_name_cmp but using the\n+   pointer operator in resort_field_decl_data.  */\n+\n+static int\n+resort_method_name_cmp (const void* m1_p, const void* m2_p)\n+{\n+  const tree *const m1 = (const tree *) m1_p;\n+  const tree *const m2 = (const tree *) m2_p;\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+}\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+{\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+    }\n+}\n+\n /* Allocate and return an instance of struct sorted_fields_type with\n    N fields.  */\n \n@@ -1383,11 +1436,16 @@ add_enum_fields_to_record_type (tree enu\n }\n \n /* Insert FIELDS into KLASS for the sorted case if the FIELDS count is\n-   big enough.  */\n+   big enough.  Sort the METHOD_VEC too.  */\n \n void \n-set_class_bindings (tree klass, tree fields)\n+set_class_bindings (tree klass)\n {\n+  if (vec<tree, va_gc> *method_vec = CLASSTYPE_METHOD_VEC (klass))\n+    qsort (method_vec->address (), method_vec->length (),\n+\t   sizeof (tree), method_name_cmp);\n+\n+  tree fields = TYPE_FIELDS (klass);\n   int n_fields = count_fields (fields);\n   if (n_fields >= 8)\n     {\nIndex: name-lookup.h\n===================================================================\n--- name-lookup.h\t(revision 251592)\n+++ name-lookup.h\t(working copy)\n@@ -322,7 +322,9 @@ extern tree lookup_arg_dependent (tree,\n extern tree lookup_field_1\t\t\t(tree, tree, bool);\n extern tree lookup_fnfields_slot\t\t(tree, tree);\n extern tree lookup_fnfields_slot_nolazy\t\t(tree, tree);\n-extern void set_class_bindings (tree, tree);\n+extern void resort_type_method_vec (void *, void *,\n+\t\t\t\t    gt_pointer_operator, void *);\n+extern void set_class_bindings (tree);\n extern void insert_late_enum_def_bindings (tree, tree);\n extern tree innermost_non_namespace_value (tree);\n extern cxx_binding *outer_binding (tree, cxx_binding *, bool);\n",
    "prefixes": []
}