Commit Graph

425 Commits

Author SHA1 Message Date
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
Jonas Maebe
2d2b8c635d * detect whether or not a def/sym is registered based on its defid, so we
don't need a separate field for this
   o changed the order in which symid and realname are stored to/loaded from
     the ppufile (because tsym.create now initialised tsym.symid, and it's
     called from ppuload) -> increased ppu version

git-svn-id: trunk@32031 -
2015-10-12 21:03:09 +00:00
Jonas Maebe
95927665ce - removed variable notification support, it's not used and superceded by
DFA

git-svn-id: trunk@31916 -
2015-10-02 17:00:25 +00:00
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
svenbarth
d45c275ef3 + extend ttypesym with the possiblity to create it as unregistered
* for now all typesyms are created as registered
Note: an additional parameter instead of an overload is used for ttypesym.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31591 -
2015-09-11 13:22:12 +00:00
svenbarth
5255c936d3 symsym.pas:
+ add an overload of check_hints() that allows to specify the current file position
  * have the previous check_hints() procedure be an inline procedure as it simply calls the new overload

git-svn-id: trunk@31513 -
2015-09-04 14:50:16 +00:00
svenbarth
af75198907 symsym.pas:
+ provide possibility to create syms that are not registered in the current module. These syms won't be stored in the ppu.

git-svn-id: trunk@31512 -
2015-09-04 14:43:02 +00:00
Jeppe Johansen
55669f62b1 Added most AVR controllers.
Made absolutevarsym use PUint instead of AWord for its offset to fix range errors.

git-svn-id: trunk@31242 -
2015-07-29 21:01:21 +00:00
Jonas Maebe
f40ea04540 * changed getarraydef() into a tarraydef.getreusable() class method
git-svn-id: trunk@31147 -
2015-06-23 21:23:18 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
69ac7dd7ef * limit initialization to register variables which really need to be initialized
git-svn-id: trunk@29569 -
2015-01-27 21:51:29 +00:00
Károly Balogh
05b3a94843 * changed explicit paraloc handling to use ppuload/ppuwrite functions in paraloc instead of directly writing the data. this hopefully fixes some endian issues when using crosscompiled-on-littleendian PPUs with explicit paralocs on bigendian systems (this means Amiga/68k and MorphOS)
git-svn-id: trunk@28596 -
2014-09-04 23:09:05 +00:00
Jonas Maebe
5c75b6dd6b * synchronised with trunk up till r28402
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
nickysn
94bcb9878a * reimplemented r28329 in a different way, as suggested by Jonas
git-svn-id: trunk@28332 -
2014-08-07 19:36:52 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
Jonas Maebe
39074edf10 - removed the globalsymbolmangleprefix/suffix constants that were added for
llvm
  * instead, add LLVM-specific name mangling based on the asmsymbol's bind
    and typ whenever we write out its name

git-svn-id: branches/hlcgllvm@28166 -
2014-07-05 15:44:16 +00:00