summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine/base_maps/expression_function.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-04 10:13:17 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-05 14:48:26 +0200
commit427b6e4e83486858b1ab160c75e2754ba173eebe (patch)
treea8f46108ab2796ea56eac847f0f5bc8d9e3fbefe /src/buildtool/build_engine/base_maps/expression_function.hpp
parente704f5a976809eaf76f2d1b29616c24a15a113ed (diff)
downloadjustbuild-427b6e4e83486858b1ab160c75e2754ba173eebe.tar.gz
Evaluator: Add infrastructure to annotate relevant objects
... which are, in particular, artifacts involved in staging conflicts. While there, also make disjoint union honor the expression log limit.
Diffstat (limited to 'src/buildtool/build_engine/base_maps/expression_function.hpp')
-rw-r--r--src/buildtool/build_engine/base_maps/expression_function.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildtool/build_engine/base_maps/expression_function.hpp b/src/buildtool/build_engine/base_maps/expression_function.hpp
index 41e6ad83..a5235807 100644
--- a/src/buildtool/build_engine/base_maps/expression_function.hpp
+++ b/src/buildtool/build_engine/base_maps/expression_function.hpp
@@ -51,11 +51,13 @@ class ExpressionFunction {
[](std::string const& error) noexcept -> void {
Logger::Log(LogLevel::Error, error);
},
+ std::function<std::string(ExpressionPtr)> annotate_object =
+ [](auto const& /*unused*/) { return std::string{}; },
std::function<void(void)> const& note_user_context =
[]() noexcept -> void {}) const noexcept -> ExpressionPtr {
try { // try-catch to silence clang-tidy's bugprone-exception-escape,
// only imports_caller can throw but it is not called here.
- auto imports_caller = [this, &functions](
+ auto imports_caller = [this, &functions, &annotate_object](
SubExprEvaluator&& /*eval*/,
ExpressionPtr const& expr,
Configuration const& env) {
@@ -69,6 +71,7 @@ class ExpressionFunction {
env,
functions,
[&ss](auto const& msg) { ss << msg; },
+ annotate_object,
[&user_context]() { user_context = true; }
);
@@ -94,6 +97,7 @@ class ExpressionFunction {
FunctionMap::MakePtr(
functions, "CALL_EXPRESSION", imports_caller),
logger,
+ annotate_object,
note_user_context);
} catch (...) {
EnsuresAudit(false); // ensure that the try-block never throws