aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java3
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java23
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionNames.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java5
-rw-r--r--src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java15
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java13
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java1
9 files changed, 10 insertions, 60 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
index 1ddb027b6c..451d40020c 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
@@ -115,7 +115,6 @@ public final class CcCommon {
CppActionNames.C_COMPILE,
CppActionNames.CPP_COMPILE,
CppActionNames.CPP_HEADER_PARSING,
- CppActionNames.CPP_HEADER_PREPROCESSING,
CppActionNames.CPP_MODULE_COMPILE,
CppActionNames.CPP_MODULE_CODEGEN,
CppActionNames.ASSEMBLE,
@@ -829,7 +828,6 @@ public final class CcCommon {
// TODO(bazel-team): Remove once supports_header_parsing has been removed from the
// cc_toolchain rule.
unsupportedFeaturesBuilder.add(CppRuleClasses.PARSE_HEADERS);
- unsupportedFeaturesBuilder.add(CppRuleClasses.PREPROCESS_HEADERS);
}
if (toolchain.getCcCompilationInfo().getCcCompilationContext().getCppModuleMap() == null) {
unsupportedFeaturesBuilder.add(CppRuleClasses.MODULE_MAPS);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java
index f8cd4d6b46..b20c61a632 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java
@@ -293,8 +293,7 @@ public final class CcToolchainProvider extends ToolchainInfo implements CcToolch
// If parse_headers_verifies_modules is switched on, we verify that headers are
// self-contained by building the module instead.
return !cppConfiguration.getParseHeadersVerifiesModules()
- && (featureConfiguration.isEnabled(CppRuleClasses.PREPROCESS_HEADERS)
- || featureConfiguration.isEnabled(CppRuleClasses.PARSE_HEADERS));
+ && featureConfiguration.isEnabled(CppRuleClasses.PARSE_HEADERS);
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
index e933ae382c..f030f7cbbf 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java
@@ -142,19 +142,6 @@ public class CppActionConfigs {
" implies: 'compiler_output_flags'",
"}",
"action_config {",
- " config_name: 'c++-header-preprocessing'",
- " action_name: 'c++-header-preprocessing'",
- " tool {",
- " tool_path: '" + gccToolPath + "'",
- " }",
- " implies: 'legacy_compile_flags'",
- " implies: 'user_compile_flags'",
- " implies: 'sysroot'",
- " implies: 'unfiltered_compile_flags'",
- " implies: 'compiler_input_flags'",
- " implies: 'compiler_output_flags'",
- "}",
- "action_config {",
" config_name: 'c++-module-compile'",
" action_name: 'c++-module-compile'",
" tool {",
@@ -193,7 +180,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'c++-module-codegen'",
" action: 'lto-backend'",
@@ -230,7 +216,6 @@ public class CppActionConfigs {
" action: 'c++-module-compile'",
" action: 'objc-compile'",
" action: 'objc++-compile'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-header-parsing'",
" action: 'clif-match'",
" expand_if_all_available: 'dependency_file'",
@@ -305,7 +290,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'clif-match'",
" flag_group {",
@@ -325,7 +309,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'clif-match'",
" action: 'objc-compile'",
@@ -348,7 +331,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'clif-match'",
" action: 'objc-compile'",
@@ -1052,7 +1034,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'c++-module-codegen'",
" action: 'lto-backend'",
@@ -1074,7 +1055,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
@@ -1104,7 +1084,6 @@ public class CppActionConfigs {
" action: 'c-compile'",
" action: 'c++-compile'",
" action: 'c++-header-parsing'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-module-compile'",
" action: 'c++-module-codegen'",
" action: 'lto-backend'",
@@ -1151,7 +1130,6 @@ public class CppActionConfigs {
" action: 'c++-module-codegen'",
" action: 'objc-compile'",
" action: 'objc++-compile'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-header-parsing'",
" action: 'lto-backend'",
" expand_if_all_available: 'source_file'",
@@ -1176,7 +1154,6 @@ public class CppActionConfigs {
" action: 'c++-module-codegen'",
" action: 'objc-compile'",
" action: 'objc++-compile'",
- " action: 'c++-header-preprocessing'",
" action: 'c++-header-parsing'",
" action: 'lto-backend'",
" flag_group {",
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionNames.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionNames.java
index 1f2c749a5a..6547219ff2 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionNames.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionNames.java
@@ -34,8 +34,6 @@ public class CppActionNames {
public static final String OBJCPP_COMPILE = "objc++-compile";
/** A string constant for the c++ header parsing. */
public static final String CPP_HEADER_PARSING = "c++-header-parsing";
- /** A string constant for the c++ header preprocessing. */
- public static final String CPP_HEADER_PREPROCESSING = "c++-header-preprocessing";
/**
* A string constant for the c++ module compilation action. Note: currently we don't support C
* module compilation.
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java
index 994e8ba999..b2be52f504 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java
@@ -193,13 +193,9 @@ public class CppCompileActionBuilder {
if (!cppConfiguration.getParseHeadersVerifiesModules()
&& featureConfiguration.isEnabled(CppRuleClasses.PARSE_HEADERS)) {
return CppActionNames.CPP_HEADER_PARSING;
- } else if (!cppConfiguration.getParseHeadersVerifiesModules()
- && featureConfiguration.isEnabled(CppRuleClasses.PREPROCESS_HEADERS)) {
- return CppActionNames.CPP_HEADER_PREPROCESSING;
} else {
// CcCommon.collectCAndCppSources() ensures we do not add headers to
- // the compilation artifacts unless either 'parse_headers' or
- // 'preprocess_headers' is set.
+ // the compilation artifacts unless 'parse_headers' is set.
throw new IllegalStateException();
}
} else if (CppFileTypes.C_SOURCE.matches(sourcePath)) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
index fc62f040b7..3cb9f29ea9 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java
@@ -122,11 +122,6 @@ public class CppRuleClasses {
public static final String PARSE_HEADERS = "parse_headers";
/**
- * A string constant for the preprocess_headers feature.
- */
- public static final String PREPROCESS_HEADERS = "preprocess_headers";
-
- /**
* A string constant for the module_maps feature; this is a precondition to the layering_check and
* header_modules features.
*/
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
index 6e22abb3fc..6fda1b5c93 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
@@ -80,10 +80,8 @@ public abstract class MockCcSupport {
+ " }"
+ "}";
- /**
- * A feature configuration snippet useful for testing header processing.
- */
- public static final String HEADER_PROCESSING_FEATURE_CONFIGURATION =
+ /** A feature configuration snippet useful for testing header processing. */
+ public static final String PARSE_HEADERS_FEATURE_CONFIGURATION =
""
+ "feature {"
+ " name: 'parse_headers'"
@@ -93,15 +91,6 @@ public abstract class MockCcSupport {
+ " flag: '<c++-header-parsing>'"
+ " }"
+ " }"
- + "}"
- + "feature {"
- + " name: 'preprocess_headers'"
- + " flag_set {"
- + " action: 'c++-header-preprocessing'"
- + " flag_group {"
- + " flag: '<c++-header-preprocessing>'"
- + " }"
- + " }"
+ "}";
/** A feature configuration snippet useful for testing the layering check. */
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
index 9505f052ff..0ceaee87c0 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
@@ -1078,7 +1078,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
public void testDoNotCompileSourceFilesInHeaders() throws Exception {
AnalysisMock.get()
.ccSupport()
- .setupCrosstool(mockToolsConfig, MockCcSupport.HEADER_PROCESSING_FEATURE_CONFIGURATION);
+ .setupCrosstool(mockToolsConfig, MockCcSupport.PARSE_HEADERS_FEATURE_CONFIGURATION);
useConfiguration("--features=parse_headers");
ConfiguredTarget x =
scratchConfiguredTarget("x", "x", "cc_library(name = 'x', hdrs = ['x.cc'])");
@@ -1089,7 +1089,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
public void testProcessHeadersInDependencies() throws Exception {
AnalysisMock.get()
.ccSupport()
- .setupCrosstool(mockToolsConfig, MockCcSupport.HEADER_PROCESSING_FEATURE_CONFIGURATION);
+ .setupCrosstool(mockToolsConfig, MockCcSupport.PARSE_HEADERS_FEATURE_CONFIGURATION);
useConfiguration("--features=parse_headers", "--process_headers_in_dependencies");
ConfiguredTarget x =
scratchConfiguredTarget(
@@ -1105,7 +1105,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
public void testProcessHeadersInDependenciesOfBinaries() throws Exception {
AnalysisMock.get()
.ccSupport()
- .setupCrosstool(mockToolsConfig, MockCcSupport.HEADER_PROCESSING_FEATURE_CONFIGURATION);
+ .setupCrosstool(mockToolsConfig, MockCcSupport.PARSE_HEADERS_FEATURE_CONFIGURATION);
useConfiguration("--features=parse_headers", "--process_headers_in_dependencies");
ConfiguredTarget x =
scratchConfiguredTarget(
@@ -1124,7 +1124,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
public void testDoNotProcessHeadersInDependencies() throws Exception {
AnalysisMock.get()
.ccSupport()
- .setupCrosstool(mockToolsConfig, MockCcSupport.HEADER_PROCESSING_FEATURE_CONFIGURATION);
+ .setupCrosstool(mockToolsConfig, MockCcSupport.PARSE_HEADERS_FEATURE_CONFIGURATION);
useConfiguration("--features=parse_headers");
ConfiguredTarget x =
scratchConfiguredTarget(
@@ -1140,7 +1140,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
public void testProcessHeadersInCompileOnlyMode() throws Exception {
AnalysisMock.get()
.ccSupport()
- .setupCrosstool(mockToolsConfig, MockCcSupport.HEADER_PROCESSING_FEATURE_CONFIGURATION);
+ .setupCrosstool(mockToolsConfig, MockCcSupport.PARSE_HEADERS_FEATURE_CONFIGURATION);
useConfiguration("--features=parse_headers", "--process_headers_in_dependencies");
ConfiguredTarget y =
scratchConfiguredTarget(
@@ -1497,8 +1497,7 @@ public class CcLibraryConfiguredTargetTest extends BuildViewTestCase {
public void testProcessedHeadersWithPicSharedLibsAndNoPicBinaries() throws Exception {
AnalysisMock.get()
.ccSupport()
- .setupCrosstool(mockToolsConfig,
- MockCcSupport.HEADER_PROCESSING_FEATURE_CONFIGURATION);
+ .setupCrosstool(mockToolsConfig, MockCcSupport.PARSE_HEADERS_FEATURE_CONFIGURATION);
useConfiguration("--features=parse_headers", "-c", "opt");
// Should not crash
scratchConfiguredTarget("a", "a", "cc_library(name='a', hdrs=['a.h'])");
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
index 1dffb0f870..37f32f1316 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLineTest.java
@@ -60,7 +60,6 @@ public class CompileCommandLineTest extends BuildViewTestCase {
CppActionNames.C_COMPILE,
CppActionNames.CPP_COMPILE,
CppActionNames.CPP_HEADER_PARSING,
- CppActionNames.CPP_HEADER_PREPROCESSING,
CppActionNames.CPP_MODULE_CODEGEN,
CppActionNames.CPP_MODULE_COMPILE));
}