Mirror C++ predicate, vector, intrinsic, and comdat surface on the managed API#270
Merged
tannergooding merged 5 commits intoJul 16, 2026
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Wrap LLVMComdatRef in a managed Comdat exposing SelectionKind, add the LLVMValueRef.Comdat / LLVMComdatRef.SelectionKind / LLVMModuleRef.GetOrInsertComdat interop accessors it builds on, and surface GlobalObject.Comdat/HasComdat and Module.GetOrInsertComdat over the existing LLVM-C comdat API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mirror the C++ CmpInst/ICmpInst/FCmpInst instance predicate overloads (getInverse/swapped/ordered/unordered/strict/non-strict predicate, isFP/isInt/isStrict/isEquality/isRelational/isSigned/isUnsigned/isTrueWhenEqual/isFalseWhenEqual, ICmpInst getSigned/getUnsignedPredicate, FCmpInst isOrdered/isUnordered) by delegating to the existing static predicate helpers off GetPredicate(). Pure managed, so the isEquality/isRelational follow-up needs no native round-trip. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Mirror a set of
llvm::C++ class members on the managed high-level API that are pure functions of state already reachable through the LLVM-C API, so no nativelibLLVMSharprebuild is required. Each addition is validated against the LLVM 21.1.8 C++ headers and covered by newManagedApiunit tests.CmpInstpredicate surface (CmpInst.Predicate.cs,CmpInst.cs,ICmpInst.cs,FCmpInst.cs)Predicateenum:GetInverse/Swapped/Ordered/Unordered/Strict/NonStrictPredicate,IsFP/IsInt/IsStrict/IsEquality/IsRelational/IsSigned/IsUnsigned/IsOrdered/IsUnordered/IsTrueWhenEqual/IsFalseWhenEqual.ICmpInst.GetSigned/GetUnsignedPredicate+IsEquality;FCmpInst.IsEquality.getInversePredicate(),isSigned(),FCmpInst.isOrdered(), etc.), each delegating to the vetted static helper offGetPredicate().VectorTypescalable support (Type.cs,CompositeType.cs,SequentialType.cs,VectorType.cs)LLVMScalableVectorTypeKindtoVectorTypeand addVectorType.IsScalable.Function.IsIntrinsic—IntrinsicID != 0.Managed
Comdattype (Comdat.cs,GlobalObject.cs,Module.cs)Comdatwrapper exposingSelectionKind;GlobalObject.Comdat/HasComdat;Module.GetOrInsertComdat, over the existing LLVM-C comdat API.Builds with 0 warnings; 2620 unit tests pass (7 Kaleidoscope failures are pre-existing environmental, unrelated to this change).