Goose  Timeline

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

126 check-ins using file bs/sema/substitute.cpp version c179d0d5b3

2019-08-04
12:53
logic ops: forbid xor between runtime integers of different signedness. check-in: 011df3c4d3 user: achavasse tags: trunk
00:38
Improved the vscode syntax highlighting. check-in: e535403270 user: achavasse tags: trunk
00:04
Apply the ct_int unification fix to ct_string unification. check-in: 5a80915ee6 user: achavasse tags: trunk
2019-08-03
23:38
Fixed the ct_int unification rule, which didn't work correctly against generic function parameters. check-in: 18e3bfa195 user: achavasse tags: trunk
19:29
Implemented the runtime bitwise xor operator. check-in: 1886f5f367 user: achavasse tags: trunk
17:16
  • lexer: handle hex and binary integer literals.
  • builtins: implemented the logic and the compile-time bitwise xor operator.
check-in: bd7954bf0c user: achavasse tags: trunk
14:10
Added support for signed runtime integers and fixed multiple issues with ct_integer to runtime integer conversion. check-in: c7b1aea0a6 user: achavasse tags: trunk
12:08
builtins: added a mechanism to customize the patterns used to match parameter types in builtin function, to be able to create builtin generic functions. check-in: 2f3c7d306a user: achavasse tags: trunk
2019-08-02
23:26
Cleanup: removed an unused method. check-in: 69d5b9d0cc user: achavasse tags: trunk
22:35
Implemented the logic and operator. check-in: 7395ea3ffc user: achavasse tags: trunk
22:28
  • Implemented an "inline cfg" llr instruction that transfer execution control to another CFG.
  • Used the above in the logic or operator, which now works.
check-in: 9a6ae2acd0 user: achavasse tags: trunk
14:32
  • Removed ComplexVariable and related support code in llr. This will be replaced with a much better system.
  • Temporaries are now identified both by a cfg identifier, and an index within that cfg.
