Add support for GHC 9.14#3182
Draft
rowanG077 wants to merge 17 commits into
Draft
Conversation
A primitive's 'name' field may now be either a single string (current
syntax, fully backwards-compatible) or a non-empty list of strings:
- Primitive:
name: ["GHC.Num.Integer.IS", "GHC.Internal.Bignum.Integer.IS"]
primType: Constructor
workInfo: Never
When a list is given, the same primitive body is registered in clash's
PrimMap once per name. This is meant to handle wired-in GHC symbols whose
host module changes across GHC versions (e.g. base 'GHC.Num.Integer.IS'
on GHC <= 9.12 vs ghc-internal 'GHC.Internal.Bignum.Integer.IS' on
GHC >= 9.14), without having to duplicate the entire YAML body in a
sibling file.
Implementation: a new newtype 'UnresolvedPrimitiveEntry' wraps a
NonEmpty UnresolvedPrimitive and has the multi-name FromJSON instance.
The loader ('resolvePrimitive') now decodes a list of entries and
flattens them. The 'Primitive' record itself still carries a single
'name :: !Text', so every downstream lookup, hash, and error message is
unchanged.
The existing 'FromJSON UnresolvedPrimitive' instance is kept for
backwards compatibility but rejects multi-name entries with a clear
error message.
Co-Authored-By: Martijn Bastiaan <martijn@qbaylogic.com>
Co-Authored-By: Martijn Bastiaan <martijn@qbaylogic.com>
Co-Authored-By: Martijn Bastiaan <martijn@qbaylogic.com>
Co-Authored-By: Martijn Bastiaan <martijn@qbaylogic.com>
1ea526d to
246850c
Compare
Co-Authored-By: Martijn Bastiaan <martijn@qbaylogic.com>
246850c to
033b65a
Compare
Member
|
@rowanG077 It's alive! I've done the very opinionated thing of removing |
57a5f6b to
091fbd4
Compare
091fbd4 to
aa7b629
Compare
It has sat there unused for a long time
aa7b629 to
eb42b3b
Compare
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.
Branched off from #2941
A ton of bounds relaxation are necessary.