)]}'
{
  "commit": "c97feec3bbbe06910bea33ef183c6bf573dcac3c",
  "tree": "97ba7470ddd14e4fe9fded16791c184e2f08ed00",
  "parents": [
    "3e769415246e24048fe4113279f259aeb285a882"
  ],
  "author": {
    "name": "Nerixyz",
    "email": "nerixdev@outlook.de",
    "time": "Fri Jul 17 11:48:38 2026 +0200"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Fri Jul 17 02:50:41 2026 -0700"
  },
  "message": "[lldb][NativePDB] Use active bits for constant width (#196104)\n\nStatic constants with bit widths less than 16 (e.g. char/unsigned char)\nin classes were not available. These constants are still encoded with 16\nbits\n([here](https://github.com/llvm/llvm-project/blob/dd145eb8997878143f648a7601741f6409330963/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp#L341-L343))\neven though they only need less bits. When we tried to create an\ninitializer for them, we\u0027d check if the bit width (\u003d16) was small enough\nto fit into the target (\u003c16). This would fail.\n\nThis was a problem in the following code:\n```cpp\nstruct Foo {\n  // width(unsigned char) \u003d 8, but 255 was encoded and read as 16 bit\n  static constexpr unsigned char u8_max \u003d 255;\n};\n```\n\nThis PR fixes the issue by using `APSInt::getActiveBits` for unsigned\ntypes and `APSInt::getSignificantBits` for signed types. They get the\nnumber of bits required to encode the value. For example a constant 64\nwould need 7 bits in unsigned and 8 bits in signed types.\n\nGitOrigin-RevId: 6cafa889cd398ca70992e0df518b2414a2607327\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "84813ad677d1cad89114381375271b385d56a415",
      "old_mode": 33188,
      "old_path": "source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp",
      "new_id": "9840b976d27139a4f61d5d5b69e38c52f5ed9d6d",
      "new_mode": 33188,
      "new_path": "source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp"
    },
    {
      "type": "modify",
      "old_id": "4af8b658742b38d8c522af7d3df49d241c91e3ee",
      "old_mode": 33188,
      "old_path": "test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit",
      "new_id": "8af31b80eb67f2ebcc9f54ca97e48376d38074ff",
      "new_mode": 33188,
      "new_path": "test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit"
    },
    {
      "type": "modify",
      "old_id": "299dd0b02671dc0b36412327e0be457887aea64a",
      "old_mode": 33188,
      "old_path": "test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp",
      "new_id": "999d09bae9c6c1e21b20afb9aad4a16653f31908",
      "new_mode": 33188,
      "new_path": "test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e65618f9774ba6cb2067a0cf30c132595a298974",
      "new_mode": 33188,
      "new_path": "test/Shell/SymbolFile/NativePDB/static-class-constants.cpp"
    }
  ]
}
