)]}'
{
  "commit": "84f431c35b3fbd5b9c46608689f25a5d29bc0f55",
  "tree": "d591e54a9aa323d3924aadc97cc193b6350d3148",
  "parents": [
    "e5db36b604db35efe3bd3930a1f3a31bf30ef5ec"
  ],
  "author": {
    "name": "Peter Rong",
    "email": "peterrong96@gmail.com",
    "time": "Fri Sep 12 10:33:53 2025 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Sep 12 10:33:53 2025 -0700"
  },
  "message": "[DebugLine] Correct debug line emittion (#157529)\n\n### Context\n\n#99710 introduced `.loc_label` so we can terminate a line sequence.\nHowever, it did not advance PC properly. This is problematic for\n1-instruction functions as it will have zero-length sequence. The test\nchecked in that PR shows the problem:\n\n```\n# CHECK-LINE-TABLE:                  Address            Line   Column File   ISA Discriminator OpIndex Flags\n# CHECK-LINE-TABLE-NEXT:             ------------------ ------ ------ ------ --- ------------- ------- -------------\n# CHECK-LINE-TABLE-NEXT: 0x00000028: 05 DW_LNS_set_column (1)\n# CHECK-LINE-TABLE-NEXT: 0x0000002a: 00 DW_LNE_set_address (0x0000000000000000)\n# CHECK-LINE-TABLE-NEXT: 0x00000035: 01 DW_LNS_copy\n# CHECK-LINE-TABLE-NEXT:             0x0000000000000000      1      1      1   0             0       0  is_stmt\n# CHECK-LINE-TABLE-NEXT: 0x00000036: 00 DW_LNE_end_sequence\n# CHECK-LINE-TABLE-NEXT:             0x0000000000000000      1      1      1   0             0       0  is_stmt end_sequence\n```\n\nBoth rows having PC 0x0 is incorrect, and parsers won\u0027t be able to parse\nthem. See more explanation why this is wrong in #154851.\n\n### Design\n\nThis PR attempts to fix this by advancing the PC to the next available\nLabel, and advance to the end of the section if no Label is available.\n\n### Implementation\n\n- `emitDwarfLineEndEntry` will advance PC to the `CurrLabel`\n- If `CurrLabel` is null, its probably a fake LineEntry we introduced in\n#110192. In that case look for the next Label\n- If still not label can be found, use `null` and\n`emitDwarfLineEndEntry` is smart enough to advance PC to the end of the\nsection\n- Rename `LastLabel` to `PrevLabel`, \"last\" can mean \"previous\" or\n\"final\", this is ambigous.\n- Updated the tests to emit a correct label.\n\n### Note\n\nThis fix should render #154986 and #154851 obsolete, they were temporary\nfixes and don\u0027t resolve the root cause.\n\n---------\n\nSigned-off-by: Peter Rong \u003cPeterRong@meta.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e7c0d37e8f99b2272c6f81641e609b8121f94893",
      "old_mode": 33188,
      "old_path": "llvm/lib/MC/MCDwarf.cpp",
      "new_id": "e8f000a584839c8db7f5f8b22f7714245db6c7fc",
      "new_mode": 33188,
      "new_path": "llvm/lib/MC/MCDwarf.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f0874bfc45ed2b9a40deb8989fc170678fee5ddc",
      "new_mode": 33188,
      "new_path": "llvm/test/DebugInfo/ARM/stmt_seq_macho.test"
    },
    {
      "type": "modify",
      "old_id": "58f6495924b90cec4b357e8bc65570ba9451cf79",
      "old_mode": 33188,
      "old_path": "llvm/test/DebugInfo/X86/DW_AT_LLVM_stmt_seq_sec_offset.ll",
      "new_id": "f17c6e5429b6be605f917b79375746c9bc159c76",
      "new_mode": 33188,
      "new_path": "llvm/test/DebugInfo/X86/DW_AT_LLVM_stmt_seq_sec_offset.ll"
    },
    {
      "type": "modify",
      "old_id": "6b5d04777bef4fbed7fbcfdf15fd6bcc608912c2",
      "old_mode": 33188,
      "old_path": "llvm/test/MC/ELF/debug-loc-label.s",
      "new_id": "4200b1192107bd1dfc47b6667a327aa85dfeb8ab",
      "new_mode": 33188,
      "new_path": "llvm/test/MC/ELF/debug-loc-label.s"
    }
  ]
}
