)]}'
{
  "commit": "bbc24438c4cc24973a5603f7674f3b8100b3b9a2",
  "tree": "68c3c55c96b800cfbc97f305909816239a9cd625",
  "parents": [
    "80367becd64001f952e96928e54d739d9ea2505b"
  ],
  "author": {
    "name": "Nathan Sidwell",
    "email": "nathan@acm.org",
    "time": "Mon Jan 24 04:28:09 2022 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Jan 24 05:35:47 2022 -0800"
  },
  "message": "[demangler][NFC] Refactor some parsing\n\nThere\u0027s some unnecessary code duplication in the parser.  This\nrefactors that and deploys boolean variables to avoid the duplication.\nThese also happen to help adding module demangling (with an updated\nmangling scheme).\n\n1a) The grammar requires some lookahead concerning \u003ctemplate-args\u003e. We\nmay discover an \u003cunscoped-name\u003e is actually \u003cunscoped-template-name\u003e\n\u003ctemplate-args\u003e.  (When \u003cunscoped-name\u003e was a substitution, there must\nbe a following \u003ctemplate-args\u003e.)  Refactor parseName to only have one\ncode path looking for the \u0027I\u0027 indicating \u003ctemplate-args\u003e.\n\n1b) While there I altered the control flow to hold the result in a\nvariable, rather than tail call.  Made it easier to debug (and of\ncourse an optimizer will DTRT here anyway).\n\n2a) An \u003cunscoped-name\u003e can have an St or StL prefix.  No need for\ncompletely separate code paths handling the following unqualified-name\nthough.\n\n2b) Also no need to look for both \u0027St\u0027 and \u0027StL\u0027 separately.  Look for\n\u0027St\u0027 and then conditionally swallow an \u0027L\u0027.\n\n3) We get a similar issue as #1a when parsing a typeName.  Here I just\nchange the control flow slightly to bring the \u0027break\u0027 out to the end\nof the \u0027S\u0027 block and embed the early return inside an if.  That\u0027s more\nin keeping with the code style.\n\n4) Although NFC, there\u0027s a new testcase as that\u0027s not covered by the\nexisting demangler tests and is significant in the #1a case above.\n\nReviewed By: ChuanqiXu\n\nDifferential Revision: https://reviews.llvm.org/D117879\n\nGitOrigin-RevId: 6184e565ad4065026bc121fd13d6a8743a1fe593\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "01f414a7257bf93f1bd0ce0da9b9271ca308a693",
      "old_mode": 33188,
      "old_path": "src/demangle/ItaniumDemangle.h",
      "new_id": "45bb741f5629f4306f33899aa271278d203e976d",
      "new_mode": 33188,
      "new_path": "src/demangle/ItaniumDemangle.h"
    },
    {
      "type": "modify",
      "old_id": "b1bc05661144a028a6cef5b76cc596457f228572",
      "old_mode": 33188,
      "old_path": "test/test_demangle.pass.cpp",
      "new_id": "7bbb17c581cc19f2a80b2c4d9032b40d03b937ca",
      "new_mode": 33188,
      "new_path": "test/test_demangle.pass.cpp"
    }
  ]
}
