Since system modules don't emit most warnings, remove the warning
flags to increase module reuse.
Details
- Reviewers
jansvoboda11 ributzka
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/ClangScanDeps/optimize-system-warnings.m | ||
---|---|---|
19 | I'd like to see a check line that would fail if the scanner reports another variant of module A. The CHECK: lines make it possible for FileCheck to skip an entire element in the modules array. (Structural matching on JSON in FileCheck would be a godsend.) | |
30 | I'd expect the scanner to still produce two variants of module B, since it's a user module. Is that correct? If so, let's add explicit check for it, since we intentionally want to preserve the warning flags there. |
clang/test/ClangScanDeps/optimize-system-warnings.m | ||
---|---|---|
19 | The way FileCheck works I do not believe this can happen. A CHECK: line finds the first line that matches, and CHECK-NEXT: follows exactly after that. There's no case where we have a CHECK: that can skip over another entire module entry. | |
30 | Both A and B are system modules. A is found via -isystem, and B has the [system] attribute. The FileCheck lines will only succeed if there are exactly two modules returned. |
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp | ||
---|---|---|
50 | This removes also all warnings when building your own module, because of the [system] attribute. I would prefer this optimization to be limited to modules that are in the sysroot and therefore ignore the [system] attribute. |
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp | ||
---|---|---|
50 | This is not really simple to do. We don't track why a module is a system module, and it's not really correct to do a string based match on the path for if it's from a system directory. |
This removes also all warnings when building your own module, because of the [system] attribute. I would prefer this optimization to be limited to modules that are in the sysroot and therefore ignore the [system] attribute.