Goose  History of bs/builtins/types/runtime/typecheck.cpp of ba909d1a948a6dfd

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of file bs/builtins/types/runtime/typecheck.cpp at check-in ba909d1a948a6dfd

2024-09-15
20:24
Add clang format settings, reformat everything file: [73b12fe6ee] check-in: [0db147f117] user: achavasse branch: cir-ssa-refactor, size: 5541
2023-08-13
18:04
It turns out cmake hadn't, in fact, failed me for the last time: migrating back from meson to cmake file: [4e00304050] check-in: [9722f7aa3f] user: zlodo branch: trunk, size: 5264
2023-03-28
19:44
Get rid of the TCRINFOS macro, use std::source_location instead to remove some noise file: [435c3c61df] check-in: [d9414ddc6f] user: zlodo branch: trunk, size: 5262
2023-01-05
19:44
Fixed passing tuple by value to functions, which involved properly handling type checking of constant tuples containing computed data and some codegen bugs file: [ed0c126dee] check-in: [9b8306c3af] user: zlodo branch: trunk, size: 5292
2021-11-11
20:05
Refactored the code builder: it is now carried around as a Value, and accessed through a bunch of extension points, so we can have different builders (and even user defined ones) later to make classes etc. file: [ef34d352aa] check-in: [1ad61a2717] user: zlodo branch: trunk, size: 4601
2021-09-13
21:52
  • Implemented a generic wrapper for the simple native types that can be embedded in Terms
  • Added more specific overloads for the assignment operator that should work only on builtin types, so that library and user defined types will be able to choose whether they're copyable
  • The EIR representation for all builtin runtime types are now prefixed with "rt_type" to more easily write generic matching rules against them
  • EIR: Fixed long standing bugs in Enumerate and Decompose that surfaced because of the above
  • Miscellaneous code cleaning
file: [503d887f14] check-in: [51f288ba2a] user: achavasse branch: trunk, size: 4631
2021-09-12
16:48
  • Started work on extensibility api
  • some code cleanup
file: [48822f928e] check-in: [55beba911a] user: achavasse branch: trunk, size: 4563
2021-08-31
23:10
  • Added extension points to transform parameter types and function arguments
  • Fixed the incorrect type predicate type checking rule which should just preserve the argument's predicates as is
  • Fixed verification of return intructions that were checking the returned value's predicates, instead of the return type predicates (which happened to work anyway until the above fix)
file: [39740900f4] check-in: [4b842721d2] user: achavasse branch: trunk, size: 4569
2021-08-28
17:55
  • Instead of falling back to unification as the default type checking rule, implemented default type checking rules similar to the default unification ones
  • Fixed a nasty generator bug
  • Fixed reference type parsing not generating a location
  • Fixed where operator not generating a location that spanned both the types and the predicates
  • Various fixes to accomodate random api changes in the latest llvm
  • Updates fmt and catch2 versions
file: [dd0c346170] check-in: [46e87c202b] user: achavasse branch: trunk, size: 4570
2021-06-11
11:42
  • Removed the Conversion step, it could all be done using PostProcessing callback, there were just TypeChecking rules missing to unwrap the callbacks...
  • Fixed some ill defined reference type checking rules
  • Runtime integers no longer have a default initializer of 0. This isn't that useful considering that 0 may not be valid depending on the refinement conditions applied to the type
file: [df4f1b7a4c] check-in: [91a6550edb] user: achavasse branch: trunk, size: 4569
2021-03-17
00:41
  • Added a Conversion step after typechecking, to take care of conversions that aren't practical to do during typechecking itself.
  • Added back a proper ct_int to rt_int conversion step that diagnoses out of range integer constants
file: [384ecbdfa4] check-in: [b48e7b7507] user: achavasse branch: trunk, size: 5257
2021-03-04
21:47
  • Refactored and simplified the way integer and string constants are handled: we no longer try to resolve them during typechecking, this breaks when parametric types are involved and also it makes no sense, typechecking is about types, not values
  • Fixed multiple places where locationIds weren't propagated
  • Verifier: variable assignments now verify the destination variable type's refinement conditions
  • Fixed a test where the above change detected a bug, kept the bugged version as a new verification failure test
