1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-20 03:16:45 +00:00

Alias improvements:

– aliases can now override other objects
– take aliases into account when ordering functions for optimizations and inlining
This commit is contained in:
Karol Stasiak
2018-12-19 17:33:51 +01:00
parent 49ee0fd3a2
commit fc10746522
12 changed files with 65 additions and 10 deletions
+9 -1
View File
@@ -66,7 +66,7 @@ TODO
### Alias definitions
`alias <alias> = <name>`
`alias <alias> = <name> [!]`
Sets an alias for a global name.
Unless shadowed by a local name, the alias will point to the given global object:
@@ -86,6 +86,14 @@ Unless shadowed by a local name, the alias will point to the given global object
Aliases can be used for variables, arrays, constants, functions, and types,
but not for text encodings, array formats or keywords.
If the alias definition is followed by a `!`, then the alias overrides any other definition of that name.
This allows for overriding definitions of library functions by another library:
void f() {}
void g() {}
alias f = g!
// now the original f is removed and all calls to f will call g instead
### Array declarations
An array is a continuous sequence of bytes in memory.