Commit Graph

194 Commits

Author SHA1 Message Date
Sven/Sarah Barth
ead882f58d * fix #40876: correctly check for generic constant parameters without concrete value
+ added test
2025-01-02 13:24:46 +01:00
Sven/Sarah Barth
dedc018beb * when parsing generic parameter types allow the use of generics that are part of the current specialization stack (this can be the case if a generic is used inside itself as a type parameter for a specialization)
+ added tests
2024-12-27 16:32:06 +01:00
Sven/Sarah Barth
9b63123bf0 + add utility function to check whether a generic belongs to the currently parsed generic even if it's further up in the specialization stack 2024-12-27 16:32:06 +01:00
Sven/Sarah Barth
8f81b213dc * keep track of the current generic def in the specialization state 2024-12-27 16:32:06 +01:00
Sven/Sarah Barth
db83f9c696 * keep track of the current specialization state of the current module 2024-12-27 16:32:06 +01:00
Sven/Sarah Barth
79ff74ac44 * fix #41007: only unlink typesyms from their typedefs when releasing an unused implicit specialization if the typesym was created for the implicit specialization
+ added test
2024-12-26 18:08:09 +01:00
Frederic Kehrein
05b73f1523 Postponing building of VMT until inheritance chain is specialized
This commit does 3 changes:
1. Introduce new option `oo_inherits_not_specialized` indicating if
   somewhere in the inheritance chain of an object there is a non
   specialized generic parameter