file: [9158d05369] check-in: [3cf6ab5249] user: achavasse branch: trunk, size: 2999
2021-02-25
12:10
Implemented a new method to order function overloads. Enabled several new reference tests which are now working properly. file: [a876527a80] check-in: [52ea24b083] user: achavasse branch: trunk, size: 7620
2021-02-01
12:56
Correctly handle references to references, plus some code cleaning. file: [a8f50e3582] check-in: [ba909d1a94] user: achavasse branch: trunk, size: 7357
2021-01-13
11:46
Sema: simplification: the "half-unification" rules don't need to be generators, they can only output one result. file: [847ab1e033] check-in: [3bf30e74ac] user: achavasse branch: trunk, size: 7366
2021-01-02
18:00
Some more renaming. file: [85b842e726] check-in: [0345b9f807] user: achavasse branch: trunk, size: 7459
2020-12-27
14:40
Renamed "ir" to "eir" (expression intermediate representation) and "llr" to "cir" (code intermediate representation) for clarity. file: [1d3a4b3224] check-in: [7d2def7b75] user: achavasse branch: trunk, size: 7519
2020-07-02
00:47
  • Added overloads to the comma operator to be able to construct tuples of references.
  • Fixed reference typechecking rules so that overloads taking values directly have priority over overloads taking references.
  • Fixed a template function expression parsing bug.
file: [7415008b26] check-in: [04aea08600] user: achavasse branch: trunk, size: 7518
2020-06-27
22:05
Renamed and modified bs/builtins/types/runtime/unify.cpp → bs/builtins/types/runtime/typecheck.cpp. Clearly separate the type checking rules and the unification rules, instead of lumping them all together in a single set of patterns which is increasingly confusing. file: [65254ece1e] check-in: [b64ea47f6b] user: achavasse branch: trunk, size: 7507
2020-06-15
22:09
Refactored the integer/ct_int unification to defer the size/sign check to a postprocessing callback. file: [863866eacd] check-in: [ac4e681af3] user: achavasse branch: trunk, size: 7920
2020-06-13
22:59
  • Implemented Initialize overloads for tuples.
  • Lots of cleanup.
file: [4a50117dc1] check-in: [947b9d7cfc] user: achavasse branch: trunk, size: 7133
2020-05-23
12:58
  • Fixed the hole matching score which prevented some unification rules to be selected.
  • Implemented LowerTypeForRuntime for tuples.
  • Implemented an unification rule for constant tuples.
  • Added some debugging helpers.
file: [255556111d] check-in: [c39a302502] user: achavasse branch: trunk, size: 7091
2020-01-22
22:14
Standardized the way type values are encoded to make room for an optional pointer to a list of predicates for refinement types. file: [b06161ef0b] check-in: [cc380f4f8f] user: achavasse branch: trunk, size: 7028
2019-12-05
17:40
Implemented a helper to check whether a type is compile-time only. file: [72a21b14e2] check-in: [12f37d77cb] user: achavasse branch: trunk, size: 7146
2019-09-22
14:37
Project renaming. file: [9dd5078278] check-in: [af650a9e95] user: achavasse branch: trunk, size: 7129
2019-09-07
16:53
ir: rewrote the super inefficient "term versus trie" matching function. This speeds up everything significantly: compiling the mandelbrot sample is no longer embarrassingly slower than compiling an equivalent c++ version with clang. file: [5453969da2] check-in: [0db33d7cb4] user: achavasse branch: trunk, size: 7135
2019-08-29
20:12
Params are now encoded distinctly from normal values, to allow for more generic unification rules for things suchs as BigInt versus Integer. file: [d9f983102e] check-in: [6e598fe891] user: achavasse branch: trunk, size: 7137
2019-08-25
01:54
  • Got rid of the LoadConstInt instruction and directly handle integer constants in codegen. The old system didn't work for compile-time evaluated runtime integers.
  • Added missing implementations for unsigned comparison, that were somehow forgotten.
  • Implemented the nullptr constant.
  • Made a test version of the mandelbrot sample that gets both compiled and interpreted and whose results are compared with the same reference file, as a sanity test that interpreted and compiled code behave identically.
