Commit Graph

628 Commits

Author SHA1 Message Date
Sven/Sarah Barth
ea102d792f * fix #40634 the 2nd: a (strict) protected symbol in a parent class of the owner is supposed to be visible
+ added test
2024-02-18 19:35:24 +01:00
Sven/Sarah Barth
1dbde8a79d - remove no longer required check as that is now handled by check_strict_private (not to mention that the check had been placed incorrectly anyway...) 2024-02-18 19:35:24 +01:00
Sven/Sarah Barth
11200cfaf6 * use check_strict_private and check_strict_protected in their respective non-strict checks to avoid code duplication 2024-02-18 19:35:23 +01:00
Sven/Sarah Barth
852aee489c * move the checks for strict private and protected into their own nested functions 2024-02-18 19:35:23 +01:00
Sven/Sarah Barth
d9903e6e16 * fix #40634: correctly check visibility for child classes in case of a mixture of specializations and non-specializations
+ added test
2024-02-16 16:54:23 +01:00
Sven/Sarah Barth
43721f21c4 * fix #40621: when checking for visibility of members then always use the genericdefs for specializations for correct scoping
+ added test
2024-02-09 17:24:39 +01:00
Sven/Sarah Barth
ed8a05d697 * use iscurrentunit only when there isn't a suitable def that the moduleid of the symtables can be compared to 2024-02-09 17:22:46 +01:00
Michael VAN CANNEYT
a74a35a16e * Check that system unit is actually loaded before using it to search for system symbols
(cherry picked from commit 9e5ee68887)
2023-06-19 15:33:15 +02:00
Michael VAN CANNEYT
5adde504a9 * Do not crash when module pointer is nil
(cherry picked from commit e6f71b6acc)
2023-06-19 15:22:42 +02:00
Jinyang He
8fac3d62ce add has_double_field 2023-02-05 19:18:48 +00:00
Sven/Sarah Barth
4b659175d9 - remove no longer required readonly functionality from tparasymtable 2022-12-30 23:32:00 +01:00
Jonas Maebe
c5f4a6acd0 LLVM: fix variant records when alignment of first part is not the highest
Resolves #40015
2022-12-01 22:43:40 +01:00
Sven/Sarah Barth
9e3483fbeb * fix #39977: allow a capturer to access any method independant of visibility as the visibility checks are supposed to have been done before the captured symbol was converted
+ added test
2022-11-06 22:01:49 +01:00
florian
0eee70ac81 * fix FindUnitSymtable for exception symtables, resolves #24801 and #39974
* more consistent naming of exceptsymtable enumeration symbol
2022-10-31 20:19:10 +01:00
Jonas Maebe
b0e1867b4c symcreat: support for scanner/parser escape sequences
Support escape sequences when parsing internally generated code. Used for now
to force interpreting certain identifiers as unit/namespace identifiers.
2022-09-16 11:21:05 +02:00
Sven/Sarah Barth
3eac88eeaf * protected symbols are visible for defs declared in a local symtable as well 2022-05-26 21:43:40 +02:00
Sven/Sarah Barth
ac4df2b066 * don't check for a duplicate internal symbol in inherited symtables 2022-05-26 21:42:51 +02:00
Jonas Maebe
3d3c904ac5 TSymStr: more consistent usage 2022-05-08 15:03:44 +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
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
florian
e4ee8fa6a2 * patch by Rika to pass some strings by reference, resolves #39338 2021-11-09 22:41:52 +01:00
Sven Barth
3ce6cae11d * fix for #39310 by fixing various small issues in tabstractrecordsymtable.has_single_field:
- initialize the returned def to a safe default
  - correctly reset the found symbol for each loop
  - reset the result when descending into a record
+ added test
2021-09-01 09:31:15 +02:00
svenbarth
7343e9c4a2 * correctly handle the case should the generic dummy symbol be a procsym instead of a typesym
git-svn-id: trunk@48001 -
2021-01-02 23:23:34 +00:00
Jonas Maebe
c0c0acbcb9 * fixed llvm shadow symtable construction in case fields are reordered
(-Ooorderfields) and hence their offsets are no longer monotonically rising
  * also fixed padding for variant bitpacked records in llvm shadow symtable

git-svn-id: trunk@47853 -
2020-12-27 13:18:44 +00:00
svenbarth
3597696e98 * fix for Mantis #38145: allow overloading of assignment operators that return ShortStrings with a specific size
+ added tests

The following rules for using these operator overloads as *implicit* overloads apply (Delphi compatible):
  - if a found assignment operator returns a default ShortString then that is used
  - if only one assignment operator to a String[x] is found then that is used
  - otherwise the assignment is not possible
The explicit assignment checks for an exact match (and falls back for an implicit assignment). This is not entirely Delphi compatible as Delphi seems to favor the first found symbol in that case, but sometimes also not... :/

git-svn-id: trunk@47634 -
2020-11-29 15:47:52 +00:00
Jonas Maebe
cc315e0ac7 * fix tw3930 after r37927
o "unique" class (and interface) type aliases should actually not exist at
     all except for overload resolution. All the rest (VMT, UUID, RTTI, ...)
     should be taken from the aliased class/interface
   o there is one Delphi-incompatibily left after this change, but it shouldn't
     matter: tw8180 does not compile if you change the declaration to
     "tcl=class(TInterfacedObject,XStr,iinterface)", while Kylix does compile
     that. It doesn't really matter though, because in Kylix this actually
     adds iinterface twice as implemented interface, so there is no point
     in accepting this.