2. Avoid building the VMT for an object which has a generic parameter in
   the inheritance chain (fixes #40983)
3. When no vmt is build `insert_struct_hidden_paras` usually called as
   part of `build_vmt` will be called seperately to add missing
   parameters
2024-12-08 17:54:50 +00:00
florian
75d7b66bdf * compilation fixed
* cosmetics: trailing spaces removed
2024-10-27 17:54:34 +01:00
Rika Ichinose
326776c7fa Turn TCallCandidates into an object, make it create FIgnoredCandidateProcs on demand, and outline such adding on demand into dedicated TFPList.AddOnDemand. 2024-10-27 16:45:35 +00:00
florian
44d9234f38 * properly unlink unused type symbols from their defs to avoid
internal errors when generating debug info, resolves #40886
2024-09-20 22:49:08 +02:00
Michaël Van Canneyt
1743df7b80 * Patch by Evgenii Savin to avoid IE 2010021502 when calling generic from other generic. Fixes issue #40770 2024-07-12 18:04:57 +02:00
Alligator-1
b64701da1b Partial revert "Immediately set the capacity"
(capacity assignments of type TFPHashObjectList)
2024-07-09 08:30:34 +05:00
Alligator-1
9caabdc4e7 Immediately set the capacity 2024-07-08 20:17:11 +00:00
Alligator-1
ffaeec243a Immediately set the capacity 2024-07-08 14:51:39 +05:00
Michaël Van Canneyt
9e8f09b93f * Properly reset state when (re)compiling, by Artem Izmaylov. Fixes issue #40825 2024-06-20 11:52:02 +02:00
florian
1222456c13 * allow [] for constant set constraints, resolves #37020 2024-04-13 22:28:54 +02:00
Michaël Van Canneyt
22de07446d * Fix tgeneric91, need to postpone some additional generic procedures 2024-03-07 16:12:24 +01:00
Michaël Van Canneyt
6ac14de986 * Properly handle finish state 2024-03-05 07:56:14 +00:00
Michaël Van Canneyt
0bf0f26dd5 * Introduce m_processed 2024-03-05 07:56:14 +00:00
florian
906571fa25 * improve pretty printing of symbols 2024-02-19 20:41:08 +01:00
Michaël Van Canneyt
ade7af5234 * Refer to bugreport for internal error 20231102 2023-11-08 00:04:18 +01:00
Michaël Van Canneyt
63a8fe07ee * Avoid access violation, use internalerror instead. See also issue #40502 2023-11-06 10:54:15 +01:00
florian
589fb20386 * write pretty symbol name of a generic is not found during specialization 2023-11-04 22:43:53 +01:00
Michaël Van Canneyt
a9cc89ff46 * Allow hidden units to be found when replaying generic 2023-07-27 18:40:34 +02:00
Sven/Sarah Barth
e8fcc5343b * use new chartype_for_stringlike function to retrieve the char type for a stringlike def instead of casting to a stringdef 2023-01-26 07:07:34 +01:00
Jonas Maebe
a641860fa8 Implicit specialisation: use regular array parameters for array constructors
Fixes compilation of test/timpfuncspez5 with LLVM and debug info, as the LLVM
debug info writer internalerror's when you try to generate debug info for
an array constructor (since those types should never appear as parameter/
variable types).

Replace them with reusable regular array types, so that multiple invocations
of the same generic function with array constructors of the same type and
number of elements are collapsed into the same specialisation
2023-01-03 21:44:44 +01:00
Sven/Sarah Barth
f0e31628ad * ensure that hmodule is initialized correctly 2022-10-29 12:15:59 +02:00
Sven/Sarah Barth
e050a019a2 * fix #29859: ensure that it's correctly passed down into generate_specialization whether a unit name was provided for the specialization and if so search the generic only in that unit
+ added tests
2022-10-28 17:40:53 +02:00
florian
3fa77a4f62 * fix life information propagation for while loops, resolves #39971
* warnings/errors fixed which are caused by the new life information propagation
  + test
2022-10-24 22:13:43 +02:00
Sven/Sarah Barth
61debb1559 * fix #39869: correctly check whether the recorded token stream still needs to be parsed (the replay depth of the scanner needs to be *larger* than what it was before starting the playback)
+ added test
2022-08-18 23:09:01 +02:00
Sven/Sarah Barth
b2a5334a75 * fix #39795: when extracting make_prettystring it was forgotten to also append the const part of the name to the specialize name 2022-06-22 09:44:21 +02:00
Sven/Sarah Barth
897f0e1784 * if a symbol is not part of a symtable then assume it's from the current module 2022-05-26 21:43:40 +02:00
Sven/Sarah Barth
b5ab81c983 * an internal definition in a specialization might not have a genericdef 2022-05-26 21:43:40 +02:00
Sven/Sarah Barth
533a11ec80 * correctly handle calling convention for function references 2022-05-26 21:43:39 +02:00
Sven/Sarah Barth
06a00b53c3 * also handle function references when a generic one had been parsed 2022-05-26 21:43:39 +02:00
Sven/Sarah Barth
ec96d4242a * check hierarchy of the current generic or specialization def independant of whether it's a record- or objectdef 2022-05-26 21:43:38 +02:00
Sven/Sarah Barth
f02fc4fe0f * move checking for a def in the hierarchy to a separate nested function and use it to check the hierarchy of the current def being specialized as well 2022-05-26 21:43:38 +02:00
Sven/Sarah Barth
7de854ef1e + add method register_implemented_interface to tobjectdef which registers an implemented interface and - if desired - also initializes the GUID related fields of the objectdef
* use that method in all locations outside symdef that add add an implemented interface

Based on work by Blaise.ru
2022-05-26 21:43:37 +02:00
Sven/Sarah Barth
eaeb614887 + provide a tsym based variant of ChangeOwnerAndName 2022-05-26 21:43:36 +02:00
Sven/Sarah Barth
acee4eb27a - apply patch by Blaise.ru: pdflags are no longer required in generate_specialization_phase2() after parse_proc_directives() was done, so remove its unused modification after that call 2022-05-26 21:42:54 +02:00
Sven/Sarah Barth
9c9c6cc81b * apply patch by Blaise.ru:
- all call sites of parse_var_proc_directives() have the tprocvardef easily available, so use parse_proctype_directives() directly
  - remove the now no longer required parse_var_proc_directives()
2022-05-26 21:42:53 +02:00
Sven/Sarah Barth
542c3f0c4c * use tproc_parse_flags in parse_proc_dec_finish as well 2022-05-26 21:42:53 +02:00
Sven/Sarah Barth
9664ad4138 * use tparse_proc_flags for parse_proc_head as well 2022-05-26 21:42:53 +02:00
Sven/Sarah Barth
6a6a17717a + add a new symoption for symbols created for nameless types during implicit function specialization so that they can be recognized 2022-05-26 21:42:52 +02:00
Pierre Muller
5acd7a7b83 Rename tsymtable.insert and delete methods to insertsym ands deletesym 2022-05-03 23:00:28 +02:00
Sven/Sarah Barth
22a4cc66ec * fix #39675: consider the symbols for unnamed parameters as used so that there won't be unnecessary hints about them
+ added test
2022-04-22 10:40:58 +02:00
Sven/Sarah Barth
76753438ed * fix #39681: also handle the result type of a specialized procvar when checking for a possible implicit specialization
+ added test
2022-04-22 10:40:58 +02:00
Sven/Sarah Barth
c0fa45dc92 * a function can't be used to implicitely specialize a specialized procedure variable parameter and vice versa
+ added test
2022-04-22 10:40:58 +02:00
Sven/Sarah Barth
a5f3040da5 * the index of the generic type parameter is not the same index of the paras list
+ added test
2022-04-22 10:40:58 +02:00
Sven/Sarah Barth
66bac7c415 * fix #39679 and fix #39680: for implicit specializations a parameter used in a call might also inherit in some depth from a specialization used as parameter type
+ added tests
2022-04-22 10:40:58 +02:00