This patch tests the manual header search argument generation by performing a "parse, generate, parse" round-trip on each compiler invocation. This way, the manually written C++ code gets exercised by the suite of Clang's end-to-end tests. Moreover, this ensures people adding new command line options are forced to implement the generation as well, either via the TableGen marshalling infrastructure or manually in CompilerInvocation.
It makes sense to enable this only for assert builds, so that we don't perform useless work in release builds.
Depending on our roll-out strategy, we might create more patches like this for other groups of options and upstream the work one-by-one, or put all option groups into this patch and enable round-tripping for all of -cc1 in a single commit.
Please note this is a work-in-progress. Ideally, we'll be able to get rid of the duplicate methods (parseSimpleArgs, generateCC1CommandLine, AddAllArgsExcept) and the HeaderSearchOptSpecs array.
Depends on D94472.
clang-format not found in user's PATH; not linting file.