[clang-tools-extra] [clang-doc] Add helpers for Template config (PR #138062)

Daniel Thornburgh via cfe-commits cfe-commits at lists.llvm.org
Tue May 20 14:13:38 PDT 2025


================
@@ -74,7 +75,51 @@ static std::unique_ptr<MustacheTemplateFile> NamespaceTemplate = nullptr;
 
 static std::unique_ptr<MustacheTemplateFile> RecordTemplate = nullptr;
 
+static Error
+setupTemplate(std::unique_ptr<MustacheTemplateFile> &Template,
+              StringRef TemplatePath,
+              std::vector<std::pair<StringRef, StringRef>> Partials) {
+  auto T = MustacheTemplateFile::createMustacheFile(TemplatePath);
+  if (Error Err = T.takeError())
+    return Err;
+  Template = std::move(T.get());
+  for (const auto [Name, FileName] : Partials) {
----------------
mysterymath wrote:

nit: remove braces, as the `for` only contains a single statement

https://github.com/llvm/llvm-project/pull/138062


More information about the cfe-commits mailing list