From 427b6e4e83486858b1ab160c75e2754ba173eebe Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 4 Apr 2024 10:13:17 +0200 Subject: 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. --- src/buildtool/build_engine/base_maps/expression_function.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/buildtool/build_engine/base_maps/expression_function.hpp') 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 annotate_object = + [](auto const& /*unused*/) { return std::string{}; }, std::function 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 -- cgit v1.2.3