diff options
author | 2015-03-18 20:35:04 +0000 | |
---|---|---|
committer | 2015-03-20 14:31:36 +0000 | |
commit | 5db7899dff5a6c05d5642da7914d5000159f0861 (patch) | |
tree | 978422ece14c9d1003d65ebf5d7641499a640d32 /src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java | |
parent | 4feb160bc00823d63942882904155d7dd6ebcae9 (diff) |
Make include scanning faster when a target has many include scannables.
Instead of repeatedly scanning all transitively required include scannables, do
one pass from all include scannables; this prevents us revisiting the common
transitive closure of the include scannables.
Additionally, only scan command line includes relatively to a main source file,
not relatively to all source files. This is better than what we had before, but
it's still not exactly right - we should actually scan the command line
includes relatively to the module map file ([]
Brings include scanning times for large TUs with modules down from ~60 seconds
to < 2 seconds.
--
MOS_MIGRATED_REVID=88963159
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java index 9c70090ac0..d1f89f9657 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/IncludeScannable.java @@ -68,8 +68,15 @@ public interface IncludeScannable { List<String> getCmdlineIncludes(); /** + * Returns the artifact relative to which the {@code getCmdlineIncludes()} should be interpreted. + */ + Artifact getMainIncludeScannerSource(); + + /** * Returns an immutable list of sources that the IncludeScanner should scan * for this action. + * + * <p>Must contain {@code getMainIncludeScannerSource()}. */ Collection<Artifact> getIncludeScannerSources(); |