git-svn-id: trunk@46773 -
2020-09-05 12:25:09 +00:00
florian
392d66a9ce * variables can have the same name as the main program in iso mode, resolves #37322
git-svn-id: trunk@45757 -
2020-07-10 21:05:59 +00:00
florian
84a1f614d9 * fix several double ;
git-svn-id: trunk@45488 -
2020-05-24 17:52:09 +00:00
Jonas Maebe
a2174753c1 - removed tabstractrecorddef.get_unit_symtable, which did not always return the unit
symtable (when you had a local recorddef in a procdef)
  * modified tdef.get_top_level_symtable() so you can specify whether you want to
    skip procdefs or not
  * changed tobjectdef.vmt_def() to no longer require a typesym for the tobjectdef
    (based on patch by Blaise)

git-svn-id: trunk@45361 -
2020-05-13 21:46:29 +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
florian
d87a5cc9fb * take care of m_duplicate_names when checking for duplicate locals, resolves #33221
git-svn-id: trunk@44028 -
2020-01-23 21:32:09 +00:00
Jonas Maebe
1a9e246c29 * added is_normal_fieldvarsym() helper and use it
o fixes several places where there was a check whether something is a
     fieldvarsym, but not whether it's an instance rather than a class field

git-svn-id: trunk@43786 -
2019-12-24 22:12:44 +00:00
svenbarth
1779011ab4 * fix typo in comment
git-svn-id: trunk@43703 -
2019-12-20 16:44:52 +00:00
svenbarth
927c91e093 * fix for Mantis #36388: correctly handle generic constraints when looking for helpers
git-svn-id: trunk@43629 -
2019-12-02 22:29:34 +00:00
svenbarth
0a915e883e * keep track of static symbols that a global function references, as those must now be exported from a dynamic package as well if the function can potentially be inlined
git-svn-id: trunk@43544 -
2019-11-21 21:44:53 +00:00
Jonas Maebe
ac1e0f96bd * replaced tentryfile.get/putsmall/normalset() with a common tget/putset
that expects an open array of byte, and use it for all sets
   o since all sets need to be typecasted to an array type of the appropriate
     size, we'll get a compilation error in case this needs to be done and
     that also tells us at the same time that the ppu version will need to
     be increased
  * enabled {$packset 1} for the compiler, as this is now safe with the above
    changes

git-svn-id: trunk@43407 -
2019-11-06 21:50:19 +00:00
svenbarth
fdeaacac21 * fix for Mantis #36223: when parsing a helper type its extendeddef might be Nil
+ added test

git-svn-id: trunk@43346 -
2019-11-01 15:02:31 +00:00
pierre
d29a6de437 Avoid possible warning about uninitialized srsym variable
git-svn-id: trunk@42857 -
2019-08-27 12:15:03 +00:00
Jonas Maebe
bc7b90185f * when searching for a procsym in an Objective-C category for an objcclass,
try to find the procsym in the category of the objcclass that is closest
    related to the original objcclass (e.g.
     NSMutableDictionary.dictionaryWithContentsOfFile() -> prefer the
     dictionaryWithContentsOfFile() from NSMutableDictionaryCreation to the
     one from NSDictionaryCreation (part of mantis #35994)

git-svn-id: trunk@42815 -
2019-08-25 15:23:48 +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
svenbarth
dfb9fffcf9 + add functions for syms and defs and write sub entries of the sym/def to PPU and loads them again
git-svn-id: trunk@42399 -
2019-07-12 22:07:38 +00:00
svenbarth
a64a8f8deb - remove code to create an attribute using a synthetic function
git-svn-id: trunk@42396 -
2019-07-12 22:07:28 +00:00
svenbarth
0b63e89ba2 * make the reference to the TCustomAttribute type global
git-svn-id: trunk@42393 -
2019-07-12 22:07:15 +00:00
svenbarth
b2932393df Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 1/3]
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.

git-svn-id: trunk@42356 -
2019-07-12 22:04:48 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
svenbarth
5a5b47fa24 + add support for MultiHelpers modeswitch by Ryan Joseph for Mantis #35159
+ added tests

git-svn-id: trunk@42026 -
2019-05-10 14:04:45 +00:00
pierre
c1e93bd2c2 + compiler/symdef.pas: Add missing call to tderef.reset methods in all tdef constructors.
+ compiler/sysmsym.pas: Do the same for for all tsym constructors.
  + compiler/symtype.pas: Generate internalerror in  tcompilerppufile.putderef
    if a deref field has index -1, as this means that buildderef was not called
    while it should have been called.
  + compiler/symtable.pas: Fix bug report itself by adding an extra local variable
    CHANGED to add extra cycles in tstoredsymtable.buildderef_referenced method.

New tests for this bug report: tests/webtbs/tw35139.pp and  tests/webtbs/tw35139a.pp

git-svn-id: trunk@41425 -
2019-02-23 23:03:29 +00:00
svenbarth
cb8f6f637c * fix big endian targets by using an explicit assignment with typecast instead of an absolute variable
git-svn-id: trunk@39728 -
2018-09-10 21:12:29 +00:00
svenbarth
92cce05f5f * as a workaround for some compiler bug introduced during 3.1.1 the freeing of the management operator offset entry lists is moved to a nested procedure as that does not trigger the bug (even with -O2 or -O3)
git-svn-id: trunk@39711 -
2018-09-04 20:20:07 +00:00
svenbarth
600ed6701e + keep track whether a structured type has fields with management operators (or fields that in turn have fields with management operators and so on) and store that in the PPU to speed up compilation again
* adjusted PPUdump for this

git-svn-id: trunk@39709 -
2018-09-03 18:00:27 +00:00