summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine/target_map/target_map.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-02-28 13:24:26 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-03-01 10:46:54 +0100
commit1ef03a1c7043d617885d319b0803d69907c3c9cc (patch)
treeacfcd33dab8e2355863356af88d14ac6e3578b2d /src/buildtool/build_engine/target_map/target_map.cpp
parentfffee539ec37e9e68189e71994aa2c901d30c9fb (diff)
downloadjustbuild-1ef03a1c7043d617885d319b0803d69907c3c9cc.tar.gz
Pass actions and trees in analysis result as shared pointer
... to avoid unnecessary copying and moving of larger objects.
Diffstat (limited to 'src/buildtool/build_engine/target_map/target_map.cpp')
-rw-r--r--src/buildtool/build_engine/target_map/target_map.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/buildtool/build_engine/target_map/target_map.cpp b/src/buildtool/build_engine/target_map/target_map.cpp
index 327dbe02..159669b7 100644
--- a/src/buildtool/build_engine/target_map/target_map.cpp
+++ b/src/buildtool/build_engine/target_map/target_map.cpp
@@ -302,9 +302,9 @@ void withDependencies(
// Evaluate main expression
auto expression_config = key.config.Prune(config_vars);
- std::vector<ActionDescription> actions{};
+ std::vector<ActionDescription::Ptr> actions{};
std::vector<std::string> blobs{};
- std::vector<Tree> trees{};
+ std::vector<Tree::Ptr> trees{};
auto main_exp_fcts = FunctionMap::MakePtr(
{{"FIELD",
[&params](auto&& eval, auto const& expr, auto const& env) {
@@ -496,7 +496,7 @@ void withDependencies(
may_fail,
no_cache,
inputs_exp);
- auto action_id = action.Id();
+ auto action_id = action->Id();
actions.emplace_back(std::move(action));
for (auto const& out : outputs) {
result.emplace(out,
@@ -566,8 +566,8 @@ void withDependencies(
throw Evaluator::EvaluationError{
fmt::format("TREE conflicts on subtree {}", *conflict)};
}
- auto tree = Tree{std::move(artifacts)};
- auto tree_id = tree.Id();
+ auto tree = std::make_shared<Tree>(std::move(artifacts));
+ auto tree_id = tree->Id();
trees.emplace_back(std::move(tree));
return ExpressionPtr{ArtifactDescription{tree_id}};
}},