)]}'
{
  "commit": "577ee97d4e49acb171dc98afa1cccfad5f36eaa4",
  "tree": "b2733ea9e10bf6f27081fd05e88831d36b50badd",
  "parents": [
    "7f20c6c29ec6f4eed7e1e3b23f938d7ced238902"
  ],
  "author": {
    "name": "Andres-Salamanca",
    "email": "andrealebarbaritos@gmail.com",
    "time": "Tue Aug 19 17:43:13 2025 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Aug 19 17:43:13 2025 -0500"
  },
  "message": "[CIR] Fix access to bitfields inside a union (#154398)\n\nThis PR fixes the access to bitfields inside a union.\nPreviously, we were using a `getMemberOp` to access the field, but\nbecause it is a union, `getMemberOp` would always use index `0`.\n\nFor example, given:\n```c\ntypedef union {\n  int x;\n  int y : 4;\n  int z : 8;\n} demo;\n```\n```mlir\n!rec_demo \u003d !cir.record\u003cunion \"demo\" {!s32i, !u8i, !u8i}\u003e\n```\n\nIn the case of:\n\n```c\nd.y \u003d 2;\n```\n\nIt would generate:\n\n```mlir\ncir.get_member %0[0] {name \u003d \"y\"} : !cir.ptr\u003c!rec_demo\u003e -\u003e !cir.ptr\u003c!s32i\u003e\n```\n\nwith a return type of `!s32i`, when it should be `!u8i`.\nthe get_member verifier would detect that the return type does not match\nthe `y` member.\nTo fix this, we now use `bitcast` to get the start of the union.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "554e60b2f3903e4249f13e309532f08b3a4db6cd",
      "old_mode": 33188,
      "old_path": "clang/lib/CIR/CodeGen/CIRGenExpr.cpp",
      "new_id": "2b248bb65b241dae63837db4ee8afe530c447086",
      "new_mode": 33188,
      "new_path": "clang/lib/CIR/CodeGen/CIRGenExpr.cpp"
    },
    {
      "type": "modify",
      "old_id": "b5d14540f488f25bb9d9e793b3d6cdad7ecd8c12",
      "old_mode": 33188,
      "old_path": "clang/test/CIR/CodeGen/bitfield-union.c",
      "new_id": "14a2aaf68d318bb37165aa763ed8edced418e178",
      "new_mode": 33188,
      "new_path": "clang/test/CIR/CodeGen/bitfield-union.c"
    }
  ]
}
