)]}'
{
  "commit": "386f2ca03bdbcf5d08e5ec417bdad6c3de01acb6",
  "tree": "c38ffea89a3b66ef87b88c0cc70c854f18ffc35b",
  "parents": [
    "f687ed9ff717372a7c751a3bf4ef7e33eb481fd6"
  ],
  "author": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Mon May 12 08:55:38 2025 -0600"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon May 12 07:55:38 2025 -0700"
  },
  "message": "Allow multi-member variants in DWARF (#139300)\n\nCurrently, each variant in the variant part of a structure type can only\ncontain a single member. This was sufficient for Rust, where each\nvariant is represented as its own type.\n\nHowever, this isn\u0027t really enough for Ada, where a variant can have\nmultiple members.\n\nThis patch adds support for this scenario. This is done by allowing the\nuse of DW_TAG_variant by DICompositeType, and then changing the DWARF\ngenerator to recognize when a DIDerivedType representing a variant holds\none of these. In this case, the fields from the DW_TAG_variant are\ninlined into the variant, like so:\n```\n \u003c4\u003e\u003c7d\u003e: Abbrev Number: 9 (DW_TAG_variant)\n    \u003c7e\u003e   DW_AT_discr_value : 74\n \u003c5\u003e\u003c7f\u003e: Abbrev Number: 7 (DW_TAG_member)\n    \u003c80\u003e   DW_AT_name        : (indirect string, offset: 0x43): field0\n    \u003c84\u003e   DW_AT_type        : \u003c0xa7\u003e\n    \u003c88\u003e   DW_AT_alignment   : 8\n    \u003c89\u003e   DW_AT_data_member_location: 0\n \u003c5\u003e\u003c8a\u003e: Abbrev Number: 7 (DW_TAG_member)\n    \u003c8b\u003e   DW_AT_name        : (indirect string, offset: 0x4a): field1\n    \u003c8f\u003e   DW_AT_type        : \u003c0xa7\u003e\n    \u003c93\u003e   DW_AT_alignment   : 8\n    \u003c94\u003e   DW_AT_data_member_location: 8\n```\nNote that the intermediate DIDerivedType is still needed in this\nsituation, because that is where the discriminants are stored.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7296bb84b7d953036a6c37b088a1eaa6ecfd0224",
      "old_mode": 33188,
      "old_path": "llvm/docs/LangRef.rst",
      "new_id": "5f14726c366727441b28e4b5dcf0364d8a7652af",
      "new_mode": 33188,
      "new_path": "llvm/docs/LangRef.rst"
    },
    {
      "type": "modify",
      "old_id": "d293c28f5b4506a2b70301432bdc350bb28ddc83",
      "old_mode": 33188,
      "old_path": "llvm/include/llvm/IR/DIBuilder.h",
      "new_id": "4ce71bd3dad58ee39d0cef5bd37792976ea1afc9",
      "new_mode": 33188,
      "new_path": "llvm/include/llvm/IR/DIBuilder.h"
    },
    {
      "type": "modify",
      "old_id": "5f04e8b0d18ba612f6d90370966016784e6662d5",
      "old_mode": 33188,
      "old_path": "llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp",
      "new_id": "5a1ac5d662704aa8e46cea716025a968162e5441",
      "new_mode": 33188,
      "new_path": "llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp"
    },
    {
      "type": "modify",
      "old_id": "d9cc49fdad89c6439bc297a17f64f0f26bda85ba",
      "old_mode": 33188,
      "old_path": "llvm/lib/IR/DIBuilder.cpp",
      "new_id": "90da9f3acfe573866763b18535870a2f1a2f27af",
      "new_mode": 33188,
      "new_path": "llvm/lib/IR/DIBuilder.cpp"
    },
    {
      "type": "modify",
      "old_id": "83c1264aef12bfee6ce723af9f31115283d7671a",
      "old_mode": 33188,
      "old_path": "llvm/lib/IR/Verifier.cpp",
      "new_id": "2cfd3822ea05d3c554444169e4ac14e5069aceaf",
      "new_mode": 33188,
      "new_path": "llvm/lib/IR/Verifier.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1c680b371bb8ffa09dd58d068b5fee053256a258",
      "new_mode": 33188,
      "new_path": "llvm/test/DebugInfo/Generic/multi-variant.ll"
    }
  ]
}
