diff options
author | 2018-07-24 13:54:14 -0700 | |
---|---|---|
committer | 2018-07-24 13:55:37 -0700 | |
commit | fe187cb2d5dde1448500201eb762b161a5fa238e (patch) | |
tree | 3b9220b57f6ae0a693cf07f5ca1029b185a420e9 /src/main/java/com/google/devtools/build/lib/rules/cpp | |
parent | 59b044c123b08c89c1c86532deec0500fb93db9b (diff) |
Automated rollback of commit 6f1915114ec7af104a2649a454cc1519ce7806bf.
*** Reason for rollback ***
Crash with NullPointerException
*** Original change description ***
C++: Remove AbstractCcLinkParamsStore from providers.
3 providers had AbstractCcLinkParamsStore as a class field, now they wrap
CcLinkingInfo instead.
RELNOTES:none
PiperOrigin-RevId: 205885939
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java | 10 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java | 14 |
2 files changed, 2 insertions, 22 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java index 871def83e3..36aca5f7df 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java @@ -886,16 +886,6 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory { ccCompilationInfoBuilder.setCcCompilationContext(ccCompilationContext); CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create(); - // TODO(b/111289526): Remove CcLinkingInfo provider from cc_binary as soon as the flag - // --experimental_enable_cc_dynlibs_for_runtime is flipped. An empty CcLinkParamsStore is not - // needed, but here we set it to avoid a null pointer exception in places where we're expecting - // it. In the future CcLinkParamsStore will be obligatory. - ccLinkingInfoBuilder.setCcLinkParamsStore( - new CcLinkParamsStore( - /* staticModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY, - /* staticModeParamsForExecutable= */ CcLinkParams.EMPTY, - /* dynamicModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY, - /* dynamicModeParamsForExecutable= */ CcLinkParams.EMPTY)); if (cppConfiguration.enableCcDynamicLibrariesForRuntime()) { ccLinkingInfoBuilder.setCcDynamicLibrariesForRuntime( new CcDynamicLibrariesForRuntime( diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java index a8a27515af..21494f7765 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java @@ -30,7 +30,6 @@ import com.google.devtools.build.lib.syntax.FunctionSignature; import com.google.devtools.build.lib.syntax.Runtime; import com.google.devtools.build.lib.syntax.SkylarkType; import java.util.Collection; -import java.util.stream.Stream; import javax.annotation.Nullable; /** Wrapper for every C++ linking provider. */ @@ -111,16 +110,6 @@ public final class CcLinkingInfo extends NativeInfo implements CcLinkingInfoApi } }; - public static final CcLinkingInfo EMPTY = - CcLinkingInfo.Builder.create() - .setCcLinkParamsStore( - new CcLinkParamsStore( - /* staticModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY, - /* staticModeParamsForExecutable= */ CcLinkParams.EMPTY, - /* dynamicModeParamsForDynamicLibrary= */ CcLinkParams.EMPTY, - /* dynamicModeParamsForExecutable= */ CcLinkParams.EMPTY)) - .build(); - private final CcLinkParamsStore ccLinkParamsStore; // TODO(b/111289526): These providers are not useful. All the information they provide can be // obtained from CcLinkParams. CcRunfiles is already dead code and can be removed. @@ -169,7 +158,8 @@ public final class CcLinkingInfo extends NativeInfo implements CcLinkingInfoApi CcLinkingInfo.Builder builder = new CcLinkingInfo.Builder(); builder.setCcLinkParamsStore( CcLinkParamsStore.merge( - Stream.concat(Stream.of(CcLinkingInfo.EMPTY), ccLinkingInfos.stream()) + ccLinkingInfos + .stream() .map(CcLinkingInfo::getCcLinkParamsStore) .collect(ImmutableList.toImmutableList()))); return builder.build(); |