<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/99479>99479</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [ScanDeps] ScanDeps shouldn't dependent on clangCodeGen
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:modules,
            clang:tooling
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ChuanqiXu9
      </td>
    </tr>
</table>

<pre>
    From https://github.com/llvm/llvm-project/pull/66462#pullrequestreview-2185579768, it shows that now `clangDependencyScanning` depends on `clangCodeGen`, which cause the size of clangd to be much larger.

I found the reason why `clangDependencyScanning` depends on `clangCodeGen` is that `DependencyScanningWorker.cpp` uses  `ObjectFilePCHContainerReader`: https://github.com/llvm/llvm-project/blob/b634e057ddecc41dce046887d0f0854fed305374/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp#L489-L490 

I am not sure about the use case of wrapping PCMs inside an object file. But it looks indeed odd that `clangDependencyScanning` depends on `clangCodeGen`. Is there any chance to get rid of that?

CC: @Bigcheese @jansvoboda11 @benlangmuir @akyrtzi 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVEuP2zYQ_jXUZbACRVGvgw67MtQGSNGgLdBeKXIsMUuTCh9rOL--oDabumguaS6mh5jhzPfQiBD0ahFH0jyR5lSIFDfnx2lLwn7Sf6WhWJy6jbN3F9hi3AOpHwmbCZtXHbe0lNJdCJuNeXk7HnbvPqKMhM17MoawuW15ywirc-jxU8IQPb5ovD6wqm-abujanrAJdISwuWuAuIkI1l2BtFQaYdcT7mgVWnn7XQprtV1JS0EdtwGc_Zo4OYU_oSUtzQ9eNy03kCIFhLghBP0ZwZ3hSFUQHSwIlyQ3MMKv6EtCT4Q-vv6-g7NLVh2FHkVwFq7b7UdGAv0FGmnpf8v_dP4ZfSn3PaemgAFy4q9LJnPWBj9MP0_ORqEt-t9QKPQZZv34_bosxi35aGuOtOmUQil5pSRS3vZ9p-iZ9g0_o6ppU3ecsPlAkh_SufAP54w-4m-w8K3LO2ysfs_74eE9Hyj8m25xAesihOQRxOJSPKjP2kkRDt2uXuy7tit8mH4JoG3QCkFYcAdHcNYGS3hKMTvJOPeccxSiAqfUV-b_r3olvMvyYZ7O3kBuwkrMHloxgtcqD5h7kHq-xzVNWSLC6ZNe5YYYMAcfhQ0vbnFKVFWOF7S52yVpn0PxfPPxs4ZCjbUa6kEUOFYdq2rKW9YW2ygXNsimVbLqBW-Yos1yVrggk1XDm0YVemSUcdpVfcUqytpSsEoOLe1bTpsOF0U4xYvQpszeKJ1fCx1CwnEYeDcURixowrEUGHsVv368OJUMBsIYYdPdfXyzA8sbxI-H25a0BsKp0SGGf3pEHc2xazLtJ9wDaU7w9j9__ckoS1gXv2iBNmY17qUokjfjd1v-ABcIm1_xvYzs7wAAAP__fa-hLA">