[clang-tools-extra] [clang-doc] Fix benchmark not compiling (PR #185065)
Erick Velez via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 6 09:47:32 PST 2026
https://github.com/evelez7 created https://github.com/llvm/llvm-project/pull/185065
CI didn't flag that the benchmark was using the outdated Ctx call after
when landing the Mustache MD patch since this benchmark isn't tested.
Also added missing libraries in CMake that prevented me from building
the benchmark locally.
>From c3ee7348eb717e9dc9b0eee510753000c9607a8d Mon Sep 17 00:00:00 2001
From: Erick Velez <erickvelez7 at gmail.com>
Date: Fri, 6 Mar 2026 09:44:37 -0800
Subject: [PATCH] [clang-doc] Fix benchmark not compiling
CI didn't flag that the benchmark was using the outdated Ctx call after
when landing the Mustache MD patch since this benchmark isn't tested.
Also added missing libraries in CMake that prevented me from building
the benchmark locally.
---
clang-tools-extra/clang-doc/benchmarks/CMakeLists.txt | 2 ++
clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/clang-tools-extra/clang-doc/benchmarks/CMakeLists.txt b/clang-tools-extra/clang-doc/benchmarks/CMakeLists.txt
index c3ae6fde8eeaf..055d443c38e31 100644
--- a/clang-tools-extra/clang-doc/benchmarks/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/benchmarks/CMakeLists.txt
@@ -15,4 +15,6 @@ target_link_libraries(ClangDocBenchmark
clangTooling
clangBasic
clangAST
+ clangFrontend
+ clangSerialization
)
diff --git a/clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp b/clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp
index 652000b15dc5f..e909fafed8c62 100644
--- a/clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp
+++ b/clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp
@@ -80,7 +80,7 @@ static void BM_Mapper_Scale(benchmark::State &State) {
tooling::InMemoryToolResults Results;
tooling::ExecutionContext ECtx(&Results);
ClangDocContext CDCtx(&ECtx, "test-project", false, "", "", "", "", "", {},
- Diags, false);
+ Diags, OutputFormatTy::json, false);
auto ActionFactory = doc::newMapperActionFactory(CDCtx);
std::unique_ptr<FrontendAction> Action = ActionFactory->create();
tooling::runToolOnCode(std::move(Action), Code, "test.cpp");
@@ -193,7 +193,7 @@ static void BM_JSONGenerator_Scale(benchmark::State &State) {
DiagnosticOptions DiagOpts;
DiagnosticsEngine Diags(DiagID, DiagOpts, new IgnoringDiagConsumer());
ClangDocContext CDCtx(nullptr, "test-project", false, "", "", "", "", "", {},
- Diags, false);
+ Diags, OutputFormatTy::json, false);
std::string Output;
llvm::raw_string_ostream OS(Output);
More information about the cfe-commits
mailing list