summaryrefslogtreecommitdiff
path: root/utils/genprimopcode/Syntax.hs
Commit message (Collapse)AuthorAgeFilesLines
* genprimopcode: fix bootstrap errorsSylvain Henry2021-05-131-1/+1
| | | | | * Fix for unqualified Data.List import * Fix monad instance
* primops: Remove Monadic and Dyadic categoriesKrzysztof Gogolewski2020-08-261-5/+1
| | | | | | | | | There were four categories of primops: Monadic, Dyadic, Compare, GenPrimOp. The compiler does not treat Monadic and Dyadic in any special way, we can just replace them with GenPrimOp. Compare is still used in isComparisonPrimOp.
* Fix more typos, via an improved Levenshtein-style correctorBrian Wignall2020-01-121-1/+1
|
* Add HsSyn prettyprinter testsAlan Zimmerman2016-12-071-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add prettyprinter tests, which take a file, parse it, pretty print it, re-parse the pretty printed version and then compare the original and new ASTs (ignoring locations) Updates haddock submodule to match the AST changes. There are three issues outstanding 1. Extra parens around a context are not reproduced. This will require an AST change and will be done in a separate patch. 2. Currently if an `HsTickPragma` is found, this is not pretty-printed, to prevent noise in the output. I am not sure what the desired behaviour in this case is, so have left it as before. Test Ppr047 is marked as expected fail for this. 3. Apart from in a context, the ParsedSource AST keeps all the parens from the original source. Something is happening in the renamer to remove the parens around visible type application, causing T12530 to fail, as the dumped splice decl is after the renamer. This needs to be fixed by keeping the parens, but I do not know where they are being removed. I have amended the test to pass, by removing the parens in the expected output. Test Plan: ./validate Reviewers: goldfire, mpickering, simonpj, bgamari, austin Reviewed By: simonpj, bgamari Subscribers: simonpj, goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2752 GHC Trac Issues: #3384
* Work SourceText in for all integer literalsAlan Zimmerman2016-01-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Certain syntactic elements have integers in them, such as fixity specifications, SPECIALISE pragmas and so on. The lexer will accept mult-radix literals, with arbitrary leading zeros in these. Bring in a SourceText field to each affected AST element to capture the original literal text for use with API Annotations. Affected hsSyn elements are ``` -- See note [Pragma source text] data Activation = NeverActive | AlwaysActive | ActiveBefore SourceText PhaseNum -- Active only *strictly before* this phase | ActiveAfter SourceText PhaseNum -- Active in this phase and later deriving( Eq, Data, Typeable ) -- Eq used in comparing rules in HsDecls data Fixity = Fixity SourceText Int FixityDirection -- Note [Pragma source text] deriving (Data, Typeable) ``` and ``` | HsTickPragma -- A pragma introduced tick SourceText -- Note [Pragma source text] in BasicTypes (StringLiteral,(Int,Int),(Int,Int)) -- external span for this tick ((SourceText,SourceText),(SourceText,SourceText)) -- Source text for the four integers used in the span. -- See note [Pragma source text] in BasicTypes (LHsExpr id) ``` Updates haddock submodule Test Plan: ./validate Reviewers: goldfire, bgamari, austin Reviewed By: bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1781 GHC Trac Issues: #11430
* Remove support for "primclass"Joachim Breitner2014-03-161-3/+0
| | | | | | This partly reverts commit e239753c349f925b576b72dc3445934cba8bcd50. Since Coercible is exported via GHC.Types, so "primclass" is no longer needed. The support for => in primops.pp is still required for coerce.
* SIMD primops are now generated using schemas that are polymorphic inGeoffrey Mainland2013-09-221-2/+40
| | | | | | | | | | | | | width and element type. SIMD primops are now polymorphic in vector size and element type, but only internally to the compiler. More specifically, utils/genprimopcode has been extended so that it "knows" about SIMD vectors. This allows us to, for example, write a single definition for the "add two vectors" primop in primops.txt.pp and have it instantiated at many vector types. This generates a primop in GHC.Prim for each vector type at which "add two vectors" is instantiated, but only one data constructor for the PrimOp data type, so the code generator is much, much simpler.
* Allow primclass and class constraints in primopsJoachim Breitner2013-09-131-0/+4
| | | | In preparation for the primitive class Coercible
* Comparison primops return Int# (Fixes #6135)Jan Stolarek2013-08-141-1/+1
| | | | | | | | | | | | This patch modifies all comparison primops for Char#, Int#, Word#, Double#, Float# and Addr# to return Int# instead of Bool. A value of 1# represents True and 0# represents False. For a more detailed description of motivation for this change, discussion of implementation details and benchmarking results please visit the wiki page: http://hackage.haskell.org/trac/ghc/wiki/PrimBool There's also some cleanup: whitespace fixes in files that were extensively edited in this patch and constant folding rules for Integer div and mod operators (which for some reason have been left out up till now).
* Add fixity information to primops (ticket #6026)Michal Terepeta2012-11-231-0/+9
|
* Tabs -> SpacesDavid Terei2012-03-231-14/+6
|
* Use -fwarn-tabs when validatingIan Lynagh2011-11-041-0/+7
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* Assign more accurate code sizes to primops, so that the inliningSimon Marlow2011-05-241-0/+2
| | | | | heuristics work better. Also removed the old unused "needs_wrapper" predicate for primops. This helps with #4978.
* Fix the type sanity test in genprimopcode's Syntax.hs2010-11-18Ian Lynagh2010-11-171-2/+2
| | | | | | We assume this is what it's supposed to be checking. Certainly the old test (t2 == t2) can't be right. Spotted by Andres Loeh.
* Replace genprimopcode's parsec parser with an alex+happy parserIan Lynagh2007-04-101-0/+128
This use was the only thing keeping parsec in core-packages, and we already have a dependency on alex+happy anyway.