)]}'
{
  "commit": "f5fdd43b16192bb85beb43e6cfe8d5e12a3ba976",
  "tree": "c6c28b1fd89087edd48339bb4d0edecb93044934",
  "parents": [
    "a7672fee0fba5fd673bd17f91d421fc0a896cebc"
  ],
  "author": {
    "name": "Jan Svoboda",
    "email": "jan_svoboda@apple.com",
    "time": "Wed Oct 22 14:42:38 2025 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Oct 22 14:42:38 2025 -0700"
  },
  "message": "[clang] Refactor `ASTUnit::LoadFromASTFile()` (#164265)\n\nThis PR refactors `ASTUnit::LoadFromASTFile()` to be easier to follow.\nConceptually, it tries to read an AST file, adopt the serialized\noptions, and set up `Sema` and `ASTContext` to deserialize the AST file\ncontents on-demand.\n\nThe implementation of this used to be spread across an\n`ASTReaderListener` and the function in question. Figuring out what\nlistener method gets called when and how it\u0027s supposed to interact with\nthe rest of the functionality was very unclear. The `FileManager`\u0027s VFS\nwas being swapped-out during deserialization, the options were being\nadopted by `Preprocessor` and others just-in-time to pass `ASTReader`\u0027s\nvalidation checks, and the target was being initialized somewhere in\nbetween all of this. This lead to a very muddy semantics.\n\nThis PR splits `ASTUnit::LoadFromASTFile()` into three distinct steps:\n1. Read out the options from the AST file.\n2. Initialize objects from the VFS to the `ASTContext`.\n3. Load the AST file and hook it up with the compiler objects.\n\nThis should be much easier to understand, and I\u0027ve done my best to\nclearly document the remaining gotchas.\n\n(This was originally motivated by the desire to remove\n`FileManager::setVirtualFileSystem()` and make it impossible to swap out\nVFSs from underneath `FileManager` mid-compile.)",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d53b64a414ddcbd3ec65bb6c69d0792f5b2e0e3c",
      "old_mode": 33188,
      "old_path": "clang/lib/Frontend/ASTUnit.cpp",
      "new_id": "6cc7094846155e4d20ac528ce3ac0d4e9780b612",
      "new_mode": 33188,
      "new_path": "clang/lib/Frontend/ASTUnit.cpp"
    },
    {
      "type": "modify",
      "old_id": "8b3fd41adb465f9866eea0e250a8f1f62b6f346f",
      "old_mode": 33188,
      "old_path": "clang/lib/Serialization/ASTReader.cpp",
      "new_id": "c1b5cb730e4a4bfa87124883916ce24179815442",
      "new_mode": 33188,
      "new_path": "clang/lib/Serialization/ASTReader.cpp"
    }
  ]
}
