Delay StartNotDefined error until after typechecking
Make Pair a builtin datatype
Fix fun-match globals not allowed to be recursive
;; This was and should be allowed
(define (foo x) (foo x))
;; This was and should be disallowed
(define foo foo)
;; This was disallowed, but should be allowed
(foo (deref x))))))
Disallow . Add "case" keywords to match-expression to read better
Add basic import system. Basically C-style include
Refactor Codegen. Separate module for ABI-related stuff
Also had to separate a module for the Gen-monad, as Haskell can't have
Allow integer and boolean literals in patterns
Could exploit the existing Match.PCon constructor to represent not
just datatypes, but these other enumerables as well. Didn't have to
make many additions/modifications at all -- quite nice!
Verify LLVM module before compiling to catch errors
Of course, these are internal compiler errors, but they're better to
catch in `verify` for debugging purposes. Previously, LLVM would just
segfault when processing a malformed module.
Fix incorrect from-label used in phi-node of decision switch
Fix bools not truncated from i8 to i1 for condbr
Improve gen of str lits
Instead of just defining a global var for the raw byte array and
create a Str struct at every "call"site, define 2 global vars -- one
for the raw bytes, and one for the Str structs defined in terms of it.
Scale datatype tag size by n of variants. 1 variant => no tag
Types with only 1 variant have no tag. Types with <=2^n variants have
Fix struct member padding set to alignment when remainder = 0
Fix some harmless warnings
Get rid of extractvalueFromNamed, use lookupDataType in extractvalue
Complete (bad-ish) fizzbuzz!
Fix wrong size of bools. Was i1, C ABI says i8.
Not sure exactly what happened before, but in practice, bools
often/always had the opposite value.
Impl sizeof ourselves instead of relying on messy getTypeAllocSize
The problem with the earlier approach was that we had to pull in the
IO-related EncodeAST monad in our Gen stack, and the implementation to
call getTypeAllocSize was kind of messy, as llvm-hs didn't expose it
other than in an Internal module.
EncodeAST in Gen (and Gen') prevented use of `mfix`, which I needed.
Also note that we had to change Map.Strict to Map, as, of course, we
can't have recursive bindings in the strict Map.
Move some Pretty instances from module Codegen to Misc