Commit Graph

100 Commits

Author SHA1 Message Date
florian
190b27ad45 * use proper value for Fnv64 initialization
* PPU version increased
2024-09-14 13:54:54 +02:00
florian
84da5e619c * use also an FNV hash to shorten interface wrapper names 2024-09-13 22:13:22 +02:00
Sven/Sarah Barth
170c05592b * ensure that the legacy method table has the correct alignment on platforms that require it (e.g. SPARC64) 2024-01-07 18:09:51 +01:00
Jonas Maebe
f86a9bd5c0 Extended RTTI: fix use of wrong def for the methods table
Fixes LLVM compilation
2024-01-03 22:29:01 +01:00
Ryan Joseph
519a102379 * Write extended RTTI info 2024-01-02 07:09:22 +01:00
Sven/Sarah Barth
30a7199165 * make the VMT symbol and type def of the corresponding class or object instead of having them be global
* bump PPU version to avoid potential compilation errors due to this

Based on code by Blaise.ru
2022-05-26 21:42:51 +02:00
Jonas Maebe
3d3c904ac5 TSymStr: more consistent usage 2022-05-08 15:03:44 +02:00
Jonas Maebe
fcaea21075 SymAnsiStr: fix "make all" and webtbs/tw39661*
Fixes compilation with LLVM backend
2022-05-08 14:59:36 +02:00
Jonas Maebe
629c1de460 TOC handling: clean up
Also fix on 32 bits PowerPC
2022-02-06 22:10:06 +01:00
Jonas Maebe
68b5ca633c ppc platforms: fix missing TOC restoration room
PPC platforms that use a TOC can never use a tail call to call a different
routine that potentially accesses globals, as it may use a different TOC and
then the linker must be able to insert an instruction after the branch to
restore the original TOC register value on "return". Even if FPC code itself
does not use the TOC register, it's still required since
  1) the linker does not know this, and
  2) the FPC code might still be called from other code that does use it
2022-02-05 21:36:41 +01:00
florian
9314bbbf08 * compilation hopefully fixed 2021-11-28 00:03:30 +01:00
florian
12f48c230b * use high level interface wrappers for powerpc64 if pic is generated as
the abi does not support branches between functions located in different
    tocs which might happen for inter-module branches
2021-11-27 23:33:22 +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
0ab4515e58 * properly mangle interface wrapper names to avoid duplicate label errors, resolves #38385
git-svn-id: trunk@48411 -
2021-01-24 21:32:27 +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
svenbarth
068f0d2ec8 * fix for Mantis #36935: apply patch by J. Gareth Moreton to fix a typo in cs_opt_remove_empty_proc
git-svn-id: trunk@44888 -
2020-04-20 18:42:30 +00:00
Jonas Maebe
4ba19f5418 * add support for creating non-address-only procvars to
cprocvar.getreusableprocaddr()

git-svn-id: trunk@44516 -
2020-04-02 21:21:36 +00:00
svenbarth
3ced30f816 * apply (adjusted) patch by Blaise.ru: vmtentries is always created since 2008, so treat it as such (also fixes a memory leak in tobjectdef.getcopy)
git-svn-id: trunk@43626 -
2019-12-02 06:59:05 +00:00
Jonas Maebe
9678542ba6 + add "thunk" attribute for stubs/thunks and emit it for LLVM
- also removed wrong "noreturn" attribute for interface thunks generated
     for high level code generator targets

git-svn-id: trunk@43018 -
2019-09-15 20:43:12 +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
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
190716ac0e * move getrecorddef and gettabledef from TVMTWritter to symdef as they might be used from the RTTI as well
git-svn-id: trunk@39687 -
2018-08-29 19:21:23 +00:00
florian
048c2c09fd * shorten interface wrapper names if needed, resolves #33069
git-svn-id: trunk@38319 -
2018-02-22 21:55:07 +00:00
pierre
61d0d8717a Disable 37973 for AIX specific stabx format
git-svn-id: trunk@37995 -
2018-01-18 16:29:39 +00:00
Jonas Maebe
a73b723c1d * when using a dummy file position for an interface wrapper, set
the module to the current module. This is required in case of -al,
    because when writing source lines to the assembly output the input
    file position gets changed. Since the wrappers are generated at the
    end of a unit's compilation, that's no problem if that input file
    belongs to the current unit. It was hardcoded to the unit with id 1
    before though, which is the main unit specified on the command line
    and that one could be different (fixes compilation of win32 buildrtl
    with -al after r37961)

git-svn-id: trunk@37973 -
2018-01-14 22:06:52 +00:00
Jonas Maebe
a1df776167 * changed function name emitted for interface wrappers, as otherwise the
stabs debug info uses the wrong symbol name (fixes win32 compilation
    with stabs after r37961)

