)]}'
{
  "commit": "530688456deef791dc294891e82d44ca4e6c307f",
  "tree": "549cc334d4e04c47b9152ae20e0d68a83d158bd7",
  "parents": [
    "034d4dcad6396d1241e8262e69871b8d61da7e4f"
  ],
  "author": {
    "name": "Daniel Paoliello",
    "email": "danpao@microsoft.com",
    "time": "Tue Apr 14 08:56:47 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Apr 14 08:56:47 2026 -0700"
  },
  "message": "[win] Add a flag to control the Control Flow Guard mechanism on Windows (#176276)\n\nWindows Control Flow Guard (CFG) has two different \"mechanisms\" or\n\"patterns\":\n* Dispatch: the caller calls into the CFG function, which both checks\nthe target callee and then calls it.\n* Check: the caller calls the CFG function which only checks the target\ncallee and then must separately call the callee.\n\nLLVM has followed MSVC\u0027s pattern for selecting the mechanism based on\nthe target architecture. These defaults in MSVC are based on tests for\nperformance: Dispatch produces a smaller code size, whereas Check is\nmore friendly to branch predictors.\n\nIt is possible, however, for a given workload, call pattern or target\nCPU that someone may want to select a different mechanism to use for\ntheir code.\n\nThis change adds a new Clang and CC1 flag to force a CFG mechanism:\n`-fwin-cfg-mechanism`. This can be set to `automatic` (lets LLVM choose\na mechanism), `force-dispatch` or `force-check`.\n\nAlso adds the support for the equivalent MSVC flag\n`/d2guardcfgdispatch`.\n\nNOTE: Arm64EC only supports the check mechanism. It should be noted that\nMSVC emits the \"dispatch\" name for the call checker (for legacy reasons)\nbut uses the check mechanism.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6d7a8631f0d585ea58be17d602cd9cd357496ba0",
      "old_mode": 33188,
      "old_path": "clang/docs/ReleaseNotes.rst",
      "new_id": "c9a470c7748b40462459df8076f657980ff77934",
      "new_mode": 33188,
      "new_path": "clang/docs/ReleaseNotes.rst"
    },
    {
      "type": "modify",
      "old_id": "6cee3e8acda3c6ab8a33d63ec70611355c60ab93",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Basic/CodeGenOptions.def",
      "new_id": "0cd8f35339cf78516c9786c4231a022c3a203026",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Basic/CodeGenOptions.def"
    },
    {
      "type": "modify",
      "old_id": "9454f7672b7e1b4d250fdf7cc34a340065424cf7",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Basic/CodeGenOptions.h",
      "new_id": "147730bdb33fd20bd046c057eee9bfc2d01f689e",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Basic/CodeGenOptions.h"
    },
    {
      "type": "modify",
      "old_id": "5d2741e7e30e538a0d4b2253a32f6ece224247f5",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Options/Options.td",
      "new_id": "96ecc8fbdeb83d302032c085f7a3a3bccc8eb31e",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Options/Options.td"
    },
    {
      "type": "modify",
      "old_id": "bb399a71aa0476726f0128edc78e9ecda485cc60",
      "old_mode": 33188,
      "old_path": "clang/lib/CodeGen/CodeGenModule.cpp",
      "new_id": "b5ff40c2bd175fa3942194801b41a1085b03c1a3",
      "new_mode": 33188,
      "new_path": "clang/lib/CodeGen/CodeGenModule.cpp"
    },
    {
      "type": "modify",
      "old_id": "f685abe9dad35f57f7b22e0704ce04976f7f88d0",
      "old_mode": 33188,
      "old_path": "clang/lib/Driver/ToolChains/Clang.cpp",
      "new_id": "267e6744415996e896aa7d1658a10d269662828a",
      "new_mode": 33188,
      "new_path": "clang/lib/Driver/ToolChains/Clang.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e3b3a6eae2d7ff1e8eae94fe71ffa44b34c1d382",
      "new_mode": 33188,
      "new_path": "clang/test/CodeGen/cfguard-mechanism.c"
    },
    {
      "type": "modify",
      "old_id": "07a09a16170ccb87a6226b1fde0a199b2761498a",
      "old_mode": 33188,
      "old_path": "clang/test/Driver/cl-options.c",
      "new_id": "b77a6cd6eb21f051701fc7c435d625e693fa71d3",
      "new_mode": 33188,
      "new_path": "clang/test/Driver/cl-options.c"
    },
    {
      "type": "modify",
      "old_id": "86325ef73138100860c2bf9d76a118d9fd787a9a",
      "old_mode": 33188,
      "old_path": "llvm/docs/LangRef.rst",
      "new_id": "6f34005f3e9458a2b755156b1fd5b43055ef496c",
      "new_mode": 33188,
      "new_path": "llvm/docs/LangRef.rst"
    },
    {
      "type": "modify",
      "old_id": "65d262a08737857728e55af7662e8c14212f8eed",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/Support/CodeGen.h",
      "new_id": "52f00c3258c0f9f1ee8609962337aafa6c48f8de",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/Support/CodeGen.h"
    },
    {
      "type": "modify",
      "old_id": "df5385718becc105904f95d30555eabf06fb59bd",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/Transforms/CFGuard.h",
      "new_id": "175d62851f363e46abc68d11a556cd03cc174320",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/Transforms/CFGuard.h"
    },
    {
      "type": "modify",
      "old_id": "715f4d2c0abc49b7b7dc2f3bbb6248a1b6494602",
      "old_mode": 33188,
      "old_path": "llvm/lib/Passes/PassBuilder.cpp",
      "new_id": "2751961e684d2e617581e20ec70da4f649382e25",
      "new_mode": 33188,
      "new_path": "llvm/lib/Passes/PassBuilder.cpp"
    },
    {
      "type": "modify",
      "old_id": "9fe40d441e0af0d6e531af54cf8361d072140c99",
      "old_mode": 33188,
      "old_path": "llvm/lib/Passes/PassRegistry.def",
      "new_id": "9f7b3cf4df77b4794432fbf4b54d784ab1891c84",
      "new_mode": 33188,
      "new_path": "llvm/lib/Passes/PassRegistry.def"
    },
    {
      "type": "modify",
      "old_id": "866e2f9c4218c0c1b955740074f776952a8f199b",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/AArch64/AArch64Arm64ECCallLowering.cpp",
      "new_id": "44f76f9e8772bedd739e0cfc2dd83267ea7d4d08",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/AArch64/AArch64Arm64ECCallLowering.cpp"
    },
    {
      "type": "modify",
      "old_id": "929001ed0ae6b026e631df3bfdd70e4c9486bd3f",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/AArch64/AArch64TargetMachine.cpp",
      "new_id": "a2dbdf2cef1e70931c6089ca278ef32b2af9a1ff",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/AArch64/AArch64TargetMachine.cpp"
    },
    {
      "type": "modify",
      "old_id": "f8dbc7907f64baa327888d7b245c9eb209ab2060",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/ARM/ARMTargetMachine.cpp",
      "new_id": "9e8c3cdd29fe89e9263d63c357d30e7486442774",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/ARM/ARMTargetMachine.cpp"
    },
    {
      "type": "modify",
      "old_id": "f020e0b55141c85c054992d5f25860cc0fe467ca",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86CallingConv.td",
      "new_id": "7d24126f820f853313b6084bd178761313daae85",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86CallingConv.td"
    },
    {
      "type": "modify",
      "old_id": "87dd17bf544f7f1219b2f0c889db75612b517c07",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp",
      "new_id": "7bc009f24a412ab8b1f3633ff6f4446cb99d374a",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp"
    },
    {
      "type": "modify",
      "old_id": "83dd6ea287e83413470448ca4fa5e98770938b40",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86RegisterInfo.cpp",
      "new_id": "c92e20ad7ef13fd543bcf38156e20ab94199bec0",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86RegisterInfo.cpp"
    },
    {
      "type": "modify",
      "old_id": "bb7e4d4396305ade585f9d3fa8aef16434f33750",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/X86/X86TargetMachine.cpp",
      "new_id": "eba9486745f5431ba3f05e8330d636f53cc4da18",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/X86/X86TargetMachine.cpp"
    },
    {
      "type": "modify",
      "old_id": "28d0eddca7ce22fcb7c096406e09a15b73214bd1",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/CFGuard/CFGuard.cpp",
      "new_id": "a9819a54d20e5a3518bd07d413707825fabfaaa3",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/CFGuard/CFGuard.cpp"
    },
    {
      "type": "modify",
      "old_id": "7cd9cf1ed2e5c20de3f57cc8bb4cf31dae2f5b71",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AArch64/cfguard-module-flag.ll",
      "new_id": "f279aad41ade50d9ee6b41c39173262de64558d3",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AArch64/cfguard-module-flag.ll"
    },
    {
      "type": "modify",
      "old_id": "bb3c04a54caffb70287664a034929b63d487b624",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/ARM/cfguard-module-flag.ll",
      "new_id": "e17730fb3e77766e60e54cd4a8cec8fc4a8c399e",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/ARM/cfguard-module-flag.ll"
    },
    {
      "type": "modify",
      "old_id": "bf0120781292f72b0c8445fd8c8f7366d2649802",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/X86/cfguard-module-flag.ll",
      "new_id": "0b3006231663b5a5a3d5ddded6378c700d49e7a7",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/X86/cfguard-module-flag.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2ffdb6ed612abe7255500045d100a5b310a23805",
      "new_mode": 33188,
      "new_path": "llvm/test/Linker/cfguard.ll"
    }
  ]
}
