From 90d30e575bea52c4e5eb8db9c9b7e67c6673315d Mon Sep 17 00:00:00 2001 From: Lukacs Berki Date: Fri, 20 May 2016 14:34:16 +0000 Subject: Move the command line arguments for C++ preprocessor defines to a feature. This required a few assorted changes: - The FDO build stamp is not special-cased anymore, it is treated as a preprocessor define like any other. - When compiling a .pcm file, use interfaceContext instead of the regular context when setting up the build variables. This is a bit more consistent and would be a good cause for a future bug. This is a retry of commit 7841a6ab100fc35a67600f1ce1a70d293c51350e, which made some bold changes to LIPO that didn't work out well. -- MOS_MIGRATED_REVID=122829825 --- .../devtools/build/lib/rules/cpp/CppCompileAction.java | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java index f3f024d5e3..167f59268f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java @@ -251,7 +251,6 @@ public class CppCompileAction extends AbstractAction Class actionContext, ImmutableList copts, Predicate coptsFilter, - @Nullable String fdoBuildStamp, SpecialInputsHandler specialInputsHandler, Iterable lipoScannables, UUID actionClassId, @@ -292,7 +291,6 @@ public class CppCompileAction extends AbstractAction features, featureConfiguration, variables, - fdoBuildStamp, actionName); this.actionContext = actionContext; this.lipoScannables = lipoScannables; @@ -1267,9 +1265,6 @@ public class CppCompileAction extends AbstractAction @VisibleForTesting public final CcToolchainFeatures.Variables variables; private final String actionName; - // The value of the BUILD_FDO_TYPE macro to be defined on command line - @Nullable private final String fdoBuildStamp; - public CppCompileCommandLine( Artifact sourceFile, DotdFile dotdFile, @@ -1279,7 +1274,6 @@ public class CppCompileAction extends AbstractAction Collection features, FeatureConfiguration featureConfiguration, CcToolchainFeatures.Variables variables, - @Nullable String fdoBuildStamp, String actionName) { this.sourceFile = Preconditions.checkNotNull(sourceFile); this.dotdFile = CppFileTypes.mustProduceDotdFile(sourceFile.getPath().toString()) @@ -1290,7 +1284,6 @@ public class CppCompileAction extends AbstractAction this.features = Preconditions.checkNotNull(features); this.featureConfiguration = featureConfiguration; this.variables = variables; - this.fdoBuildStamp = fdoBuildStamp; this.actionName = actionName; } @@ -1340,14 +1333,6 @@ public class CppCompileAction extends AbstractAction for (String warn : cppConfiguration.getCWarns()) { options.add("-W" + warn); } - for (String define : context.getDefines()) { - options.add("-D" + define); - } - - // Stamp FDO builds with FDO subtype string - if (fdoBuildStamp != null) { - options.add("-D" + CppConfiguration.FDO_STAMP_MACRO + "=\"" + fdoBuildStamp + "\""); - } // TODO(bazel-team): This needs to be before adding getUnfilteredCompilerOptions() and after // adding the warning flags until all toolchains are migrated; currently toolchains use the -- cgit v1.2.3