jak-project/goalc/compiler
ManDude cd68cb671e
deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00
..
compilation deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
docs LSP: OpenGOAL Feature Support - Part 1 (#2668) 2023-05-21 17:24:23 -04:00
CodeGenerator.cpp [goalc] reduce compiler memory usage (#2247) 2023-02-24 18:32:30 -05:00
CodeGenerator.h game: Remove temporary CLI arg shim in gk (#2532) 2023-04-22 14:13:57 -04:00
Compiler.cpp [compiler] asm-only disasm output + fix spacing bug (#3104) 2023-10-29 10:16:14 +00:00
Compiler.h [compiler] asm-only disasm output + fix spacing bug (#3104) 2023-10-29 10:16:14 +00:00
CompilerException.h split new pc features in some files into their own code files + address some old issues + ripple graphics improvements (#2216) 2023-02-13 21:39:14 +00:00
CompilerSettings.cpp [goalc] Cleaned up speedups (#3066) 2023-10-07 10:48:17 -04:00
CompilerSettings.h [jak2] support for multiple out/ directories (#1585) 2022-06-30 21:11:58 -04:00
ConstantValue.h lint: add include sorting config to clang-format (#1517) 2022-06-22 23:37:46 -04:00
Env.cpp [goalc] Cleaned up speedups (#3066) 2023-10-07 10:48:17 -04:00
Env.h [goalc] Cleaned up speedups (#3066) 2023-10-07 10:48:17 -04:00
IR.cpp misc low hanging fruit fixes (#3034) 2023-09-27 00:59:07 +01:00
IR.h [jak2] GOAL side texture animation stuff (#2766) 2023-06-24 10:11:47 -04:00
Label.h Add #pragma once to all headers 2020-09-13 21:36:35 -04:00
Lambda.h [goalc] Cleaned up speedups (#3066) 2023-10-07 10:48:17 -04:00
StaticObject.cpp lint: add include sorting config to clang-format (#1517) 2022-06-22 23:37:46 -04:00
StaticObject.h lint: add include sorting config to clang-format (#1517) 2022-06-22 23:37:46 -04:00
SymbolInfo.h docs: Automatically generate documentation from goal_src code (#2214) 2023-02-20 19:49:37 -05:00
Util.cpp [goalc] Cleaned up speedups (#3066) 2023-10-07 10:48:17 -04:00
Val.cpp [jak 2] fix boot, increase level heap sizes (#2252) 2023-02-25 15:20:17 -05:00
Val.h [goalc] default to non-immediate lambdas if not requested (#2604) 2023-04-30 19:00:27 -04:00