Sync with ClangSharp and regenerate against LLVM 21.1.8 - #251
Merged
tannergooding merged 2 commits intoJul 15, 2026
Merged
Conversation
Bring the props/targets, CI workflow, scripts, editorconfig, and README in line with the sibling ClangSharp repo, adjusting for LLVMSharp's agnostic-only packaging (no per-RID runtime packages, no win32metadata test). Adopt the PACKAGE_PUBLISH_MODE packaging flow, split the pkg upload into its own CI artifact, drop the retired nightly-feed publish jobs, and add a .github/copilot-instructions.md documenting the repo layout and regen workflow. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bump the libLLVM pin and VersionPrefix to 21.1.8 and regenerate the raw interop. Refresh the anonymous-enum remaps to the new header line numbers, add the LLVMGEPNoWrapFlags remap/enum, and pull in llvm-c/LLJITUtils.h (the Orc DumpObjects APIs moved there from LLJIT.h). Make GenerateLLVM.rsp self-contained with --file-directory and --libraryPath libLLVM since the repo has no generator project/launchSettings to supply them. Adds the new LLVM 21 APIs (LLVMConstDataArray, LLVMGetRawDataValues, LLVMReplaceArrays, LLVMGet/SetICmpSameSign, several DIBuilder APIs, LLVMOrcCreateNewThreadSafeContextFromLLVMContext), drops LLVMConstMul/NSWMul/NUWMul and LLVMOrcThreadSafeContextGetContext (removed upstream) along with their hand-written wrappers, and removes LLVMLandingPadClauseTy. The generated struct layout tests are gone since generate-disable-runtime-marshalling now suppresses them, matching ClangSharp. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings LLVMSharp back in line with its sibling ClangSharp and retargets the bindings to LLVM 21.1.8 (matching the Clang version ClangSharp targets).
Infrastructure sync
Props/targets, CI workflow, scripts,
.editorconfig, and README are brought in line with ClangSharp, adjusting for LLVMSharp's agnostic-only packaging (no per-RID runtime packages, no win32metadata regression test):PACKAGE_PUBLISH_MODEpackaging flow (Directory.Build.props/.targets), enable the AOT/single-file analyzers for.NETCoreApp, and fix the.editorconfigfile header to the standard .NET Foundation text.pkgupload into its own CI artifact, modernize the signing job (Azure login + prereleasesigntool), and drop the retired nightly-feed publish jobs / stale badge + feed URL.Microsoft.NET.Test.Sdk(18.0.1) andNUnit3TestAdapter(6.1.0)..github/copilot-instructions.mddocumenting the repo layout (hand-written vs generated), build/test, and the regen workflow + gotchas.Regenerate bindings to LLVM 21.1.8
Bump the
libLLVMpin andVersionPrefixto 21.1.8 and regenerate the raw interop.LLVMGEPNoWrapFlagsremap/enum, and pull inllvm-c/LLJITUtils.h(the OrcDumpObjectsAPIs moved there fromLLJIT.h).GenerateLLVM.rspself-contained with--file-directoryand--libraryPath libLLVM, since -- unlike ClangSharp -- this repo has no generator project /launchSettings.jsonto supply them (previously the P/Invokes generated with an empty[DllImport("")]).API surface changes (all genuine upstream LLVM 21 changes):
LLVMConstDataArray,LLVMGetRawDataValues,LLVMReplaceArrays,LLVMGet/SetICmpSameSign, severalDIBuilderAPIs,LLVMOrcCreateNewThreadSafeContextFromLLVMContext,LLVMDISubprogramReplaceType; new enum members (LLVMAtomicRMWBinOpFMaximum/FMinimum, new metadata kinds) and the newLLVMGEPNoWrapFlagsenum.LLVMConstMul/LLVMConstNSWMul/LLVMConstNUWMul(mul is no longer a constant expression upstream -- no replacement) andLLVMOrcThreadSafeContextGetContext, along with the three hand-written const-mul wrappers inExtensions/LLVMValueRef.cs.LLVMLandingPadClauseTyis dropped (removed from the headers).generate-disable-runtime-marshallingnow suppresses them (ClangSharp is the same -- it ships zero generated interop struct tests).Notes / callouts
LLVMAttributeIndex/LLVMJITSymbolGenericFlagskept asintenums. Generator21.1.8.3now preserves the headers'Uliteral suffixes (0U,1U << n), which breakintenums (CS0266), but the repo's unsuppressedCA1028requiresInt32-underlying enums (souintisn't viable either). Both enums' members/values are unchanged from 20.1.2, so they're kept in their committedintform with only the version header bumped -- documented as the one expected post-regen manual fixup.clang+llvm-21.1.8-x86_64-pc-windows-msvcrelease binary used for regen was configured with a reducedLLVM_TARGETS_TO_BUILD, which would have silently dropped 13 backends from theInitializeAll*aggregators (they'restatic inlineinTarget.h, expanded overConfig/*.def). Restored to the canonical set; documented as a regen gotcha.libLLVMSharp-helper interop (GenerateLLVMSharp.rsp->llvmsharp/) was not regenerated -- it needs the built native helper, unavailable in this environment.Build is clean (0 warnings,
TreatWarningsAsErrorson) and all 2587 tests pass.Note
This PR body was drafted by Copilot.