diff options
author | 2017-02-06 16:15:47 +0000 | |
---|---|---|
committer | 2017-02-06 19:35:56 +0000 | |
commit | 6937ebde95280623855a36928bf45e247094c672 (patch) | |
tree | 241583f81ef1ba535526a7a3b42f257184a7e223 /src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java | |
parent | 5980e602194c82fca4fd7495d773663bed686cad (diff) |
Create FDO stub actions during the analysis of the cc_toolchain rule for the optimized configuration instead of for every single cc_library rule that compiles optimized code.
This makes Blaze create many less FDO stub actions and almost always makes them non-shared.
--
PiperOrigin-RevId: 146665855
MOS_MIGRATED_REVID=146665855
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java index f97621421a..849b9c805e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/FdoSupportProvider.java @@ -13,8 +13,11 @@ // limitations under the License. package com.google.devtools.build.lib.rules.cpp; +import com.google.common.collect.ImmutableMap; +import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.vfs.PathFragment; /** * A {@link TransitiveInfoProvider} so that {@code cc_toolchain} can pass {@link FdoSupport} to the @@ -23,12 +26,35 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; @Immutable public class FdoSupportProvider implements TransitiveInfoProvider { private final FdoSupport fdoSupport; + private final Artifact profileArtifact; + // We *probably* don't need both an AutoFDO profile artifact and a profile artifact. However, + // the decision whether to make the latter seems to depend on the feature configuration of the + // eventual cc_binary rule, which we don't have in cc_toolchain, so we just create both because + // one extra artifact doesn't harm anyone. + private final Artifact autoProfileArtifact; + private final ImmutableMap<PathFragment, Artifact> gcdaArtifacts; - public FdoSupportProvider(FdoSupport fdoSupport) { + public FdoSupportProvider(FdoSupport fdoSupport, Artifact profileArtifact, + Artifact autoProfileArtifact, ImmutableMap<PathFragment, Artifact> gcdaArtifacts) { this.fdoSupport = fdoSupport; + this.profileArtifact = profileArtifact; + this.autoProfileArtifact = autoProfileArtifact; + this.gcdaArtifacts = gcdaArtifacts; } public FdoSupport getFdoSupport() { return fdoSupport; } + + public Artifact getProfileArtifact() { + return profileArtifact; + } + + public Artifact getAutoProfileArtifact() { + return autoProfileArtifact; + } + + public ImmutableMap<PathFragment, Artifact> getGcdaArtifacts() { + return gcdaArtifacts; + } } |