diff options
author | gregce <gregce@google.com> | 2018-01-16 13:04:56 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-16 13:06:21 -0800 |
commit | 47ef92d437972aee06ab2caff2cb12cd617adc9a (patch) | |
tree | 41008957feccdf3d3473402957a8e0855d97d26a /src/main/java/com/google/devtools/build/lib/analysis/config/transitions | |
parent | 225b57bfbb74a62a3212c7013ef92ce95ceaf79e (diff) |
Remove ConfigurationTransitionProxy.NULL
PiperOrigin-RevId: 182099803
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/config/transitions')
2 files changed, 36 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransitionProxy.java b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransitionProxy.java index 3df17bf1af..6a19b36fbb 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransitionProxy.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ConfigurationTransitionProxy.java @@ -25,9 +25,6 @@ public enum ConfigurationTransitionProxy implements Transition { /** No transition, i.e., the same configuration as the current. */ NONE, - /** Transition to a null configuration (applies to, e.g., input files). */ - NULL, - /** Transition from the target configuration to the data configuration. */ // TODO(bazel-team): Move this elsewhere. DATA, diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java new file mode 100644 index 0000000000..2edbb9fb0f --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/NullTransition.java @@ -0,0 +1,36 @@ +// Copyright 2018 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.lib.analysis.config.transitions; + +import com.google.devtools.build.lib.analysis.config.BuildOptions; + +/** + * A {@link PatchTransition} to a null configuration. + */ +public class NullTransition implements PatchTransition { + + public static final NullTransition INSTANCE = new NullTransition(); + + private NullTransition() { + } + + @Override + public BuildOptions apply(BuildOptions options) { + throw new UnsupportedOperationException( + "This is only referenced in a few places, so it's easier and more efficient to optimize " + + "Blaze's transition logic in the presence of null transitions vs. actually call this " + + "method to get results we know ahead of time. If there's ever a need to properly " + + "implement this method we can always do so."); + } +} |