Commit Graph
103 Commits
Author SHA1 Message Date
Rangi42 155e7287db Store a pointer to the scoped label, not just its name 2024-09-10 21:38:50 +02:00
Sylvie 1dcc000572 Report locations for RGBLINK errors with conflicting objects (#1494)
This requires updating the object file format to record the
fstack context for sections themselves, not just for patches.
2024-09-10 19:23:48 +02:00
Rangi42 15f0871683 Update some names and comments 2024-08-27 14:04:52 -04:00
Rangi42 26fcff831d Run clang-format 2024-08-27 01:49:05 -04:00
Rangi42 fbe28e0def Remove outdated "absolute data" terminology in function names 2024-08-26 22:58:38 -04:00
Sylvie 0e8a17ce82 Report any section overflows at the end of assembly (#1482)
* Report any section overflows at the end of assembly

* Immediately handle overflow of the 32-bit size counter
2024-08-22 18:51:52 +02:00
Sylvie 9a5b3f0902 Implement multi-value charmaps (#1429) 2024-08-04 23:32:08 +02:00
Rangi42 4e0f794c23 More refactoring and renaming 2024-07-26 20:12:51 -04:00
Sylvie 352551d4f8 Allow padding to coexist with overlay file (#1395) 2024-05-17 11:14:44 +02:00
Sylvie 3e9d2cab12 Make some error messages more consistent (#1393)
* Update some error messages

* Make non-A destination operand syntactically invalid
2024-04-20 23:13:01 +02:00
Sylvie a234da42a6 Replace assert with assume for release build optimization (#1390) 2024-04-02 11:09:31 -04:00
Sylvie 1d39e5ed56 Use std::variant for RPN expression value (#1389) 2024-04-01 16:47:15 +02:00
ISSOtm e5078aba3b Clean up #includes
Remove unused headers, and avoid relying on transitive inclusions

`include-what-you-use` has been very useful for this!
2024-03-28 01:25:38 +01:00
ISSOtm cae7b5dcf6 Use standard attribute syntax instead of IBM __attribute__
Move format attrs to proper standard location

For some reason, GCC 13 is more lax than earlier versions...
2024-03-27 20:01:12 -04:00
Sylvie a68bebf4a2 Use a Defer struct to close files and restore lexer state with RAII (#1379) 2024-03-27 10:42:53 -04:00
SylvieandISSOtm 0300971a17 Fix some header #includes with clangd LSP (#1370)
Co-authored-by: ISSOtm <[email protected]>
2024-03-21 15:13:10 -04:00
Rangi42 05d79d87f6 Pass std::string references to RPN functions 2024-03-18 14:42:05 -04:00
Rangi42 e96675be03 Pass std::string references to fstack functions 2024-03-18 14:42:05 -04:00
Rangi42 7b11c528ef Pass std::string references to section functions 2024-03-18 14:42:05 -04:00
Sylvie eb99fc8681 Use a std::unordered_map for looking up sections by name (#1357) 2024-03-13 19:45:52 -04:00
Rangi42 569b940b82 No need to manually do the Expression destructor's job 2024-03-09 19:33:53 -05:00
Sylvie 17444e825a Reduce the header declarations (#1342)
- Since we have style rules to include foo.hpp at the top of its
  corresponding foo.cpp, this takes any headers included by foo.hpp
  as being also guaranteed for foo.cpp.

- Use C-style <foo.h> instead of <cfoo>, since the latter only
  guarantees putting symbols in the `std` namespace, which we are
  not using for C functions (e.g. `printf` not `std::printf`).

- Remove now-unused `__PRETTY_FUNCTION__` reporting
2024-03-09 14:55:39 -05:00
Sylvie 53537cf9af Remove now-unnecessary enum keyword (#1338)
C++ does not need it
2024-03-08 19:40:41 -05:00
Rangi42 75cc12bb3d Use std::optional for fstack paths 2024-03-07 21:41:02 -05:00
Rangi42 097b7c3baf Use std::string for symbol names 2024-03-07 12:40:33 -05:00
Rangi42 bf45ebb178 Run clang-format to fix some inconsistent style 2024-03-07 11:52:53 -05:00
Rangi42 e5b7e65e91 Use std::nothrow from <new> with every new allocation 2024-03-07 09:56:15 -05:00
Rangi42 585c620945 Rename fail to sectError, since it increments nbSectErrors 2024-03-05 14:36:18 -05:00
Sylvie e74073e480 Run clang-format on everything (#1332) 2024-03-04 14:22:49 -05:00
Rangi42 277ea9be28 Replace RGBASM non-null pointers with references 2024-03-03 00:57:03 -05:00
Rangi42 ba00cf5684 Use std::string for section names 2024-03-02 04:47:02 -05:00
Sylvie 1ac3c0262f Refactor structs to use methods instead of functions (#1322) 2024-03-01 13:11:45 -05:00
Rangi42 e14ba664ea Remove redundant (void) parameter declarations 2024-03-01 10:41:47 -05:00
Sylvie 043db49676 Replace NULL with nullptr (#1321) 2024-02-29 15:06:33 -05:00
Sylvie eff8c324c8 Remove now-unnecessary struct keyword (#1320)
C++ acts like structs are `typedef`ed by default

We do have to keep `struct stat`, since there's ambiguity
with the function also called `stat`.
2024-02-29 14:41:58 -05:00
Rangi42 18d4a81954 Use move semantics for the union stacks 2024-02-29 13:44:08 -05:00
Rangi42 843f3394c8 Use automatic allocation for DS args 2024-02-29 13:44:08 -05:00
Rangi42 dec1811d20 Use automatic allocation for section data 2024-02-29 13:44:08 -05:00
Rangi42 72e9f55368 Use automatic allocation for patches 2024-02-29 13:44:08 -05:00
Rangi42 9140180c85 Use automatic allocation for sections 2024-02-29 13:44:08 -05:00
Rangi42 bc8cb754c0 Use std::deque for sections 2024-02-29 13:44:08 -05:00
Rangi42 2ea6de7195 Use std::stack for unions 2024-02-29 13:44:08 -05:00
Rangi42 8083ef605f Use std::deque for section patches 2024-02-29 13:44:08 -05:00
Rangi42 a310b659cd Use std::deque (iterable) for section stack 2024-02-29 13:44:08 -05:00
Sylvie 595c066c2a Remove #include <stdbool.h> (#1317) 2024-02-24 10:51:46 -05:00
Sylvie 6d29d2a67e Simplify fstk_FindFile usage (#1310)
* Simplify `fstk_FindFile` usage

* Use `std::string` for `fstk_FindFile`
2024-02-22 13:14:38 +01:00
ISSOtm 1b08a12b26 Ensure that mid-section align 16 makes PC constant
This makes `align 16` a sort of `org`, which is *very* useful :)
2024-02-18 17:53:56 -05:00
ISSOtm 36dad4380e Honor alignment offset for ALIGN[16, N]
The *one* place where it was missed...
2024-02-18 17:53:56 -05:00
Eldred HabertandRangi42 fd78a9ae83 Port linkerscript parser to Bison (#1266)
Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead

---------

Co-authored-by: Rangi42 <[email protected]>
2023-12-11 02:29:37 +01:00
Rangi 6132b77c1e Add more tests for RGBASM code coverage (#1257)
* Add more tests for RGBASM code coverage

* Use C++ unnamed parameters, not `(void)` casting

* Fix crash in `sect_AlignPC` from #1253
2023-12-01 10:21:43 -05:00