[all-commits] [llvm/llvm-project] f721cf: Reland Support for mustache templating language

Paul Kirth via All-commits all-commits at lists.llvm.org
Fri Mar 21 13:19:04 PDT 2025


  Branch: refs/heads/users/ilovepi/reland-mustache
  Home:   https://github.com/llvm/llvm-project
  Commit: f721cf323acb9a4ccce345262061f84df613bdaa
      https://github.com/llvm/llvm-project/commit/f721cf323acb9a4ccce345262061f84df613bdaa
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2025-03-21 (Fri, 21 Mar 2025)

  Changed paths:
    A llvm/include/llvm/Support/Mustache.h
    M llvm/lib/Support/CMakeLists.txt
    A llvm/lib/Support/Mustache.cpp
    M llvm/unittests/Support/CMakeLists.txt
    A llvm/unittests/Support/MustacheTest.cpp

  Log Message:
  -----------
  Reland Support for mustache templating language

The last version of this patch had memory leaks due to using the
BumpPtrAllocator for data types that required destructors to run to
release heap memory (e.g. via std::vector and std::string). This version
avoids that by using smart pointers, and dropping support for
BumpPtrAllocator.

We should refactor this code to use the BumpPtrAllocator again, but that
can be addressed in future patches, since those are more invasive
changes that need to refactor many of the core data types to avoid
owning allocations.

Adds Support for the Mustache Templating Language. See specs here:
https://mustache.github.io/mustache.5.html This patch implements
support+tests for majority of the features of the language including:

    - Variables
    - Comments
    - Lambdas
    - Sections

This meant as a library to support places where we have to generate
HTML, such as in clang-doc.

Co-authored-by: Peter Chou <peter.chou at mail.utoronto.ca>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list