check-in: de2ecb573c user: achavasse tags: trunk
2019-08-01
22:49
Implemented the logic or operator. Not functional yet due to an architectural flaw. check-in: d939807dfa user: achavasse tags: trunk
21:11
parser: implemented ComplexValue, which is a value bundled with a CFG whose execution or insertion is a prerequisite to use the value. check-in: 79a134aa8e user: achavasse tags: trunk
20:25
  • CFGs keep track of the number of temporaries that they use
  • Temporaries indices are updated when appending a CFG to another, to avoid collisions
  • Phi now stores its result into a new temporary, instead of returning it directly (Phi has to be at the beginning of a basic block so we can't attach it directly to a value)
check-in: 59b1c58c70 user: achavasse tags: trunk
19:35
llr:
  • Added a function to append a CFG at the end of a specific basick block of another CFG.
  • CFGs can now be eagerly evaluated.
check-in: c1a795a64f user: achavasse tags: trunk
16:35
Cleanup: got rid of a bunch of header files that each contained only one function prototype. check-in: cc50e8025d user: achavasse tags: trunk
15:53
  • Rewrote the operator helpers: they now generate and invoke an overloadable intrinsic.
  • Implemented the logical not operator.
check-in: ed31e6303b user: achavasse tags: trunk
13:53
builtins: implemented intrinsic functions. check-in: b15874568f user: achavasse tags: trunk
2019-07-31
23:27
llr, execute, codegen: implemented the Xor instruction. check-in: 5ec364bc88 user: achavasse tags: trunk
22:40
builtins: implemented some helpers to easily create builtin operators with overloadable extension points. check-in: 39f2220e39 user: achavasse tags: trunk
19:06
llr, execute, codegen: added the Phi instruction. check-in: 52f162f30a user: achavasse tags: trunk
17:20
llr, execute, codegen: added the CreateTemporary instruction. check-in: 498281afd4 user: achavasse tags: trunk
16:06
Function's llr representations lifetimes are now handled by Env, and function values only contain raw pointers to their LLR. This is to avoid leaks with recursive functions. check-in: 1effb3a67a user: achavasse tags: trunk
14:05
Fixed some cyclic reference issues with cyclic CFGs:
  • Moved and renamed sema::CFGBuilder to llr::CFG.
  • llr::Func now owns a CFG pointer, rather than a pointer to its entry BB.
  • Branch and CondBranch now store weak pointers to their target BB.
check-in: d19a6bf065 user: achavasse tags: trunk
10:10
Small cleanup. check-in: 4464b9355c user: achavasse tags: trunk
09:35
Created a syntax highlighting vscode extension for .em files. check-in: a311d6a33e user: achavasse tags: trunk
07:50
Minor fixes. check-in: b288174776 user: achavasse tags: trunk
00:07
Compile time integers are now represented with infinite precision by using llvm::APSInt. check-in: 9988bc3dc8 user: achavasse tags: trunk
2019-07-30
22:44
Implemented the #if statement. check-in: 1767c5b87e user: achavasse tags: trunk
22:09
Cleanup. check-in: 527297d900 user: achavasse tags: trunk
22:05
  • Builtin functions are now explicitely marked if they need to be evaluated eagerly.
  • Using errors out if the expression doesn't evaluate to a constant.
check-in: 3c074f1b7d user: achavasse tags: trunk
20:20
Implemented the if statement. check-in: 866b8caaca user: achavasse tags: trunk
14:25
parser: setup proper visibility rules for nested brace blocks. check-in: 09150fdc1c user: achavasse tags: trunk
13:20
sema: extended cfgbuilder to handle multiple basic blocks. check-in: d3d40f668d user: achavasse tags: trunk
12:46
llr, execute, codegen: implemented Branch and CondBranch. check-in: 3c78ba6139 user: achavasse tags: trunk
2019-07-29
20:01
Implemented the builtin bool type, cleaned up things here and there by making use of it. check-in: e6ed8750c4 user: achavasse tags: trunk
16:40
frontend: use the source filename as the module name. check-in: 71dce5b655 user: achavasse tags: trunk
16:11
First rudimentary version of the front-end. Added a more civilized hello world sample. check-in: c73275098a user: achavasse tags: trunk
15:50
In preparation to implement the first version of the front end, made the current direct file execution behavior available through a special command line options, to keep the current tests working. check-in: c34657ae47 user: achavasse tags: trunk
15:35
Builtins: added a couple of builtin utility string functions needed to bring up the frontend. check-in: de781b5a85 user: achavasse tags: trunk
14:44
Embedded lld and added builtin functions to invoke it. The shitty hello world sample now performs all the steps to produce a functional binary. check-in: 16a9039350 user: achavasse tags: trunk
01:15
  • Fixed a stupid, recent bug in using that was preventing it from registering the import rule to make things from its parent scope visible.
  • Fixed some issues with functions and domains.
  • Added a sample program that (almost) constructs a working hello world binary, manually for now in the absence of a proper front end.
check-in: c1b9248768 user: achavasse tags: trunk
2019-07-28
17:22
codegen: added functions to set the target for a module, and to output a module either as an asm or as an object file. check-in: 0d6a77f7ab user: achavasse tags: trunk
2019-07-27
15:20
codegen: added a function to run the LLVM optimization passes on a module (with default optimization settings for the time being). check-in: db120ccb3a user: achavasse tags: trunk
13:08
Updated a test reference file. check-in: f93a7e7cb4 user: achavasse tags: trunk
13:04
Implemented external runtime functions. check-in: 6a99df8278 user: achavasse tags: trunk
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.
check-in: 7bddd62bf9 user: achavasse tags: trunk
22:30
  • 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.
check-in: f31afce8ce user: achavasse tags: trunk
18:33
llr, codegen: implemented "load constant" instructions for integers and strings. check-in: 443351dafe user: achavasse tags: trunk
16:57
codegen: generate basic blocks. check-in: 8574428775 user: achavasse tags: trunk
13:41
llr:
  • removed GetVar/SetVar for now, to be reintroduced later when implementing local vars.
  • added GetArg, a specific instruction to access function arguments (because codegen will need to treat this differently than accessing a local var).
check-in: efcc646794 user: achavasse tags: trunk
09:28
Added license file. check-in: 7ae7a08ed3 user: achavasse tags: trunk
02:14
codegen: generate correct function types. check-in: 5c095a9872 user: achavasse tags: trunk
01:50
Fix the Env never being deleted due to captured shared_ptr in some builtin functions which created reference cycles. check-in: 1eb3c4a890 user: achavasse tags: trunk
2019-07-25
22:30
Enable ThinLTO. check-in: cd65a705fd user: achavasse tags: trunk
22:17
codegen: handle function types in LowerType(). check-in: 8816e0b6e9 user: achavasse tags: trunk
15:50
builtins: extend GetLLVMType() to handle function types. check-in: eb91eeb361 user: achavasse tags: trunk
15:37
builtins: llvm types are now built and stored at a standard location in the ir expressions of runtime types. check-in: 3f9a7b5082 user: achavasse tags: trunk
14:09
Have the llvm context be a static instance instead of being owned by the Env object, so that we can access it anywhere. check-in: c5a38bbeae user: achavasse tags: trunk
2019-07-24
20:15
func type: change the term encoding to include a void pointer that will be used to link to the function's llvm type, if any. check-in: 403761ee88 user: achavasse tags: trunk
11:41
codegen: revised mangling, allow opaque pointers to be mangled since they are going to appear in native type identities, even though we don't care about what they point to for that purpose. check-in: 86893043c5 user: achavasse tags: trunk
11:03
ir:
  • get rid of the ability for a term to contain a pointer to another term (not used anymore)
  • terms can contain void pointers (to be used to link the term representation of runtime types to their corresponding llvm types)
check-in: 8e5fcb6557 user: achavasse tags: trunk
2019-07-23
19:44
codegen: implemented LowerType. check-in: e42ae3d514 user: achavasse tags: trunk
19:02
Moved overloadset's implementation into sema, as we'll need to keep pointers to some of them (used as extension points) in env. check-in: f8f1fcd169 user: achavasse tags: trunk
13:44
execute: added an execution limit on calls and branch instructions to be able to time out of non-terminating compile time code. check-in: f0b3b44bbb user: achavasse tags: trunk
2019-07-22
15:36
builtins: added a function to test whether a type is a runtime type. check-in: 138905cf4e user: achavasse tags: trunk
14:50
builtins: runtime types: added a common prefix to easily be able to check if a type is a runtime type. check-in: 64244c6d0c user: achavasse tags: trunk
13:15
Added a helper to perform a compile time OverloadSet invocation. check-in: c768853a4f user: achavasse tags: trunk
12:50
builtins: added a helper to create and register an empty OverloadSet, to serve as extension points for the library. check-in: f10b5377f7 user: achavasse tags: trunk
2019-07-21
23:48
Bumped llvm version. check-in: 8648053c0d user: achavasse tags: trunk
2019-07-16
20:06
builtins:
  • fixed runtime type definitions.
  • added definitions for runtime struct types.
check-in: 1f7039ee83 user: achavasse tags: trunk
2019-07-15
21:58
builtins: added definitions for runtime array type. check-in: eade11527c user: achavasse tags: trunk
21:43
builtins: added definitions for runtime pointer type. check-in: 84b541f45b user: achavasse tags: trunk
21:13
sema: removed a couple of superfluous rule lookups when resolving an invocation. check-in: c7da710bb0 user: achavasse tags: trunk
20:21
builtins: added definitions for basic runtime types. check-in: 54b8960363 user: achavasse tags: trunk
19:10
builtins: renamed int and string to ct_int and ct_string to distinguish them from the future runtime and user facing types. In the end there should be little to no reason to ever use these types directly outside of the library anyway. check-in: f40cfaed57 user: achavasse tags: trunk
2019-07-14
19:29
codegen:
  • implemented api to generate functions.
  • implemented tests for function generation.
check-in: ab106469dd user: achavasse tags: trunk
2019-07-13
23:30
  • Added missing quoting around function type's domain.
  • Detect and error out when an using expression is invoked recursively.
  • Fixed passing of generic values to builtin funcs (the pattern used was incorrect and didn't work when passing some types).
  • Added an unification rule to prevent single element tuples from being peeled off when unified against generic values.
  • Implemented an api function to compile a file into a function of a specified type and signature.
check-in: 50da1401ee user: achavasse tags: trunk
19:33
codegen: very first draft of function generation. check-in: 98a6fcaf3f user: achavasse tags: trunk
2019-07-12
20:58
codegen: implemented mangling. check-in: f97c0b2cab user: achavasse tags: trunk
2019-07-11
19:32
Allow overloading of builtin functions. check-in: bff15eb03d user: achavasse tags: trunk
2019-07-09
22:46
codegen: added builtin functions to create a module and to dump it as llvm assembly text. check-in: 429f55ae3c user: achavasse tags: trunk
21:14
Began the implementation of the code generator. check-in: c3a5885c4f user: achavasse tags: trunk
2019-07-08
19:40
Implemented parsing rules for function domain specifiers, and fixed a couple of related bugs. check-in: b39d1cbe9a user: achavasse tags: trunk
2019-07-07
16:22
Parser: parse function type modifiers. check-in: 105ba83ebf user: achavasse tags: trunk
10:33
Parser: refactored function and template function parsing to go through a common code path to build function types. check-in: 5fd301c5f9 user: achavasse tags: trunk
2019-07-06
13:27
Cleanup: remove a superfluous argument from BuildFunc(). check-in: f0724b61e5 user: achavasse tags: trunk
2019-06-29
14:36
Handle execution domains when invoking/unifying functions, template functions, overload sets and constrained funcs. check-in: 2acce94d2d user: achavasse tags: trunk
13:43
Build fixes to work with the latest git version of libc++. check-in: 326d403e6c user: achavasse tags: trunk
11:40
Added a domain specifier in function and template function types. check-in: ef1e94f44d user: achavasse tags: trunk
2019-06-27
19:37
sema: fixed a context creation mistake when resolving an invocation. check-in: 48ee263157 user: achavasse tags: trunk
19:30
sema: when resolving an invocation, attempt first to resolve it as a compile time invocation when applicable. check-in: c046a7f803 user: achavasse tags: trunk
2019-06-23
14:01
Functions are now recompiled for different execution domains as needed. check-in: 25e7ce2c8c user: achavasse tags: trunk
2019-06-22
15:00
Func: functions can be stored in an invalid state which means they couldn't be compiled for a given domain, but still contain enough information to compile/retrieve that function for a different domain. check-in: 87068d0fe8 user: achavasse tags: trunk
2019-06-21
18:22
Domains: setup correct identity domains in a few places. check-in: aaa9d75b0c user: achavasse tags: trunk
2019-06-19
19:49
  • parser: don't hardcode the builtins identity prefix in the rule helpers anymore.
  • builtins: move the common identity prefix used by all builtins into a separate function, to be able to easily change it.
  • builtins: prepend the CompileTime domain specifier to the root builtin identity.
  • sema: don't store the domain separately, extract it from the identity when needed instead.
check-in: cde0c6d0e3 user: achavasse tags: trunk
2019-06-18
21:44
Added some helper functions for domains and identities. check-in: a15bdabfec user: achavasse tags: trunk
2019-06-17
22:00
Pass the sema context to ParseFuncBody(), rather than just the env. check-in: 9320a3b76f user: achavasse tags: trunk
2019-06-16
14:41
Added the current domain to sema context, and include it in function identities. check-in: 7e053c8063 user: achavasse tags: trunk
2019-05-25
10:44
Domains: refactored functions to use the new representation. check-in: cf3bb178ea user: achavasse tags: trunk
2019-05-22
21:35
Execution domains: created a new representation for function values that contains enough informations to retrieve or build the same function for a different execution domain. check-in: cd9b67cf09 user: achavasse tags: trunk
2019-05-04
21:04
Cleanup: make use of c++20 explicit lambda template parameter lists to get rid of some clunky decltype(). check-in: 980e2740bc user: achavasse tags: trunk
2019-04-14
20:10
Small cleanup. check-in: 26ee86b2dd user: achavasse tags: trunk
18:43
Allow any texpr to be used as a function parameter, so we can write a generic parameter as just $a instead of $t $a if we don't care about capturing its type. check-in: da786f812f user: achavasse tags: trunk
17:30
Fixed a test name. check-in: 0ca4414e9d user: achavasse tags: trunk
17:22
Added tests for higher order template functions, and higher order polymorphism. check-in: 185f783a15 user: achavasse tags: trunk
17:07
Added tests for higher order functions, and fixed some previously missed bugs. check-in: 31e4e0e834 user: achavasse tags: trunk
15:18
Added tests for overloading and template functions. check-in: fa01f562ca user: achavasse tags: trunk
14:57
Removed the ct_ prefix from the compile time int and string types for now. It's ugly and we don't need to decide on their names until starting library work anyway. check-in: 2b1598932c user: achavasse tags: trunk
14:53
Fixed a few bugs and started to turn the haphazard test code into proper, automated tests of the core language features. check-in: f78ccdd8a8 user: achavasse tags: trunk
2019-04-13
22:03
api: added a builtin Execute command, which executes the specified file. Also added the possibility to optionally return an error code. check-in: 47708770e6 user: achavasse tags: trunk
10:55
Started a first version of a minimal compile time api to be able to implement proper automated testing of the language features. check-in: b2a8a8ad0b user: achavasse tags: trunk
2019-04-12
19:37
  • cleaned up and refactored llr into a proper cfg representation.
  • added a CFG builder class in sema, currently very rudimentary.
  • split the parser's value building workflow from the llr construction workflow, which now goes through a CFG builder.
  • implemented the return statement.
check-in: 5ea39472a2 user: achavasse tags: trunk
2019-04-11
19:11
llr: add Ret element. check-in: 82591a0918 user: achavasse tags: trunk
2019-04-09
21:38
Higher order polymorphism: changed the representation of constrained func to be explicit instead of just an opaque pointer, so that it can be used as is within function identities. check-in: b7fd77d885 user: achavasse tags: trunk
20:15
Standardize the way function identities are generated, and give overload sets their own identities. This will be necessary to generate proper identities for template functions instanced with polymorphic parameters. check-in: da8245add8 user: achavasse tags: trunk
2019-04-08
22:15
Compare the addresses of pvoid once again in compare to match the behavior of pvoid stored in tries. That change wasn't actually needed anyway. check-in: 0a9cac94de user: achavasse tags: trunk
21:39
func: move the identity back into the llr func, as we will need it some day to generate a label for the code generation. check-in: a307741bd9 user: achavasse tags: trunk
20:29
Higher order polymorphism: fix non-callable template lambdas passed as a generic compile-time parameter. check-in: 007891dc2f user: achavasse tags: trunk
2019-04-06
15:19
Higher order polymorphism: implemented the unification of a polymorphic tfunc type param with an overload set. check-in: 2f27622539 user: achavasse tags: trunk
14:16
  • Simplified TDecl: the right hand side can now only be a TVar. Removed the colon operator.
  • Added the possibility in unification to make hole resolution non mandatory for a sub expression.
  • Higher order polymorphism: implemented the unification of a polymorphic tfunc type param with a template lambda.
check-in: fc331f1703 user: achavasse tags: trunk
2019-04-04
20:08
Higher order polymorphism: refactored TDecl to use its own representation as its signature. check-in: f5fb53ad20 user: achavasse tags: trunk
2019-04-03
20:56
Higher order polymorphism: overloadset and tfunc invocation no longer consider multiple unification solutions with the same score to be ambiguous if they are actually the same solution. check-in: be53d55f67 user: achavasse tags: trunk
2019-04-02
20:38
Higher order polymorphism: implemented ConstrainedFunc unification. check-in: f6c1df5107 user: achavasse tags: trunk
2019-04-01
20:37
sema: implemented SubstituteNamed. check-in: 121c78d7e5 user: achavasse tags: trunk