)]}'
{
  "commit": "2bc6840d3cec319b2b45f968693999312b5b1592",
  "tree": "8d3bbd2e80341aeaeb95605d43f091aa064175b1",
  "parents": [
    "5f8061bd39bd2a13980584f7a1f96723458df994"
  ],
  "author": {
    "name": "Ben Clayton",
    "email": "bclayton@google.com",
    "time": "Thu Dec 03 18:10:39 2020 +0000"
  },
  "committer": {
    "name": "Commit Bot service account",
    "email": "commit-bot@chromium.org",
    "time": "Thu Dec 03 18:10:39 2020 +0000"
  },
  "message": "Add ast::CloneContext::ReplaceAll()\n\nReplaceAll() registers `replacer` to be called whenever the Clone() method is called with a type that matches (or derives from) the type of the first parameter of `replacer`.\n\n`replacer` must be function-like with the signature: `T* (T*)`, where `T` is a type deriving from CastableBase.\n\nIf `replacer` returns a nullptr then Clone() will attempt the next registered replacer function that matches the object type. If no replacers match the object type, or all returned nullptr then Clone() will call `T::Clone()` to clone the object.\n\nExample:\n\n```\n  // Replace all ast::UintLiterals with the number 42\n  CloneCtx ctx(mod);\n  ctx.ReplaceAll([\u0026] (ast::UintLiteral* in) {\n    return ctx.mod-\u003ecreate\u003cast::UintLiteral\u003e(ctx.Clone(in-\u003etype()), 42);\n  });\n  auto* out \u003d ctx.Clone(tree);\n```\n\nThis is to be used by Transforms that want to replace parts of the AST on clone.\n\nBug: tint:390\nChange-Id: I80a0e58aa3711f309f58a504f6b6a06f6c546ea1\nReviewed-on: https://dawn-review.googlesource.com/c/tint/+/34568\nCommit-Queue: Ben Clayton \u003cbclayton@google.com\u003e\nReviewed-by: dan sinclair \u003cdsinclair@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "019da76ab1dc2d4bfb69c918ed23fa0e353d95fb",
      "old_mode": 33188,
      "old_path": "BUILD.gn",
      "new_id": "58a188d7d4c8a80e8f976fd1396c7bcb8e50ca71",
      "new_mode": 33188,
      "new_path": "BUILD.gn"
    },
    {
      "type": "modify",
      "old_id": "870a44a9bb47e18bda123f744045c1f137628b07",
      "old_mode": 33188,
      "old_path": "src/CMakeLists.txt",
      "new_id": "1c603f7c995228c4f91ce88832678701d14af410",
      "new_mode": 33188,
      "new_path": "src/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "667882d792e384212cd5f01748be1f489d370154",
      "old_mode": 33188,
      "old_path": "src/ast/clone_context.h",
      "new_id": "7733b850bee403568209d2b94608b10316a35071",
      "new_mode": 33188,
      "new_path": "src/ast/clone_context.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "48c00d7b90f39838f37c3cc141f626e6132376e4",
      "new_mode": 33188,
      "new_path": "src/ast/clone_context_test.cc"
    }
  ]
}
