Commit Graph

164 Commits

Author SHA1 Message Date
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
Sven/Sarah Barth
90844c2027 * fix #35261: apply slightly adjusted changes by Ryan Joseph to implement support for implicit generic function specializations
The main adjustments were as follows:
  - fixing coding style and identation
  - fixing some typos
  - using a better name for the property in tcallcandidates which holds the symbols created for anonymous parameter values
2022-04-20 18:59:31 +02:00
Sven/Sarah Barth
2a5023508a + add support for forward declarations of generic classes and interfaces (any implicit pointer type really); fixes #34128 2022-02-18 17:54:23 +01:00
Sven/Sarah Barth
7f1e420bb0 * move determine_generic_def out from pdecl.types_dec to pgenutil 2022-02-18 17:53:35 +01:00
florian
e4ee8fa6a2 * patch by Rika to pass some strings by reference, resolves #39338 2021-11-09 22:41:52 +01:00
florian
a4672fbd1c o based on a patch by Rika, resolves #39401:
* use Base64 (62=_, 63=$) encoded FNV hash (instead of CR-32) to shorted identifiers
    * renamed fpccrc to fpchash
    + test
2021-10-10 10:09:22 +02:00
florian
51326e94f3 * allow char constant to be used for const string parameters in generic specializations, resolves #39030
git-svn-id: trunk@49569 -
2021-06-28 20:35:33 +00:00
pierre
e6045673ee Handle NIL entries in deflist after commit 48986
git-svn-id: trunk@49230 -
2021-04-18 15:44:07 +00:00
yury
75491ae21c * Removed/ifdefed the assigned and unused variables.
git-svn-id: trunk@48391 -
2021-01-24 13:58:17 +00:00
yury
9c265d71f0 * Fixed a wrong code caused by a typo. It has been revealed by a note about an unused var.
git-svn-id: trunk@48387 -
2021-01-24 13:08:54 +00:00
svenbarth
e4eed4e259 * when only a symbol name is provided to generate_specialization_phase1 allow a symbol table to be provided as well
git-svn-id: trunk@48000 -
2021-01-02 23:23:29 +00:00
svenbarth
9179f9d43b * always add a generic dummy if it is a procsym
git-svn-id: trunk@47996 -
2021-01-02 23:23:12 +00:00
florian
ff295bf349 * delay setting of pd_body and pd_implement till the header of a generic
procedure is parsed, resolves #37261

git-svn-id: trunk@45717 -
2020-06-30 20:36:51 +00:00
florian
e7f7927ca9 + initialize variables, so compilation with -O3 works
git-svn-id: trunk@45141 -
2020-04-27 19:19:54 +00:00
svenbarth
04554d7505 * use a more detailed error message if a type is not allowed for a generic constant parameter
git-svn-id: trunk@45092 -
2020-04-26 11:46:24 +00:00
svenbarth
a467332187 * fix for Mantis #36975: arraydefs are not allowed for generic types (this is only used for type declarations; for specializing constant strings which are char arrays are still allowed)
+ added test

git-svn-id: trunk@45089 -
2020-04-26 11:46:10 +00:00
svenbarth
60345366f2 * fix for Mantis #35140: apply patch by Ryan Joseph together with some further changes by me to add support for constant parameters in generics
+ added tests

git-svn-id: trunk@45080 -
2020-04-25 22:12:35 +00:00
svenbarth
41a6957f7d * keep track of the fileposinfo for generic constraints
git-svn-id: trunk@44188 -
2020-02-16 09:53:32 +00:00
florian
b7afb2431c * do not allow constraints in headers of procedure implementations in delphi mode, resolves #36584
* better error message if a constraint is found at a wrong location

git-svn-id: trunk@44174 -
2020-02-14 20:56:55 +00:00
svenbarth
c6a4d10f61 * for deciding whether to swap a generic's buffer use the module's flag instead of the def's
git-svn-id: trunk@44073 -
2020-01-30 21:49:07 +00:00
pierre
d1e4066477 Hopefully fix problems related to loading of ppufile generated with other endianess for generics
git-svn-id: trunk@44056 -
2020-01-28 23:43:56 +00:00
yury
1b3a3a7983 * Removed lot of unused local vars. It is useful to turn on the notes in options. :)
git-svn-id: trunk@44053 -
2020-01-28 18:45:33 +00:00
svenbarth
3e7dc25667 * fix for Mantis #36496: correctly handle the function result alias variable inside generic functions
+ added tests

git-svn-id: trunk@43823 -
2019-12-30 21:35:26 +00:00
svenbarth
bf5d75e594 * move the common sequence to build a VMT for an objectdef into a separate procedure (based on a patch by Blaise.ru)
git-svn-id: trunk@43674 -
2019-12-11 22:42:53 +00:00
svenbarth
97eefb6ac3 - the error recovery handling is no longer required
git-svn-id: trunk@43588 -
2019-11-25 20:28:29 +00:00
svenbarth
5b71ba2a9b * treat a missing genericdef with no symname set as an internal error
git-svn-id: trunk@43587 -
2019-11-25 20:28:26 +00:00
svenbarth
ef6c9e930b * correctly handle the genericdef being a procdef, otherwise no code will be generated (and no error either :/ )
+ added test

git-svn-id: trunk@43586 -
2019-11-25 20:28:23 +00:00
svenbarth
1abc9c1fe7 * when specializing a routine all nested specializations must go to the para- or localsymtable as otherwise the symbol can't be found to be registered
git-svn-id: trunk@43568 -
2019-11-24 00:04:31 +00:00
svenbarth
d79e2ee9da * also store, reset and restore the current module's procinfo
git-svn-id: trunk@43566 -
2019-11-24 00:04:23 +00:00
Jonas Maebe
a051b8d225 - remmoved doregister parameter from t*sym constructors, as the registration
is handled automatically nowadays

git-svn-id: trunk@42998 -
2019-09-14 17:30:45 +00:00
Jonas Maebe
d8903ce6b3 - removed maxcrecordalign parameter/field from recordsymtables, as this value
cannot be modified in the settings (so we can directly use the one from
    current_settings)

git-svn-id: trunk@42447 -
2019-07-14 19:24:32 +00:00