Add hidden --dump-source-file-imports flag

This flag dumps all imports for each SourceFile after it's gone through
import resolution. It is only intended for testing purposes.
There are other ways to print imports, but they don't correspond 1:1 to
the imports actually resolved, which is a bit problematic when testing
implicit clang module imports.
This commit is contained in:
Henrik G. Olsson
2025-08-19 15:19:49 -07:00
parent ef1af64f40
commit 17c0e564e8
7 changed files with 435 additions and 0 deletions

View File

@@ -1730,6 +1730,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.DumpMacroExpansions = Args.hasArg(
OPT_dump_macro_expansions);
Opts.DumpSourceFileImports = Args.hasArg(
OPT_dump_source_file_imports);
if (const Arg *A = Args.getLastArg(OPT_debug_requirement_machine))
Opts.DebugRequirementMachine = A->getValue();