diff options
author | 2016-09-29 01:01:57 +0000 | |
---|---|---|
committer | 2016-09-29 09:12:58 +0000 | |
commit | 9e26f0fe244075f583006049e5268146f1e2c5d5 (patch) | |
tree | 33a5debffee15d307473afa70ac194c467fe1e39 /src/main/java/com/google/devtools/build/lib/analysis | |
parent | 593dc52c067a87b14e431c85a6acf051fb35ce38 (diff) |
Optimize how null configurations get created and add test infrastructure for Bazel's dep configuration creation logic.
This essentially implements the following TODOs:
https://github.com/bazelbuild/bazel/blob/bc6045dcc8fa33d4241d231138020ac4bdecc14f/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java#L599
https://github.com/bazelbuild/bazel/blob/bc6045dcc8fa33d4241d231138020ac4bdecc14f/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java#L42
--
MOS_MIGRATED_REVID=134607049
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java index 7b89d6f142..e00a95edef 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java @@ -1742,7 +1742,13 @@ public final class BuildConfiguration { public Iterable<Dependency> getDependencies( Label label, ImmutableSet<AspectDescriptor> aspects) { return ImmutableList.of( - Dependency.withTransitionAndAspects(label, currentTransition, aspects)); + isNull() + // We can trivially set the final value for null-configured targets now. This saves + // us from having to recreate a new Dependency object for the final value later. Since + // there are lots of null-configured targets (e.g. all source files), this can add up + // over the course of a build. + ? Dependency.withNullConfiguration(label) + : Dependency.withTransitionAndAspects(label, currentTransition, aspects)); } } |