aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2017-09-19 15:42:58 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-09-19 17:17:56 +0200
commit6434af053cfffa38909bc86afe69e33b573b6179 (patch)
treecb6ca52ddada1f718089d4ff2e21d5d3eb79eee3 /src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
parente85b5a7a7c4968ff3451573b4b8ca2a52a3e9961 (diff)
Do not duplicate build variables, reuse variables from cc toolchain
Before this cl each linking and compilation action would contain a full copy of all build variables. However, some build variables can be reused, for the memory consumption benefit. With this cl, we contruct a Variables instance in the CcToolchain, and make it a parent of all per-linking and per-compilation variables. RELNOTES: None. PiperOrigin-RevId: 169233756
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
index 4d4a6c9286..c171c9fe01 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
@@ -397,8 +397,7 @@ public final class LinkCommandLine extends CommandLine {
argv.addAll(
featureConfiguration.getCommandLine(
actionName,
- new Variables.Builder()
- .addAll(variables)
+ new Variables.Builder(variables)
.addStringSequenceVariable(
CppLinkActionBuilder.LEGACY_LINK_FLAGS_VARIABLE, getToolchainFlags())
.build()));