[all-commits] [llvm/llvm-project] 22079e: [libc][hdrgen] Add extra_standards and license_tex...

Roland McGrath via All-commits all-commits at lists.llvm.org
Thu Oct 30 10:01:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 22079e3f3698d5c367c7b67f63de8c838791ae76
      https://github.com/llvm/llvm-project/commit/22079e3f3698d5c367c7b67f63de8c838791ae76
  Author: Roland McGrath <mcgrathr at google.com>
  Date:   2025-10-30 (Thu, 30 Oct 2025)

  Changed paths:
    M libc/utils/hdrgen/hdrgen/header.py
    M libc/utils/hdrgen/hdrgen/yaml_to_classes.py
    A libc/utils/hdrgen/tests/expected_output/custom.h
    M libc/utils/hdrgen/tests/expected_output/test_header.h
    M libc/utils/hdrgen/tests/expected_output/test_small.json
    A libc/utils/hdrgen/tests/input/custom-common.yaml
    A libc/utils/hdrgen/tests/input/custom.yaml
    M libc/utils/hdrgen/tests/test_integration.py

  Log Message:
  -----------
  [libc][hdrgen] Add extra_standards and license_text (#165459)

This adds a few new features to hdrgen, all meant to facilitate
using it with inputs and outputs that are outside the llvm-libc
source tree.

The new `extra_standards` field is a dictionary to augment the
set of names that can be used in `standards` lists.  The keys are
the identifiers used in YAML ("stdc") and the values are the
pretty names generated in the header comments ("Standard C").
This lets a libc project that's leveraging the llvm-libc sources
along with its own code define new APIs outside the formal and de
facto standards that llvm-libc draws its supported APIs from.

The new `license_text` field is a list of lines of license text
that replaces the standard LLVM license text used at the top of
each generated header.  This lets other projects use hdrgen with
their own inputs to produce generated headers that are not tied
to the LLVM project.

Finally, for any function attributes that are not in a canonical
list known to be provided by __llvm-libc-common.h, an include
will be generated for "llvm-libc-macros/{attribute name}.h",
expecting that file to define the "attribute" name as a macro.

All this can be used immediately by builds that drive hdrgen and
build libc code outside the LLVM CMake build.  Future changes
could add CMake plumbing to facilitate augmenting the LLVM CMake
build of libc with outside sources via overlays and cache files.



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