git-svn-id: trunk@37970 -
2018-01-14 21:07:41 +00:00
Jonas Maebe
d35377fdee * workaround for debug info for interface method wrappers: give them the
line number information of the method declaration if it's in the current
    unit, and otherwise the first line of the current unit (mantis #14399)

git-svn-id: trunk@37961 -
2018-01-13 16:54:22 +00:00
svenbarth
530213711f * change the class references in a class' field table to indirect references
git-svn-id: trunk@37482 -
2017-10-17 20:34:21 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
svenbarth
f517311227 * ensure that the indirect symbols for VMT, RTTI and IID reside in the same sections as the symbols they point to -> reduces the amount of sections for them by half
git-svn-id: trunk@35367 -
2017-01-29 17:43:39 +00:00
svenbarth
b813fc641f * put data that's used by the VMT into the same section (that also means changing some sections from rodata_norel to rodata); this way the amount of sections per class is reduced (e.g. two for classes that inherited from a class with interfaces)
git-svn-id: trunk@35364 -
2017-01-29 17:37:13 +00:00
Jonas Maebe
d36fe53d85 * factored out the code to create an complete alias for a procdef to
symcreat.create_procdef_alias()

git-svn-id: trunk@35087 -
2016-12-09 13:39:35 +00:00
nickysn
ac186eb85d * use sizeuinttype instead of ptruinttype for the array range type in the
structure, created by TVMTWriter.gettabledef

git-svn-id: trunk@34715 -
2016-10-14 13:22:05 +00:00
nickysn
7d15b688e8 * TInterfaceEntry changed to a variant record, that overlays a CodePointer on
top of the IOffset: SizeUInt field, because it is sometimes used as a
  CodePointer (for etStaticMethodResult and etStaticMethodClass) and sometimes
  as a SizeInt and these two types can be of different size in certain i8086
  memory models

git-svn-id: trunk@34645 -
2016-10-07 20:18:02 +00:00
nickysn
7fceb8aa1f * use .Create_sizeuint and sizeuinttype when writing tinterfacetable.EntryCount
git-svn-id: trunk@34635 -
2016-10-06 14:23:37 +00:00
Jonas Maebe
4c9903455e - don't apply const_align() to alignments passed to high level typed
constant builder, it will do so itself if necessary

git-svn-id: trunk@34632 -
2016-10-06 06:25:02 +00:00
nickysn
5e7ba4a893 * the type of FieldOffset in the TFieldInfo rtti structure changed to SizeUInt,
because it represents an offset _within_ a structure

git-svn-id: trunk@34627 -
2016-10-04 21:57:29 +00:00
nickysn
f62be8f6e6 * use sizesinttype instead of ptrsinttype to refer to vInstanceSize and
vInstanceSize2 in the VMT

git-svn-id: trunk@34623 -
2016-10-04 15:25:13 +00:00
yury
e3d9dbbeef * Removed unused vars.
git-svn-id: trunk@34404 -
2016-09-01 19:55:45 +00:00
svenbarth
37c32f4b61 * generate indirect symbols for interface IID and IIDSTR (fixes cycling; I wonder why that worked on Windows without problems :/ )
git-svn-id: trunk@34353 -
2016-08-19 21:49:42 +00:00
svenbarth
fb6546972b * IID and IIDStr references of the VMT's interface table need to be indirect
git-svn-id: trunk@34338 -
2016-08-19 13:06:26 +00:00
svenbarth
77de5dd968 * reference assembler symbol of FPC_EMPTYMETHOD using AB_EXTERNAL and not AB_GLOBAL
git-svn-id: trunk@34337 -
2016-08-19 12:42:14 +00:00
svenbarth
2841cd9a9e * export IID and IIDSTR symbols of interfaces
git-svn-id: trunk@34255 -
2016-08-05 15:10:25 +00:00
svenbarth
971d05c898 * also import procdefs that are called through the VMT
git-svn-id: trunk@34177 -
2016-07-22 13:38:59 +00:00
svenbarth
f69b365b77 * declare various symbols as external assembler symbols: RTTI references, parent VMT, FPC_EMPTYMETHOD (all three only if it's used from a different unit), threadvar lists and symbols declared as "external"
git-svn-id: trunk@34176 -
2016-07-22 13:34:38 +00:00
svenbarth
bb72c1c4df * declare various assembler symbols (VMT, RTTI, threadvars) as public assembler symbols
* declare public function alias as public assembler symbols

git-svn-id: trunk@34175 -
2016-07-22 13:11:24 +00:00
svenbarth
685f820622 * switch class'/object's parent reference in the VMT to an indirect reference
(this also requires the adjustment of a test)

git-svn-id: trunk@34172 -
2016-07-22 12:53:51 +00:00
svenbarth
dc21bc842a * also generate an indirect symbol for the VMT
git-svn-id: trunk@34171 -
2016-07-22 12:50:38 +00:00
Jonas Maebe
a0efde8167 * automatically generate necessary indirect symbols when a new assembler
symbol is defined
   o removed all places where AB_INDIRECT symbols were explicitly generated
   o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
   o for some symbols an indirect symbol is always required (because they are
     dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type

git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00