Looking for help with accessing LangOpts from the actual compiler invocation

@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::ensureDirectiveTokensArePopulated which is called by DependencyScanningAction::runInvocation which 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.