file: [44a9c97834] check-in: [9a68159d52] user: achavasse branch: trunk, size: 7473
2019-08-16
14:48
Added a new type of template expression: TVec, along with a helper function to make it possible for parametric types to be constructed either normally or as a template expression when passed template parameters. Only used by LocalVar for now, parametric runtime types require some refactoring. file: [b9d532a97a] check-in: [27fc719d74] user: achavasse branch: trunk, size: 6540
2019-08-11
17:18
  • Converted more error messages to the new system.
  • Propagated value locations in some missing places.
  • Added the location of template function calls as diagnostics context.
file: [2f896ba8d2] check-in: [b8548d8b24] user: achavasse branch: trunk, size: 6543
2019-08-09
19:54
Cleanup: got rid of the half-assed location and poisoning systems in ir::Terms. file: [1d12b91b97] check-in: [aee388d9c0] user: achavasse branch: trunk, size: 6013
2019-08-07
01:56
  • Implemented some missing compile time instruction execution for unsigned ints.
  • C++ integer types are now mapped to fixed size integer types, rather than BigInt, now that the former are available at compile time.
  • The binary shift operators for ct_int now take an uint32 as their right hand side operand, rather than a ct_int.
file: [b9804570ae] check-in: [a67a742689] user: achavasse branch: trunk, size: 6015
2019-08-06
22:22
Renamed runtime types, because most of them (except pointers) will have to be available during compile time as well, so their names may as well be generic. file: [91400c9cfb] check-in: [fbc9052f6a] user: achavasse branch: trunk, size: 5920
2019-08-05
17:46
Implemented a wrapper around llvm::APSInt for compile time integers to manage mixing operations on integers of different bitsizes, and to automatically extend them as needed. file: [3702afa4f1] check-in: [2bee844d3c] user: achavasse branch: trunk, size: 5923
02:45
  • Unification now works in two passes. The second pass gives unification rules a chance to match again after all the holes have been resolved and substituted.
  • Fixed many horrible bugs in various unification rules that managed to go by unnoticed until the above change, after which they made everything catch on fire.
  • Simplified the ct_int and ct_string unification rules to take advantage of the new unification behavior. Everything finally works as intended wrt to ct_int versus RT integers.
  • Removed unification callbacks. It was a system to provide a way to perform unification work post hole substitution, so it is now obsolete.
file: [ce9cd387f8] check-in: [43e22af793] user: achavasse branch: trunk, size: 6050
2019-08-04
00:04
Apply the ct_int unification fix to ct_string unification. file: [a27a4d237c] check-in: [5a80915ee6] user: achavasse branch: trunk, size: 8991
2019-08-03
23:38
Fixed the ct_int unification rule, which didn't work correctly against generic function parameters. file: [0accef60fd] check-in: [18e3bfa195] user: achavasse branch: trunk, size: 7838
17:16
  • lexer: handle hex and binary integer literals.
  • builtins: implemented the logic and the compile-time bitwise xor operator.
file: [806a3a26e5] check-in: [bd7954bf0c] user: achavasse branch: trunk, size: 3251
14:10
Added support for signed runtime integers and fixed multiple issues with ct_integer to runtime integer conversion. file: [0d9380a6a8] check-in: [c7b1aea0a6] user: achavasse branch: trunk, size: 3179
2019-08-01
22:49
Implemented the logic or operator. Not functional yet due to an architectural flaw. file: [419359b546] check-in: [d939807dfa] user: achavasse branch: trunk, size: 2654
2019-07-26
23:52
  • builtins: added an unification rule of ct_string against runtime byte pointer, that emits a "load constant string" instruction.
  • codegen: load string constant: generate global llvm constant byte arrays and deduplicate them.
file: [336a3e74b6] check-in: [7bddd62bf9] user: achavasse branch: trunk, size: 2698
22:30
Added:
  • Implemented an unification rule of ct_integer versus rt_integer.
  • Fixed multiple bugs related to compile time eager evaluation.
  • Fixed incorrect usage of CompileFunc which resulted in not actually calling the domain specific version of the function.
file: [6d037de2b6] check-in: [f31afce8ce] user: achavasse branch: trunk, size: 1529