Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IR: Let primitive expressions take manifest arguments (#572)
Triggered by the clean-up necessary post #560 I finally fixe something that bothered me a long time: The IR pretends that primitive values are first-class functions, but they are never compiled that way (and should not, and maybe even cannot, as in the case of `@serialize` with a lying polymorophic type), instead they _always_ have manifest arguments. So this gives `PrimE` an `exp list`. At this point, there is no fundamental difference anymore between an unary operation and a primitive with one argument. So unary and binary operations and relations become just one such primtive operations. This removes redundancy in IR-to-IR passes. There is currently an `OtherPrim` constructor that still takes a string. Eventually, this should disappear, replaced by an ADT of the actual prims we support, e.g. a `NumericConversion of (Type.prim, Type.prim)` constructor instead of the unstructured `"Int->Word32"` strings right now. This would also allow for a nicer backend, as common code is easiler shared between the many conversions.
- Loading branch information