Commit Graph

442 Commits

Author SHA1 Message Date
Jonas Maebe
cc5814dac1 * support arbitrary record regvars on AArch64: it has fairly complete support
for inserting/extracting bitfields (although the compiler doesn't use those
    instructions yet in all possible cases, it seems)

git-svn-id: trunk@49313 -
2021-05-01 13:58:10 +00:00
svenbarth
6160abe37e * have the generic dummy symbols for procsyms keep track of their overloaded generic procsyms so that they can be easily found (will be needed for implicit specializations)
git-svn-id: trunk@48096 -
2021-01-06 12:57:59 +00:00
Jonas Maebe
8ba4c4bcf0 * factored out the creation of loadnodes for special variables/parameters
git-svn-id: trunk@47857 -
2020-12-27 13:18:56 +00:00
pierre
6230de31bb * Second patch xml-node-dump-defs.patch from J. Gareth Moreton from bug report 36882.
With same changes to ensure that xmllint find no errors in generated xml files.

git-svn-id: trunk@47667 -
2020-12-02 21:01:40 +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
312f1436b1 * changed TIDString and tsymentry.realname to TSymStr
o for TIDString: prevents shortstring -> ansistring conversions with
     -dsymansistr when looking up symbols
   o for realname: consistency with name

git-svn-id: trunk@47301 -
2020-11-03 21:34:22 +00:00
florian
14bc6674a6 * revert part of r45810 which was accidently committed
git-svn-id: trunk@45813 -
2020-07-20 20:21:44 +00:00
florian
d6d92e3666 * revert part of r44879: flock must use kernel_off_t: off_t breaks e.g. i386
git-svn-id: trunk@45810 -
2020-07-19 19:54:22 +00:00
Jonas Maebe
59331c3d3c * enable putting records that contain a single field into records on all
targets (patch by J. Gareth Moreton, mantis #37343)

git-svn-id: trunk@45801 -
2020-07-17 20:57:24 +00:00
yury
627fcb4354 * Do not use the LOC_VOID location to indicate unused parameters.
* Added the tprocdef.parentfpsym property. Set parentfpsym.varstate to vs_read instead of using the pio_needs_parentfp flag.
* Replaced tcgcallparanode.push_zero_sized_value_para by tparamanager.has_strict_proc_signature.

git-svn-id: trunk@45454 -
2020-05-21 09:36:40 +00:00
svenbarth
7757306c78 * destroying constnone constsyms can occur when parsing a generic with a constant parameter that results in an error (e.g. unsupported type)
git-svn-id: trunk@45088 -
2020-04-26 11:46:06 +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
florian
70a836c4a2 * first part of merging parts of Jeppe's intrinsics patch, mainly r31135
is merged by this commit with a lot of adaptions

git-svn-id: trunk@43949 -
2020-01-14 21:52:39 +00:00
Jonas Maebe
2f914ee2d8 * packed tabstractvarsym.addr_taken/different_scope fields into a set
git-svn-id: trunk@43450 -
2019-11-11 09:26:51 +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
beb606be13 * fix for Mantis #36114: when converting a static class field to a global variable the varspez of the field needs to be respected
+ added test

git-svn-id: trunk@43116 -
2019-10-03 16:39:40 +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
svenbarth
b945e66e28 * store attribute information in PPU; this is less important for the compiler, but more for e.g. Lazarus when dealing with binary only units
* increase ppu version
+ added test
* adjust ppudump to handle attributes as well
ToDo: output parameter nodes as well

git-svn-id: trunk@42401 -
2019-07-12 22:07:46 +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
a1b556d211 * considering that at least in theory every symbol and every def can carry RTTI attributes (Delphi only supports property and field symbols), move the rtti_attribute_list to tstoredsym/tstoreddef
git-svn-id: trunk@42374 -
2019-07-12 22:06:05 +00:00
svenbarth
39bab2dbcc * rename trtti_attributesdef to trtti_attributes_list
git-svn-id: trunk@42359 -
2019-07-12 22:05:00 +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
6b97c712f6 * volatile syms should never be regable
git-svn-id: trunk@42308 -
2019-06-29 16:27:14 +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
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
Jonas Maebe
503ea604f3 + nolinline modifier to specify that a routine must never be inlined
git-svn-id: trunk@41198 -
2019-02-03 21:00:17 +00:00
pierre
0052e4da81 * Use getasizeint/putasizeint for tfieldvarsym.fieldoffset
* Change CurrentPPUVersion

git-svn-id: trunk@40347 -
2018-11-18 10:32:13 +00:00
florian
21d785e41b * do not unroll loops if the counter variable is accessed outside the current scope
git-svn-id: trunk@39163 -
2018-06-03 15:12:48 +00:00
svenbarth
e59e9e2a0a * extend tunitsym to be created as registered or not (for now all are created as registered)
git-svn-id: trunk@38911 -
2018-05-05 17:18:26 +00:00
florian
f986933d46 * the references of records passed by value can be kept in registers
git-svn-id: trunk@38659 -
2018-04-01 19:00:34 +00:00
svenbarth
d50848174a + add putboolean and getboolean convenience methods to tentfile
* use putboolean and getboolean where approbiate

git-svn-id: trunk@37972 -
2018-01-14 21:36:02 +00:00
florian
a37237ca11 * avoid range check errors with absolute symbols for cpus where addresses are bigger than the registers
git-svn-id: trunk@36361 -
2017-05-28 08:59:53 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
52d40bb25b * spacing fixed
git-svn-id: trunk@36136 -
2017-05-06 18:47:43 +00:00
Károly Balogh
69a502db37 instead of stringdup(ppufile.getstring), have a getpshortstring function in entfile, and use it whereever possible. this avoids an extra shortstring copy, compared to the earlier solution
git-svn-id: trunk@35233 -
2017-01-04 19:19:50 +00:00
Jonas Maebe
571d053a60 - removed tabstractnormalvarsym.currentregloc: the new location will
always be different from the old location, since we just allocated
    the registers for the new one above. Should the old registers ever
    be needed again for tai_varloc: rr.old/rr.oldhi contains it

git-svn-id: trunk@34086 -
2016-07-08 07:46:51 +00:00
svenbarth
2ed7a6de68 New class function tsymsym.find_by_number() to find a tsymsym instance based on it's number. The list containing the mapping from the indices to the symbols is created and freed using the init/done registration mechanism.
git-svn-id: trunk@33889 -
2016-06-03 20:49:06 +00:00
Jonas Maebe
7a966345e5 * don't recalculate the regable info when dereferencing a symbol's vardef:
o avoid having to save and restore the original info
   o avoids problems in case determining the regable state depends on variables
     that may not have been initialised yet at that point (such as
     voidpointertype/voidcodepointertype in case the size of procvardefs needs
     to be calculated by the regable-determining code)

git-svn-id: trunk@33179 -
2016-03-06 13:20:22 +00:00
Jonas Maebe
2483ad5939 * factored out code to set the "regable" information from setvardef, and
removed outdated comment regarding unsupported static fpu regvars

git-svn-id: trunk@33178 -
2016-03-06 13:20:19 +00:00
svenbarth
02e56f410d Merged revision(s) 28689 from branches/svenbarth/packages:
Extract functionality that is shared between the metadata files for units (PPU) and for packages (PCP) into a parent class called tentryfile

+ add new unit entfile which contains the new tentryfile class and related types and constants
* ppu.pas:
    - remove methods, fields, types and constants which were moved to entfile.pas
    * replace the parts of tppuheader shared with tentryheader by a field of type tentryheader
fppu.pas, pmodules.pas, utils/ppumove.pp, utils/ppuutils/ppudump.pp:
    + add entfile to uses
    * adjust access to common header fields
node.pas, symdef.pas, symsym.pas, symtable.pas, wpoinfo.pas, utils/ppufiles.pp:
    + add entfile to uses
........

git-svn-id: trunk@32976 -
2016-01-22 15:26:30 +00:00
Jonas Maebe
7a8079cfb4 * removed DLLsource global variable and replaced its uses with
current_module.islibrary

git-svn-id: trunk@32676 -
2015-12-17 15:23:05 +00:00
Jonas Maebe
a1db947e9e * missing part of r32617: also load the def for constnil symbols
git-svn-id: trunk@32632 -
2015-12-10 22:45:53 +00:00
Jonas Maebe
01d93b61c3 * save/restore the type (and hence code page) of ansistring constsyms in/from
the ppu (mantis #28964)
  * also save/restore the type of constnil, constresourcestring and constguid
    in/from the ppu

git-svn-id: trunk@32617 -
2015-12-08 14:27:23 +00:00
svenbarth
74c79803f7 Extend tlocalvarsym with the ability to not register it if needed.
git-svn-id: trunk@32375 -
2015-11-20 11:29:21 +00:00
svenbarth
0ac12f0eaf Extend tstaticvarsym (and by extension tabstractnormalvarsym) with the capability to create it as unregistered if needed.
git-svn-id: trunk@32373 -
2015-11-20 11:15:30 +00:00
svenbarth
922646d106 Adjust tfieldvarsym (and by extension tabstractvarsym) so that it can be created as not registered if needed.
git-svn-id: trunk@32372 -
2015-11-20 10:43:25 +00:00
Jonas Maebe
745249295e * don't reserve never used space for parameter and function result location
info on the callnoside and callbothsides "sides"

git-svn-id: trunk@32225 -
2015-11-04 12:50:47 +00:00
Jonas Maebe
2cea723a0d * only write the parts of the unit localsymtables that are actually needed:
the defs and syms (recursively) referred by inline routines and by the WPO
    info
   o defs and syms are no longer added immediately to the module's deflist/
     symlist, even if they are created as "registered". Instead,
     "doregister=true" simply means "add it to the symbol table at the
     top of the symtable stack"
   o normally only when a sym/def is deref'ed, it gets added to the module
     symlist/deflist and defid/symid gets a (unique) value
   o in cases where we use(d) the defid to construct unique names within the
     current module, you now have to call call the tdef.new unique_id_str()
     method. If the def was not yet registered, we will reserve room for it
     in the deflist (to get a unique id), but the defid gets set to a
     negative value computed from its position in the deflist. Should it
     have to be written to the ppu file later on, the defid will be
     modified to the actual position in the deflist. For both values,
     new unique_id_str() will return the same result so that references
     to this def before and after actual registrations are the same (needed
     for the JVM backend, but also a good principle in general)

   Overall: don't directly use symid/defid anymore to get unique identifiers,
     but use tdef.new unique_id_str() instead (if necessary, a similar routine
     for tsym can be added)

   The result is the ppu file size gets reduced significantly after its big
   increase as a result of the high level typed constant builder (which creates
   a lot of defs). The result is even more efficient than before, as other
   unneeded defs/syms from the localsymtables don't get saved/restored anymore
   either.

git-svn-id: trunk@32153 -
2015-10-25 19:22:00 +00:00
Jonas Maebe
4aa6c95ced * call inherited method from t*sym.buildderef (currently still empty,
but won't stay that way)

git-svn-id: trunk@32149 -
2015-10-25 19:21:48 +00:00