Skip to content

chore: bump LLVM to 77e43ec1 (May 21, 2026)#1241

Open
gennaroprota wants to merge 3 commits into
cppalliance:developfrom
gennaroprota:chore/bump_llvm_for_macro_comment_support
Open

chore: bump LLVM to 77e43ec1 (May 21, 2026)#1241
gennaroprota wants to merge 3 commits into
cppalliance:developfrom
gennaroprota:chore/bump_llvm_for_macro_comment_support

Conversation

@gennaroprota

@gennaroprota gennaroprota commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

The new pin includes llvm/llvm-project#198452, which attaches documentation comments to macro definitions. That is the prerequisite for reading them from Clang directly instead of scanning the source, as we were initially doing in PR #1192.

Changes

  • Third-party: bump LLVM to 77e43ec1 (Associate documentation comments with macro definitions llvm/llvm-project#198452).

  • CI: update the hardcoded LLVM hash in the cache key (ci-matrix.yml) and its mirror unit test (test_cache_keys.py) to match the new pin, so the key misses and LLVM builds fresh instead of restoring the old install.

  • Source: The pin was about six months behind, so this also adapts MrDocs to the Clang API changes across that range:

    • USRGeneration.h moved from clang/Index to clang/UnifiedSymbolResolution; the clang::index namespace and signatures are unchanged.
    • clang::DiagnosticConsumer::finish() was removed, so the collecting diagnostic consumer relies on the forwarded EndSourceFile() instead.
    • The driver option table moved to clang/Options/Options.h, with its enumerators now in clang::options and getDriverOptTable() in clang.
    • cl::getRegisteredOptions() now returns a DenseMap, so its entries expose .second instead of getValue().
    • SubstituteConstraintExpressionWithoutSatisfaction was re-synced with Clang's current implementation.

    getRawCommentForDeclNoCache, the per-declaration comment lookup getDocumentation relied on, is no longer public. Its only public replacement, getRawCommentForAnyRedecl, follows the redeclaration chain and so cannot return a single declaration's own comment. getDocumentation keeps the per-declaration behavior by porting Clang's declaration-path comment search (getLocsForCommentSearch and getRawCommentNoCacheImpl) as file-local helpers.

    Parsing the newer libc++ also needs a new vcruntime_new.h stub and C++ guards so stdbool.h, stdalign.h, and threads.h stop redefining bool, alignas, and thread_local, which are keywords, not macros, in C++.

  • Golden tests: The regenerated goldens change only because Clang's output drifted over the six months: constrained templates and destructors get different symbol IDs from USR generation, though their structure is identical (requires-clause, dtor-overloads), and a few declaration locations shifted by a line or column (auto, param-types, function-template).

Testing

No new tests are added; this is a toolchain bump. The existing unit and golden suites already cover the affected behavior and run in CI on every build, and the goldens whose output changed have been regenerated as described above.

Documentation

No documentation changes are needed: this is an internal toolchain bump with no user-facing API changes.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

✨ Highlights

  • 🧪 Existing golden tests changed (behavior likely shifted)

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🛠️ Source 84% 656 453 203 10 1 9 - -
⚙️ CI 5% 41 34 7 2 - 2 - -
🥇 Golden Tests 5% 38 19 19 5 - 5 - -
🔧 Toolchain Tests 5% 38 19 19 1 - 1 - -
🧪 Unit Tests 1% 6 3 3 1 - 1 - -
🤝 Third-party 1% 6 3 3 1 - 1 - -
Total 100% 785 531 254 20 1 19 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • src/lib/AST/ClangHelpers.cpp (Source): 286 lines Δ (+259 / -27)
  • src/lib/MrDocsCompilationDatabase.cpp (Source): 274 lines Δ (+137 / -137)
  • share/mrdocs/headers/libc-stubs/vcruntime_new.h (Source): 41 lines Δ (+41 / -0)

Generated by 🚫 dangerJS against 9c7fcf4

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.16%. Comparing base (197e765) to head (9c7fcf4).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1241   +/-   ##
========================================
  Coverage    83.16%   83.16%           
========================================
  Files           35       35           
  Lines         3658     3658           
  Branches       843      843           
========================================
  Hits          3042     3042           
  Misses         409      409           
  Partials       207      207           
Flag Coverage Δ
bootstrap 83.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cppalliance-bot

cppalliance-bot commented Jul 2, 2026

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1241.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-07-03 14:05:52 UTC

@gennaroprota gennaroprota force-pushed the chore/bump_llvm_for_macro_comment_support branch from bafa3ea to 9ca11ea Compare July 2, 2026 10:29
The new pin includes llvm/llvm-project#198452, which attaches
documentation comments to macro definitions. That is the prerequisite
for reading them from Clang directly instead of scanning the source, as
we were initially doing in PR cppalliance#1192.

The pin was about six months behind, so this also adapts MrDocs to the
Clang API changes across that range:

- USRGeneration.h moved from clang/Index to
  clang/UnifiedSymbolResolution; the `clang::index` namespace and
  signatures are unchanged.
- `clang::DiagnosticConsumer::finish()` was removed, so the collecting
  diagnostic consumer relies on the forwarded `EndSourceFile()` instead.
- The driver option table moved to clang/Options/Options.h, with its
  enumerators now in `clang::options` and `getDriverOptTable()` in
  `clang`.
- `cl::getRegisteredOptions()` now returns a `DenseMap`, so its entries
  expose `.second` instead of `getValue()`.
- `SubstituteConstraintExpressionWithoutSatisfaction` was re-synced with
  Clang's current implementation.

`getRawCommentForDeclNoCache`, the per-declaration comment lookup
`getDocumentation` relied on, is no longer public. Its only public
replacement, `getRawCommentForAnyRedecl`, follows the redeclaration
chain and so cannot return a single declaration's own comment.
`getDocumentation` keeps the per-declaration behavior by porting Clang's
declaration-path comment search (`getLocsForCommentSearch` and
`getRawCommentNoCacheImpl`) as file-local helpers.

Parsing the newer libc++ also needs a new vcruntime_new.h stub and C++
guards so stdbool.h, stdalign.h, and threads.h stop redefining `bool`,
`alignas`, and `thread_local`, which are keywords, not macros, in C++.

The LLVM commit hash also feeds the CI cache key, so ci-matrix.yml and
the test_cache_keys.py unit test that mirrors it are bumped to match;
otherwise CI restores the previous libc++ install and builds the new one
over it.

The regenerated goldens change only because Clang's output drifted over
the six months: constrained templates and destructors get different
symbol IDs from USR generation, though their structure is identical
(requires-clause, dtor-overloads), and a few declaration locations
shifted by a line or column (auto, param-types, function-template).
@gennaroprota gennaroprota force-pushed the chore/bump_llvm_for_macro_comment_support branch from 9ca11ea to 28e4b46 Compare July 2, 2026 14:36
The LLVM bump broke two sanitizer jobs, both stemming from the
instrumented libc++ that the Clang ASan and MSan configurations build
from the pinned sources:

- Clang MSan failed to build it: the new libc++ needs a recent clang,
  and MSan had landed on clang 20.
- Clang ASan built it, but then the libcxx.cpp test failed to parse it:
  libc++'s ASan container-check self-guard rejects a parse that does not
  enable the sanitizer.

MSan genuinely needs an instrumented libc++ (it reports false positives
on uninstrumented code), so it keeps building one, now on the latest
Clang. ASan does not - it works against the normal libc++, as the
Apple-Clang ASan job already does - so it no longer builds its own,
which removes the libcxx.cpp conflict.
@gennaroprota gennaroprota force-pushed the chore/bump_llvm_for_macro_comment_support branch from e5bac8a to 9c7fcf4 Compare July 3, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants