@pogo59 Thanks for the pointers. These were my conclusions too, but there was one item that I want some advice on.
It’s also used from lib/Tooling/DependencyScanning,
DependencyScanningWorkerFilesystem::ensureDirectiveTokensArePopulatedwhich is called byDependencyScanningAction::runInvocationwhich definitely has a CompilerInvocation.
ensureDirectiveTokensArePopulated API is on the DependencyScanningWorkerFilesystem class, which has filesystem like APIs, and so I am not sure if an API signature like DependencyScanningWorkerFilesystem::ensureDirectiveTokensArePopulated( EntryRef Ref, const LangOptions &LangOpts) would be okay?
I am not familiar with the DependencyScanningWorkerFilesystem class, its boundaries/design etc., and so I wasn’t sure if we can modify its ensureDirectiveTokensArePopulated API to take in a LangOpts arg.
As in, would it look a bit off to someone if they were to look at the header for DependencyScanningWorkerFilesystem and see that the ensureDirectiveTokensArePopulated API took a LangOpts specifically.