There are a number of language and preprocessor options that are reset in the CompilerInvocation that describes the build of an implicit module. This patch uses the logic for explicit modules as well.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
7,360 ms | x64 debian > libarcher.races::task-dependency.c |
Event Timeline
clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template | ||
---|---|---|
4 | It looks to me like that this test would have passed before the code change, since there was already logic for dropping -include. Can you also add some other argument(s) that wouldn't have been dropped before, but will be now? | |
clang/test/ClangScanDeps/removed-args.c | ||
3 | Please add a comment here explaining what args are expected to be dropped and why, to help future readers to understand the testcase. |
Re-requesting review, since the test does cover the changes to ModuleDepCollector.cpp.
clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template | ||
---|---|---|
4 | Only the -include-pch argument was being dropped (PreprocessorOptions::ImplicitPCHInclude). The -include arguments (PreprocessorOptions::Includes) were being preserved. This test would not pass without the changes to ModuleDepCollector.cpp. I can add checks for other arguments that are being dropped now that weren't before, but assuming resetNonModularOptions are already being tested elsewhere, I don't think there's much value in that. | |
clang/test/ClangScanDeps/removed-args.c | ||
3 | Will do. |
clang/test/ClangScanDeps/Inputs/removed-args/cdb.json.template | ||
---|---|---|
4 | Note that the driver will expand -include <header> into -include-pch <header>.gch only if the PCH <header>.gch file exists. Since we're not precompiling the header in this particular test, that won't be the case. This argument therefore doesn't map onto PreprocessorOptions::ImplicitPCHInclude. It maps onto PreprocessorOptions::Includes. |
It looks to me like that this test would have passed before the code change, since there was already logic for dropping -include. Can you also add some other argument(s) that wouldn't have been dropped before, but will be now?