diff options
author | Lukacs Berki <lberki@google.com> | 2016-05-20 14:34:16 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-05-20 14:42:50 +0000 |
commit | 90d30e575bea52c4e5eb8db9c9b7e67c6673315d (patch) | |
tree | 9d8b3f7cd78f652b6199dbf3fe269ed73aaa038e /src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | |
parent | d5512bf8cfbf7a13bcedec691f5cc5d5b6d0a7c5 (diff) |
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
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java | 15 |
1 files changed, 0 insertions, 15 deletions
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<? extends CppCompileActionContext> actionContext, ImmutableList<String> copts, Predicate<String> coptsFilter, - @Nullable String fdoBuildStamp, SpecialInputsHandler specialInputsHandler, Iterable<IncludeScannable> 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<String> 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 |