diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderHelper.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderHelper.java index c8a921e3b34..c7bffddfca2 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderHelper.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProviderHelper.java @@ -450,9 +450,7 @@ static CcToolchainProvider getCcToolchainProvider( return null; } - if (fdoMode != FdoMode.OFF - && fdoMode != FdoMode.XBINARY_FDO - && cppConfiguration.getXFdoProfileLabel() != null) { + if (fdoMode != FdoMode.XBINARY_FDO && cppConfiguration.getXFdoProfileLabel() != null) { ruleContext.throwWithRuleError("--xbinary_fdo cannot accept profile input other than *.xfdo"); } diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java index fb90fc7c4f4..c0e6f48e599 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java @@ -695,7 +695,7 @@ public static PackageIdentifier getMockCrosstoolsTop() { PathFragment.create(TestConstants.MOCK_CC_CROSSTOOL_PATH)); } catch (LabelSyntaxException e) { Verify.verify(false); - throw new AssertionError(e); + throw new AssertionError(); } } diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java index cde1dcd3e65..13204b9b4da 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java @@ -288,9 +288,8 @@ public void testCompilesDynamicModeTestSourcesWithoutFeatureIntoDynamicLibrary() } scratch.file( "x/BUILD", - "cc_test(name='a', srcs=['a.cc'], features=['-static_link_test_srcs'])", - "cc_binary(name='b', srcs=['a.cc'])", - "cc_test(name='c', srcs=['a.cc'], features=['-static_link_test_srcs'], linkstatic=1)"); + "cc_test(name = 'a', srcs = ['a.cc'], features = ['-static_link_test_srcs'])", + "cc_binary(name = 'b', srcs = ['a.cc'])"); scratch.file("x/a.cc", "int main() {}"); useConfiguration("--force_pic"); @@ -312,13 +311,6 @@ public void testCompilesDynamicModeTestSourcesWithoutFeatureIntoDynamicLibrary() runfilesProvider = configuredTarget.getProvider(RunfilesProvider.class); assertThat(artifactsToStrings(runfilesProvider.getDefaultRunfiles().getArtifacts())) .containsExactly("bin x/b"); - - configuredTarget = getConfiguredTarget("//x:c"); - linkAction = (CppLinkAction) getGeneratingAction(configuredTarget, "x/c"); - assertThat(artifactsToStrings(linkAction.getInputs())).contains("bin x/_objs/c/a.pic.o"); - runfilesProvider = configuredTarget.getProvider(RunfilesProvider.class); - assertThat(artifactsToStrings(runfilesProvider.getDefaultRunfiles().getArtifacts())) - .containsExactly("bin x/c"); } @Test @@ -413,7 +405,7 @@ public Action generate(ImmutableSet attributesToFlip) ? dynamicOutputFile : staticOutputFile, toolchain, - toolchain.getFdoContext(), + toolchain.getFdoProvider(), featureConfiguration, MockCppSemantics.INSTANCE) {}; if (attributesToFlip.contains(NonStaticAttributes.OUTPUT_FILE)) { @@ -471,7 +463,7 @@ public Action generate(ImmutableSet attributes) ? staticOutputFile : dynamicOutputFile, toolchain, - toolchain.getFdoContext(), + toolchain.getFdoProvider(), featureConfiguration, MockCppSemantics.INSTANCE) {}; builder.setLinkType( @@ -503,7 +495,7 @@ public void testCommandLineSplitting() throws Exception { ruleContext, output, toolchain, - toolchain.getFdoContext(), + toolchain.getFdoProvider(), FeatureConfiguration.EMPTY, MockCppSemantics.INSTANCE); builder.setLinkType(LinkTargetType.STATIC_LIBRARY); @@ -597,7 +589,7 @@ private CppLinkActionBuilder createLinkBuilder( .getBinDirectory(ruleContext.getRule().getRepository())), ruleContext.getConfiguration(), toolchain, - toolchain.getFdoContext(), + toolchain.getFdoProvider(), featureConfiguration, MockCppSemantics.INSTANCE) .addObjectFiles(nonLibraryInputs) diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/LinkBuildVariablesTest.java b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/LinkBuildVariablesTest.java index be3139341c5..8699f4dbe47 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/LinkBuildVariablesTest.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/test/java/com/google/devtools/build/lib/rules/cpp/LinkBuildVariablesTest.java @@ -388,7 +388,7 @@ private void assertStripBinaryVariableIsPresent( } @Test - public void testIsUsingFissionVariableUsingLegacyFields() throws Exception { + public void testIsUsingFissionVariable() throws Exception { scratch.file("x/BUILD", "cc_binary(name = 'foo', srcs = ['foo.cc'])"); scratch.file("x/foo.cc"); @@ -411,29 +411,6 @@ public void testIsUsingFissionVariableUsingLegacyFields() throws Exception { .isTrue(); } - @Test - public void testIsUsingFissionVariable() throws Exception { - scratch.file("x/BUILD", "cc_binary(name = 'foo', srcs = ['foo.cc'])"); - scratch.file("x/foo.cc"); - - AnalysisMock.get() - .ccSupport() - .setupCrosstool(mockToolsConfig, MockCcSupport.PER_OBJECT_DEBUG_INFO_CONFIGURATION); - - useConfiguration("--fission=no"); - ConfiguredTarget target = getConfiguredTarget("//x:foo"); - CcToolchainVariables variables = getLinkBuildVariables(target, LinkTargetType.EXECUTABLE); - assertThat(variables.isAvailable(LinkBuildVariables.IS_USING_FISSION.getVariableName())) - .isFalse(); - - useConfiguration("--fission=yes"); - ConfiguredTarget fissionTarget = getConfiguredTarget("//x:foo"); - CcToolchainVariables fissionVariables = - getLinkBuildVariables(fissionTarget, LinkTargetType.EXECUTABLE); - assertThat(fissionVariables.isAvailable(LinkBuildVariables.IS_USING_FISSION.getVariableName())) - .isTrue(); - } - @Test public void testSysrootVariable() throws Exception { AnalysisMock.get()