chore: upgrade LLVM to 22.1.4 - #448
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughConvert LLVM packaging to a manifest-driven CMake download/extract flow, add a release CLI and workflows to discover/apply/repackage pruned artifacts, bump LLVM to 22.1.4, and update C++ sources/tests to Clang/LLVM 22 API changes (value-based NestedNameSpecifier/TypeLoc, diagnostics/VFS, and template resolver refactor). ChangesLLVM Artifact Infrastructure & Manifest
Release Automation & Artifact Pruning
Clang/LLVM 22 API Adaptation
Sequence Diagram(s)sequenceDiagram
participant BuildRun as Build job (source run)
participant Discover as discover job (per-OS)
participant ReleaseScript as scripts/release-llvm.py
participant Repackage as repackage job
participant GitHubRelease as GitHub Release
BuildRun->>Discover: provide build artifact (SOURCE_RUN_ID)
Discover->>ReleaseScript: run discover (install_dir, build_dir)
ReleaseScript-->>Discover: pruned-libs.json (per-OS)
Repackage->>ReleaseScript: repackage (source_run_id, manifests_dir)
ReleaseScript-->>Repackage: pruned tar.xz + *.meta.json
Repackage->>GitHubRelease: upload artifacts and metadata
Repackage->>Finalize: produce merged llvm-manifest.json
Finalize->>GitHubRelease: upload llvm-manifest.json
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bb19b604a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/update-llvm-version.py (1)
10-28:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFail fast if the manifest version and
--versiondiverge.This step now updates
cmake/package.cmakeand copiesllvm-manifest.jsontogether, but it never checks thatdata["version"]matchesargs.version. A stale manifest will leavesetup_llvm("22.1.4")pointing at21.1.8hashes, and the break only shows up later during download/verification. Pass the requested version intocopy_manifest()and reject mismatches before writing either file.Suggested fix
-def copy_manifest(src: Path, dest: Path) -> None: +def copy_manifest(src: Path, dest: Path, version: str) -> None: text = src.read_text(encoding="utf-8") @@ if not isinstance(data, dict) or "artifacts" not in data: print(f"Error: {src} must be a JSON object with 'artifacts' key", file=sys.stderr) sys.exit(1) + if data.get("version") != version: + print( + f"Error: {src} has version {data.get('version')!r}, expected {version!r}", + file=sys.stderr, + ) + sys.exit(1) @@ - copy_manifest(manifest_src, manifest_dest) + copy_manifest(manifest_src, manifest_dest, args.version)Also applies to: 154-155
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/update-llvm-version.py` around lines 10 - 28, copy_manifest currently never verifies that the manifest's version matches the requested CLI version, so a stale llvm-manifest.json can be copied under the wrong version; modify copy_manifest(src: Path, dest: Path, expected_version: str) to read data["version"] and compare it with expected_version, and if they differ print an error to stderr and exit non‑zero before writing the dest file; update any callers (where copy_manifest is invoked) to pass args.version into the new parameter so the manifest is rejected early on mismatch.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release-llvm.yml:
- Around line 38-40: Replace the mutable tag for actions/checkout with a pinned
immutable SHA: locate the workflow line using the external action reference
"actions/checkout@v4" and change it to the full commit SHA for the
actions/checkout repository (e.g., "actions/checkout@<full-commit-sha>"),
leaving the local action "./.github/actions/setup-pixi" unchanged; ensure you
copy the exact full commit SHA from the actions/checkout repo to guarantee
immutability.
In `@cmake/llvm.cmake`:
- Around line 26-41: The branch that sets _ARCH for native hosts always forces
"x64" for non-APPLE platforms; update the non-APPLE branches (the WIN32/else
branches shown) to detect ARM64 by checking CMAKE_SYSTEM_PROCESSOR like the
APPLE branch does: replace the hardcoded set(_ARCH "x64") in the Windows and
Linux (else) branches with a conditional that tests CMAKE_SYSTEM_PROCESSOR
MATCHES "arm64|aarch64|ARM64" and sets _ARCH to "arm64" when matched and "x64"
otherwise, keeping _PLATFORM and _TOOLCHAIN assignments intact; use the same
pattern as the APPLE branch so manifest filenames resolve correctly.
- Around line 62-118: The cache is not keyed by LLVM version so
_download_and_extract/_download_llvm may reuse a wrong archive or install;
change the logic to include the requested LLVM_VERSION (or the artifact SHA256)
in _DOWNLOAD_PATH and _INSTALL_ROOT (e.g. append "${LLVM_VERSION}" or
"${_SHA256}" to those paths) or validate the existing install before reuse by
reading a marker (e.g. create/check a VERSION or SHA marker file in
_INSTALL_ROOT or compare the manifest SHA256 for _FILENAME) and if it mismatches
remove/re-download; update references to _DOWNLOAD_PATH and _INSTALL_ROOT and
add the validation step inside _download_llvm before short-circuiting to ensure
the cached files correspond to the requested LLVM_VERSION/_SHA256.
In `@scripts/release-llvm.py`:
- Around line 118-157: discover() mutates the install tree by calling
_nullify_shared_libs() (which truncates shared libs) and _try_delete() (which
moves/deletes safe files) and then returns without restoring the original files;
to fix, change discover() to operate on a temporary copy of install_dir (or copy
files to a temp dir at the start) and run _nullify_shared_libs(), _try_delete(),
_remove_binaries(), and _run_build() against that copy (or, alternatively,
restore files after testing by moving backups back before returning); update
references to _candidate_files(), _nullify_shared_libs(), and _try_delete() to
use the copied path so the original install tree remains unchanged for
subsequent packaging.
In `@src/semantic/resolver.cpp`:
- Around line 965-968: The code currently memoizes a fallback unresolved
dependent specialization (using resolved.insert of TST/original and the
TLB.pushTrivial path), which makes a first miss permanent across later resolve()
calls; change the logic so that the resolved map is only updated when resolution
actually succeeds: do not insert the unresolved fallback (the TST returned via
TLB.pushTrivial or the variable named original in the later block) into
resolved; instead only cache the successful concrete result, or restrict storing
unresolved entries to a single top-level resolution pass scope. Locate the
checks around resolved.find(TST), the TLB.pushTrivial call, and the place that
currently assigns original into resolved, and gate those inserts so
unresolved/fallback results are never stored.
In `@src/semantic/semantic_visitor.h`:
- Line 518: The code incorrectly calls loc.getDecl() on a clang::TypedefTypeLoc;
replace that call with loc.getTypedefNameDecl() so the variable receives a
TypedefNameDecl* as intended (update the declaration that uses decl from auto
decl = loc.getDecl() to use loc.getTypedefNameDecl()). Ensure any subsequent
uses expect a TypedefNameDecl* (adjust variable type or casts if needed) in
semantic_visitor.h where TypedefTypeLoc is handled.
---
Outside diff comments:
In `@scripts/update-llvm-version.py`:
- Around line 10-28: copy_manifest currently never verifies that the manifest's
version matches the requested CLI version, so a stale llvm-manifest.json can be
copied under the wrong version; modify copy_manifest(src: Path, dest: Path,
expected_version: str) to read data["version"] and compare it with
expected_version, and if they differ print an error to stderr and exit non‑zero
before writing the dest file; update any callers (where copy_manifest is
invoked) to pass args.version into the new parameter so the manifest is rejected
early on mismatch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4e36c2b4-4fda-4cf8-9dd8-a35c5050a4f6
📒 Files selected for processing (27)
.github/workflows/build-llvm.yml.github/workflows/release-llvm.ymlcmake/llvm.cmakecmake/package.cmakeconfig/llvm-manifest.jsonscripts/build-llvm.pyscripts/llvm-components.jsonscripts/prune-llvm-bin.pyscripts/release-llvm.pyscripts/update-llvm-version.pyscripts/upload-llvm.pyscripts/validate-llvm-components.pysrc/command/argument_parser.cppsrc/command/search_config.cppsrc/command/toolchain.cppsrc/compile/compilation.cppsrc/index/usr_generation.cppsrc/semantic/ast_utility.cppsrc/semantic/filtered_ast_visitor.hsrc/semantic/resolver.cppsrc/semantic/resolver.hsrc/semantic/selection.cppsrc/semantic/semantic_visitor.hsrc/syntax/scan.cpptests/unit/command/argument_parser_tests.cpptests/unit/feature/inlay_hint_tests.cpptests/unit/semantic/selection_tests.cpp
💤 Files with no reviewable changes (3)
- scripts/validate-llvm-components.py
- scripts/llvm-components.json
- scripts/prune-llvm-bin.py
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
scripts/release-llvm.py (1)
49-67: ⚡ Quick winRename ambiguous loop variable
ltolto.The single-letter
lis easily confused with the digit1. Renaming improves readability.♻️ Suggested fix
ARTIFACTS = [ - build_artifact_name(p, a, m, lto=l, asan=s) - for p, a, m, l, s in [ + build_artifact_name(p, a, m, lto=lto, asan=asan) + for p, a, m, lto, asan in [ ("linux", "aarch64", "RelWithDebInfo", True, False), ... ] ]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/release-llvm.py` around lines 49 - 67, The list comprehension uses an ambiguous loop variable named `l`; rename it to `lto` in the tuple unpacking and subsequent use so it’s clear this flag represents LTO—update the comprehension header (for p, a, m, l, s -> for p, a, m, lto, s) and any place that passes that variable into build_artifact_name (e.g., the call in ARTIFACTS that references l) to use `lto`, keeping build_artifact_name and other identifiers unchanged.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/upload-llvm.py`:
- Around line 40-44: The loop that inserts artifact metadata into
manifest["artifacts"] uses the basename key (variable filename from
release_llvm.build_metadata_entry) and will silently overwrite if two
artifact_files share the same basename; update the loop (where artifact_files is
iterated and entry/filename are created) to detect duplicates before insertion:
check if filename already exists in manifest["artifacts"] and fail fast
(raise/exit with a clear error mentioning the current path and the conflicting
existing entry) or otherwise produce a unique key (for example include the
original relative path) so no overwrite occurs; reference
release_llvm.build_metadata_entry, artifact_files, filename, and
manifest["artifacts"] when making the change.
---
Nitpick comments:
In `@scripts/release-llvm.py`:
- Around line 49-67: The list comprehension uses an ambiguous loop variable
named `l`; rename it to `lto` in the tuple unpacking and subsequent use so it’s
clear this flag represents LTO—update the comprehension header (for p, a, m, l,
s -> for p, a, m, lto, s) and any place that passes that variable into
build_artifact_name (e.g., the call in ARTIFACTS that references l) to use
`lto`, keeping build_artifact_name and other identifiers unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0ed2f1c3-5b18-4191-86ba-76274f552d6d
📒 Files selected for processing (7)
.github/workflows/build-llvm.yml.github/workflows/release-llvm.ymlcmake/llvm.cmakescripts/release-llvm.pyscripts/upload-llvm.pysrc/semantic/resolver.cppsrc/semantic/semantic_visitor.h
💤 Files with no reviewable changes (1)
- src/semantic/semantic_visitor.h
🚧 Files skipped from review as they are similar to previous changes (2)
- cmake/llvm.cmake
- src/semantic/resolver.cpp
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c609dc80b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/release-llvm.yml (2)
177-183:⚠️ Potential issue | 🟠 MajorFail immediately if a
*.meta.jsonsidecar is missing to avoid publishing an incompletellvm-manifest.json.
finalizebuildsllvm-manifest.jsonsolely from downloadedmetadata-*/**.meta.json. Ifartifacts/${{ matrix.artifact }}.meta.jsonis missing,actions/upload-artifact@v4defaultsif-no-files-foundtowarn, so the workflow won’t fail and the release can publish a partial manifest.Suggested fix
- name: Upload metadata uses: actions/upload-artifact@v4 with: name: metadata-${{ matrix.artifact }} path: artifacts/${{ matrix.artifact }}.meta.json + if-no-files-found: error compression-level: 0 retention-days: 1🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release-llvm.yml around lines 177 - 183, The Upload metadata step (uses: actions/upload-artifact@v4) currently can silently succeed when artifacts/${{ matrix.artifact }}.meta.json is missing because upload-artifact defaults if-no-files-found to warn; change the step to fail fast by setting the upload action input if-no-files-found: error or add an explicit pre-check step that verifies the file artifacts/${{ matrix.artifact }}.meta.json exists (failing the job if not) before calling upload-artifact, so finalize will never build llvm-manifest.json from a partial set of metadata sidecars.
1-18:⚠️ Potential issue | 🟠 MajorSerialize publishes per
${{ inputs.llvm_version }}to prevent release asset racesTwo concurrent
workflow_dispatchruns with the same${{ inputs.llvm_version }}reuse the same GitHub release tag and each run overwrites release assets withgh release upload ... --clobber(binaries inrepackage,llvm-manifest.jsoninfinalize). That can leaveclice-io/clice-llvmwith binaries from one run and a manifest from another.
- Add workflow concurrency for this tag.
- Optional hardening: add
permissions: actions: readto thediscoverjob to matchrepackageforgh run download.- Optional hardening: set
if-no-files-found: erroron theUpload metadatastep (defaults towarn), sincefinalizewill crash if no*.meta.jsonare present.Suggested fix
name: release llvm on: workflow_dispatch: @@ env: SOURCE_RUN_ID: ${{ inputs.source_run_id }} LLVM_VERSION: ${{ inputs.llvm_version }} + +concurrency: + group: release-llvm-${{ inputs.llvm_version }} + cancel-in-progress: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release-llvm.yml around lines 1 - 18, Add workflow-level concurrency keyed on the LLVM version to serialize runs for the same tag (use concurrency: { group: "release-llvm-${{ inputs.llvm_version }}", cancel-in-progress: false }) so concurrent workflow_dispatch runs with the same inputs.llvm_version cannot clobber release assets; also add permissions: { actions: read } to the discover job to match repackage (for gh run download), and change the Upload metadata step in the finalize job to set if-no-files-found: error (instead of the default warn) so missing *.meta.json fails early.
🧹 Nitpick comments (1)
.github/workflows/release-llvm.yml (1)
20-31: ⚡ Quick winDeclare
actions: readondiscover.This job also calls
gh run download, but unlikerepackageit inherits whatever the repository default token permissions happen to be. On installations that defaultGITHUB_TOKENto contents-only,discoverwill fail before pruning even starts.Suggested fix
discover: + permissions: + contents: read + actions: read strategy: fail-fast: falseAlso applies to: 52-61
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release-llvm.yml around lines 20 - 31, The discover job currently runs gh run download but doesn't declare repository token permissions, so add an explicit permissions block (permissions: actions: read) to the discover job to ensure gh run download can access artifacts; locate the job named "discover" in the workflow and add permissions: actions: read at the same indentation as runs-on, and apply the same change to the other similar job referenced in the file (the job that also invokes gh run download, e.g. "repackage") so both jobs explicitly grant actions read permission for GITHUB_TOKEN.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/release-llvm.yml:
- Around line 177-183: The Upload metadata step (uses:
actions/upload-artifact@v4) currently can silently succeed when artifacts/${{
matrix.artifact }}.meta.json is missing because upload-artifact defaults
if-no-files-found to warn; change the step to fail fast by setting the upload
action input if-no-files-found: error or add an explicit pre-check step that
verifies the file artifacts/${{ matrix.artifact }}.meta.json exists (failing the
job if not) before calling upload-artifact, so finalize will never build
llvm-manifest.json from a partial set of metadata sidecars.
- Around line 1-18: Add workflow-level concurrency keyed on the LLVM version to
serialize runs for the same tag (use concurrency: { group: "release-llvm-${{
inputs.llvm_version }}", cancel-in-progress: false }) so concurrent
workflow_dispatch runs with the same inputs.llvm_version cannot clobber release
assets; also add permissions: { actions: read } to the discover job to match
repackage (for gh run download), and change the Upload metadata step in the
finalize job to set if-no-files-found: error (instead of the default warn) so
missing *.meta.json fails early.
---
Nitpick comments:
In @.github/workflows/release-llvm.yml:
- Around line 20-31: The discover job currently runs gh run download but doesn't
declare repository token permissions, so add an explicit permissions block
(permissions: actions: read) to the discover job to ensure gh run download can
access artifacts; locate the job named "discover" in the workflow and add
permissions: actions: read at the same indentation as runs-on, and apply the
same change to the other similar job referenced in the file (the job that also
invokes gh run download, e.g. "repackage") so both jobs explicitly grant actions
read permission for GITHUB_TOKEN.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 14e5e94c-86ce-408a-8060-037b3b13c53e
📒 Files selected for processing (3)
.github/workflows/release-llvm.ymlcmake/llvm.cmakescripts/release-llvm.py
🚧 Files skipped from review as they are similar to previous changes (2)
- cmake/llvm.cmake
- scripts/release-llvm.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4adaa1ea88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-llvm.yml:
- Around line 145-150: The workflow step "Clone llvm-project" currently
interpolates the user input directly into the run script via `${{
inputs.llvm_version }}`, which allows template injection; instead pass the input
through the step's env context (set an env key like VERSION: ${{
inputs.llvm_version }}) and then reference the safe shell variable (`$VERSION`)
inside the run script used by that step (keep the step name "Clone llvm-project"
and the shell variable `VERSION` so you can find it). Ensure the run script uses
the env variable (quoted) when printing and when supplying the git --branch
argument to avoid direct template interpolation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 740fd0ce-8759-4bf3-95fc-bb709140cbab
📒 Files selected for processing (1)
.github/workflows/build-llvm.yml
Replace the 95-entry manual component list with 8 umbrella targets (llvm-libraries, clang-libraries, etc.) and add cmake-exports so the LLVM install includes CMake config files for find_package support. Add skip_clice_build input to build-llvm workflow to allow building LLVM without requiring clice to compile (useful when upgrading LLVM with API changes).
clice is a language server and does not need all 20+ codegen backends. Keep targets that have tablegen-generated resource headers (ARM/AArch64 for arm_neon.h etc, RISCV for riscv_vector.h) plus X86 for desktops.
Remove iOS/tvOS/watchOS/visionOS simulators, unused Xcode platforms, Android SDK, .NET, PowerShell, and Haskell to reclaim disk space. Revert LLVM_TARGETS_TO_BUILD back to all.
Revert temporary cleanup-only test state, restore all 14 matrix entries with macOS disk cleanup included. Delete test-macos-cleanup.yml.
Key breaking changes handled: - clang/Driver/Options.h moved to clang/Options/Options.h - NestedNameSpecifier changed from pointer to value type - ElaboratedType removed from Clang AST - DependentTemplateSpecializationType merged into TemplateSpecializationType - CompilerInstance::createDiagnostics/createFileManager API changed - TypedefTypeLoc::getTypedefNameDecl() renamed to getDecl() - TraverseTypeLoc gained TraverseQualifier parameter - llvm::sys::fs::make_absolute moved to llvm::sys::path
- Add --skip-pattern to prune-llvm-bin.py to protect clang-tidy modules - New workflow downloads pre-built LLVM artifacts, builds clice, and discovers which static libraries can be safely pruned - Skip Debug builds (shared libs, unsafe to prune)
- Record each file's size before deletion so manifest includes
total_saved_bytes and per-file sizes
- Fix skip-pattern from *TidyModule* to *Tidy*Module* to correctly
match libclangTidyAbseilModule.a etc.
- Update manifest format: removed is now [{name, size}, ...]
- apply_manifest handles both old (string) and new (dict) formats
…solution Replace file(GLOB) and manual library lists with proper CMake imported targets. Transitive dependencies are now resolved automatically via LLVMConfig.cmake and ClangConfig.cmake. Also adds clangTidyCustomModule and clangTidyMPIModule (new in LLVM 22).
Aggregate shared libraries (libclang-cpp.so, libLTO.so, libRemarks.so) contain all symbols from their static counterparts, causing false positives during prune detection. Replace them with empty stubs before discovery. Also delete build output binaries before each test rebuild to force ninja to re-link.
…libs - Record nullified .so/.dylib files in manifest with original sizes - Apply mode replaces files with empty archives (!<arch>\n) instead of deleting, preserving cmake export integrity - Shared libs replaced with empty stubs (0 bytes)
- Replace prune-llvm.yml with release-llvm.yml that discovers prunable libs, applies prune manifests to all 14 artifacts, and uploads to clice-io/clice-llvm - Rewrite cmake/llvm.cmake to use native file(DOWNLOAD) instead of calling setup-llvm.py, removing the Python dependency at configure time - Workflow triggered by workflow_dispatch with source_run_id and version
Rename prune-llvm-bin.py to release-llvm.py and add a `repackage` action that downloads, prunes, and repackages all 14 LLVM artifacts in parallel using concurrent.futures. Move release job to macos-15 for faster arm64 compression.
Each of the 14 artifacts gets its own runner, uploads directly to the GitHub release via gh release upload. Metadata is collected via Actions artifacts and merged in a finalize job. Removed auto-PR creation.
macOS LTO artifacts exceeded GitHub's 2GB release asset limit at -3. With per-job parallelism, compression speed is no longer a bottleneck.
macOS LTO artifacts exceeded GitHub's 2GB release asset limit at -3. With per-job parallelism, compression speed is no longer a bottleneck.
- Always use xz -9 for repackage (sufficient to keep all artifacts under 2GB)
- Change manifest format from flat array to {version, artifacts: {name: {sha256, ...}}}
- Simplify CMake download: direct key lookup instead of iterating array
- Extract _download_and_extract and _compress_tar_xz helpers
Replaced by native CMake file(DOWNLOAD) in cmake/llvm.cmake.
- Remove stale prune logic from build-llvm.yml (now in release-llvm.yml) - Fix release race condition: reuse existing release + --clobber uploads - Add actions: read permission to repackage job - Restore TransformNestedNameSpecifierLoc + TransformTemplateArguments in resolver dependent-TST path to match old DTST behavior - Add ARM64 detection for Windows/Linux in cmake artifact name selection - Unify artifact naming: release-llvm.py is single source of truth with build_artifact_name(), PLATFORM_INFO, and artifact-name subcommand - Deduplicate upload-llvm.py by importing from release-llvm.py - Convert release-llvm.py CLI to argparse subcommands - Remove stale LLVM-version-referencing comments
- Remove push trigger from release-llvm.yml; only workflow_dispatch with required inputs can publish to clice-llvm, preventing accidental overwrites - Add version stamp (.llvm-version) to cmake download cache so LLVM version upgrades trigger re-download instead of silently reusing stale installs; also verify SHA256 of cached download archives - Fail hard when prune manifest is missing during repackage instead of warning and publishing unpruned artifacts
Remove clice build/test steps, test-cross job, upload job, and update-clice job. These responsibilities now live in release-llvm.yml.
- Add clangOptions to llvm-libs link list (new LLVM 22 library for driver option table, fixes undefined symbol in Debug shared builds) - Apply ruff/clang-format to Python scripts and resolver.cpp
These are superseded by release-llvm.yml which handles the full discover → repackage → upload pipeline.
a8720c9 to
7a2c122
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a2c122e09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adapt remaining code to LLVM 22 API changes that were missed during the rebase onto main (which refactored the option system to kota::option): - Options.inc moved from clang/Driver/ to clang/Options/, OPTION macro gained a 15th parameter - NestedNameSpecifier is now a value type (find_target.cpp, resolver.cpp, semantic_visitor.h, ast_utility.cpp) - ElaboratedType removed: update type printing expectations in tests/snapshots - getTypeForDecl() deleted on TagDecl: use getCanonicalTagType() - Driver::GetResourcesPath → clang::GetResourcesPath - fs::make_absolute → path::make_absolute - UsingType::getFoundDecl → getDecl - DependentTemplateSpecializationType merged into TST - ClangTidyModuleRegistry.h deprecated → ClangTidyModule.h - Fix macOS cross-compile arch mismatch (aarch64→arm64 for darwin) - Style fixes: snake_case parameter names, dead code removal
The release artifacts were rebuilt since the manifest was last captured, causing SHA256 mismatches during CI LLVM download.
The resolver call on dependent TemplateSpecializationTypes caused a SEGV in HeuristicResolver::resolveTemplateSpecializationType during hover snapshots. The original LLVM 21 VisitTemplateSpecializationType never called the resolver — it was only the removed DependentTemplateSpecializationType handler that did.
There was a problem hiding this comment.
💡 Codex Review
clice/src/semantic/find_target.cpp
Line 456 in a1cad55
In LLVM 22 dependent template specializations reach this visitor as TemplateSpecializationTypes with a DependentTemplateName, but after the deleted DTST visitor there is no call to HeuristicResolver::resolveTemplateSpecializationType() here. On selections such as typename Traits<T>::template rebind<U> the existing branches all see null concrete template/record decls, so go-to-definition/references stop reporting the alias/template that Clang's resolver can still find. Call the resolver for dependent template names before the concrete-template fallbacks.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When createVFSFromCompilerInvocation returns null (no -ivfsoverlay or remapped files), the CompilerInstance's VFS was left unset, causing createFileManager() to fall back to the real filesystem. This bypasses the project's ThreadSafeFS for background compilations. Always set params.vfs as the fallback.
Add a test confirming that the injected class name S and explicit S<T> produce identical USRs inside a class template body. In LLVM 22, InjectedClassNameType inherits from TagType, so both are handled by the same TagType branch in VisitType — remove the now-dead InjectedClassNameType special case.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e181aa686
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| void VisitUsingType(const clang::UsingType* type) { | ||
| outer.add(type->getFoundDecl(), flags); | ||
| outer.add(type->getDecl(), flags); |
There was a problem hiding this comment.
Preserve using-type alias targets
When a type is named through a using-declaration, Clang represents that sugar with UsingType and the found declaration is the UsingShadowDecl; feeding that through TargetFinder::add is what records both the introducing UsingDecl alias and the underlying type. Reporting the underlying declaration directly here loses the alias edge for cases like namespace ns { struct S; } using ns::S; S *p;, so selection/hover over S can no longer see the local using declaration as a referenced alias. Keep using the found shadow declaration for UsingType rather than bypassing it.
Useful? React with 👍 / 👎.
In LLVM 22, non-canonical TagTypes carry an embedded keyword that type.print() outputs unconditionally. The manual keyword hack in print_type() must skip these types to avoid "struct struct Bar". Only add the keyword prefix for canonical TagTypes (which have no embedded keyword and rely on SuppressTagKeyword to control display).
2075ab8 to
8c0ccc9
Compare
Document all breaking changes encountered during the upgrade, with upstream commit hashes and PR links for future tracking.
- Move upgrade workflow from docs/ to .claude/commands/ as a skill (primarily for agent use, human-readable as reference) - Create docs/en/changelog/ directory for tracking changes - Add docs/en/changelog/llvm-22.md with all LLVM 21→22 breaking changes and upstream commit references - Add docs/en/changelog/feature-changelog.md placeholder - Add Step 7 requirement: every LLVM upgrade must produce a changelog
- Merge per-version llvm-22.md into single llvm-changelog.md (append new H1 sections for each upgrade) - Update upgrade-llvm skill: remove ../llvm-project hard dependency, add polling guidance, point changelog to consolidated file
Step 8 now requires reporting all changes to the user and waiting for confirmation before considering the upgrade complete.
Summary
find_package(LLVM/Clang)with umbrella distribution componentsrelease-llvm.ymlworkflow: discover unused libs → prune → repackage → upload to clice-llvmxz -9eextreme compression (arm64-macos-lto: 2021 MB → 1688 MB)Test plan
Summary by CodeRabbit
Dependencies
New Features
Improvements
Bug Fixes / Behavior