summaryrefslogtreecommitdiff
path: root/lambda/matching.ml
Commit message (Collapse)AuthorAgeFilesLines
* typo fixGabriel Scherer2023-03-051-1/+1
|
* matching.ml: explain the compilation strategy for switches on constructorsGabriel Scherer2023-03-051-9/+50
|
* Fix code duplication in pattern matching of polymorphic variants (#11893)Vincent Laviron2023-01-191-2/+20
|
* ReviewVincent Laviron2022-10-021-9/+8
|
* Stop using integer comparison on potential pointersVincent Laviron2022-09-301-2/+8
|
* add -safer-matching flag to disable type-based optimization of pattern-matchingJacques Garrigue2022-07-191-2/+2
|
* Remove configuration options --disable-force-safe-string and ↵Kate2022-02-011-2/+2
| | | | | DEFAULT_STRING=unsafe (#10893) The compiler should behave as previous versions with `force-safe-string` enabled, and reject with an error any explicit setting that would try to deviate from that.
* Review: reference pull requestsVincent Laviron2022-01-161-2/+2
|
* Bring back and update comment on CamlinternalLazy.force_genVincent Laviron2022-01-161-3/+5
|
* Move opaque wrapper to compiler-generated codeVincent Laviron2022-01-161-30/+17
|
* Merge commit '2250fd8a2218796c07b0a25f184cdc682e4695ba' into 5.00_rebase_to_prTom Kelly2021-12-201-6/+19
|\
| * abstract row_field (#10627)Jacques Garrigue2021-10-221-2/+2
| | | | | | Co-authored-by: Takafumi Saikawa <tscompor@gmail.com>
| * Enforce boolean Lifthenelse in native modeVincent Laviron2021-10-211-4/+17
| |
* | matching.ml now uses obj_tag primitive. Revert test changes. Fix bug.KC Sivaramakrishnan2021-11-301-5/+5
| |
* | update CamlinternalLazy.force to force_genJan Midtgaard2021-11-081-2/+2
| |
* | remove historical for_handler and Reperform_noaloc in lambda/matchingTom Kelly2021-10-111-10/+4
| |
* | Merge commit '8da8b7e028431f02bc85c641965133bff68220e0' into 5.00Tom Kelly2021-10-041-2/+5
|\ \ | |/
| * [minor] switch.ml: distinguish types for arguments, tests and actionsGabriel Scherer2021-09-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, Switch will use 'make_if' either with tests explicitly constructed from the provided primitives, or with a matching scrutinee/argument directly to check that it is non-zero. (Arguments are expected to be implicitly coercible to booleans for the 'make_if' functions.) This assumption may not always hold, for example if we tried to define a switch construct on tagged integers in asmcomp/cmm_helpers.ml. (I have a followup commit doing just that.) The comparison primitives of Cmm return untagged booleans, the conditional test is untagged, but a tagged integer cannot be tested for non-zeroness by just using untagged 'if' directly. The present commit clarifies the matter by separating the type of actions, tests and arguments at the Switch level. It does not change behavior in any way, but it makes it much easier to follow these distinctions. (In particular, it the new typing discipline demonstrates that the dangerous use of 'make_if' only happens exactly once in the Switch functor.)
* | Merge commit '7ad8c1368346c8a9d492f130442bff48807961b4' into 5.00Tom Kelly2021-10-041-9/+4
|\ \ | |/
| * Force normalization on access to `row_desc` (#10474)Jacques Garrigue2021-09-101-9/+4
| | | | | | | | | | | | * always row_repr * remove the dummy field `row_bound` Co-authored-by: Takafumi Saikawa <tscompor@gmail.com>
* | Merge commit '0ba253df4667668bc01dd9e239fba13f743e1752' into ↵Tom Kelly2021-10-011-3/+3
|\ \ | |/ | | | | parallel_minor_gc_4_13
| * Make build_other_constrs work with names instead of tags. (#10428)Nicolas Chataing2021-05-281-3/+3
| | | | | | | | | | | | parmatch: define build_other_constrs using names instead of tags. Using tags is fragile in presence of Cstr_unboxed; we use constructor names instead.
* | Merge commit '89aae98b22634d896b9d59f717decf2d3e7d4af3' into ↵Tom Kelly2021-09-291-2/+2
|\ \ | |/ | | | | parallel_minor_gc_4_13
| * Allow to name existentials in pattern-matching (#9584)Jacques Garrigue2021-02-041-2/+2
| |
* | Merge commit 'd0f80077066105e1429ef8728b8362b8d698e298' into ↵Tom Kelly2021-09-291-2/+3
|\ \ | |/ | | | | parallel_minor_gc_4_13
| * added new construct Lmutlet and removed Variable attributeKeryan Didier2021-01-071-0/+1
| |
| * added new lambda construct Lmutvar (#9954)Keryan Didier2021-01-071-2/+2
| |
* | Merge commit 'e6acde75863c7a4e52f948f87436a53a2fe50f42' into ↵Tom Kelly2021-09-281-83/+45
|\ \ | |/ | | | | parallel_minor_gc_4_13
| * matching: use toplevel_handler in for_tupled_functionGabriel Scherer2020-11-211-17/+8
| | | | | | | | | | | | This appears to change the function behavior with respect to the Unused exception, but we believe that the change is correct. It makes the code more consistent with other toplevel compilation functions.
| * matching: factorize the code handling toplevel matching failuresGabriel Scherer2020-11-211-61/+35
| |
| * matching: [minor] inline the single-use split_and_precompileGabriel Scherer2020-11-211-7/+4
| | | | | | | | | | This comes from a suggestion by Florian Angeletti in https://github.com/ocaml/ocaml/pull/9447#discussion_r408910756
* | Merge commit '055f04d189273068396da8c298e6226dff90f26c' into ↵Tom Kelly2021-09-281-92/+173
|\ \ | |/ | | | | parallel_minor_gc_4_13
| * matching: clarify the ~vars argument of Simple.explode_or_patGabriel Scherer2020-10-211-9/+11
| | | | | | | | (suggested by Thomas Refis' review)
| * matching: simplify the interface of Simple.explode_or_patGabriel Scherer2020-10-211-14/+12
| |
| * Matching.Simple.explode_or_pat: on-demand generation of fresh identifiersGabriel Scherer2020-10-211-16/+24
| | | | | | | | This change was suggested by Thomas Refis during code review.
| * add a comment to explain what Simple.explode_or_pat doesGabriel Scherer2020-10-211-0/+24
| |
| * matching: avoid useless bindings in do_for_multiple_matchGabriel Scherer2020-10-211-1/+3
| |
| * matching: towards a correctness argument for flatten_* ignoring variablesGabriel Scherer2020-10-211-9/+11
| | | | | | | | | | | | | | | | | | | | Before we ignored as-patterns in the flatten_* functions because as-patterns would either be half-simplified or raise Cannot_flatten (in any case, never reach the flattening functions). Now the reasoning is a bit more subtle: the only non-simple matrices we flatten are used as "ghost" information (default environments, provenance) where variables do not matter, only the shape of matched values.
| * Match.do_for_multiple_match: we can always flattenGabriel Scherer2020-10-211-35/+21
| |
| * Matching.explode_or_pat: handle the case where the argument has no idGabriel Scherer2020-10-211-34/+54
| |
| * matching: document the behavior of precompile_or through an exampleGabriel Scherer2020-10-211-0/+39
| |
* | Merge commit '01c6a5ebe38b680a0b104aa4075ff790f311ea01' into ↵Tom Kelly2021-03-041-45/+68
|\ \ | |/ | | | | parallel_minor_gc_4_12
| * matching: a first-order representation for match-failure handlingGabriel Scherer2020-07-081-42/+53
| |
| * pass a proper location to Matching.for_trywithGabriel Scherer2020-07-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | Actually *using* the location in the failure handler would be incorrect, as it adds noise to backtraces involving partial exception handlers. This is now properly documented. We still take the caller location (which is currently ignored) for consistency with other toplevel Matching functions, and because that may become useful if we want to add more error-reporting or warnings in compile_matching.
* | Merge commit '368eb16ee80843afc6c40cf98e6994256747844a' into ↵Tom Kelly2021-03-041-2/+2
|\ \ | |/ | | | | parallel_minor_gc_4_12
| * change API for Env.open_signature to clarify errorsJacques Garrigue2020-06-231-2/+2
| |
* | Merge commit 'b7509ca82f9bd647c1cb7e810b6bb152e145e3fb' into ↵Tom Kelly2021-03-031-9/+9
|\ \ | |/ | | | | parallel_minor_gc_4_12
| * Merge pull request #9442 from gasche/tailcall-attribute-refactoringGabriel Scherer2020-06-101-3/+3
| |\ | | | | | | [minor] refactoring the datatype for the [@tailcall] attribute
| | * [refactoring] gives tailcall attributes a more standard structureGabriel Scherer2020-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to start allowing more information in the payload of [@tailcall] attributes (currently no payload is supported), for example we could consider using [@tailcall false] to ask the code generator to disable a tail call. A first required step in this direction is to use a custom datatype to represent the tail-call attribute, instead of a boolean. This is consistent with the other application-site attributes (inline_attribute, specialise_attribute, local_attribute), so it makes the code more regular -- but the change itself is boilerplate-y.
* | | Merge commit '56f7500f5c2d8aa0784bfbd692bf1a191fb7271b' into ↵Tom Kelly2021-03-031-25/+27
|\ \ \ | |/ / | | | | | | parallel_minor_gc_4_12