Commit Graph

412 Commits

Author SHA1 Message Date
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
Jonas Maebe
8634aa8ad2 * fixes for the support for overriding properties on the JVM target:
o only create an accessor wrapping the inherited accessor at a
     potentially lower visibility level if the overriding property
     itself does not specify a different accessor to use
   o simplified code
   o tests

git-svn-id: trunk@27954 -
2014-06-14 10:35:35 +00:00
Jonas Maebe
5f99ec6197 * factored out overridden properties into a virtual method
git-svn-id: trunk@27939 -
2014-06-12 11:08:41 +00:00
Jonas Maebe
2bd39f62cb * factored out associating properties with their getters/setters/fiels
o moved JVM-specific code from pdecvar (and pjvm) to jvm/symcpu

git-svn-id: trunk@27938 -
2014-06-12 11:08:38 +00:00
svenbarth
2c6d3f1428 Read the deref of the fieldvarsym into the correct variable. I wonder how this ever went past the test suite O.o
symsym.pas, tstaticvarsym.ppuload:
  * read the deref of the fieldvarsym into fieldvarsymderef, not defaultconstsymderef

git-svn-id: trunk@27826 -
2014-05-29 16:24:47 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
Jonas Maebe
d9dab6f2f1 * changed the severity of messages showing overloaded routines with all
parameters from hint to error in case they give more information
    about definition errors

git-svn-id: trunk@27521 -
2014-04-10 21:07:17 +00:00
Jonas Maebe
4a0528399e * check all overloaded routines for mangled name conflicts on the JVM
platform, as different Pascal declarations are mapped to the same
    JVM representation

git-svn-id: trunk@27520 -
2014-04-10 21:07:14 +00:00
sergei
adc8cdb5af * Calling tlabelsym.mangledname should not define the label. This was causing "already defined" errors if a label was referenced before it was defined.
+ Test.
+ Check duplicate labels in assembler blocks. This was impossible due to above bug and duplicate labels were detected only at assembling stage where no location information could be provided.

git-svn-id: trunk@27472 -
2014-04-05 01:17:36 +00:00
svenbarth
8ae36f3ef4 tstaticvarsym.ppuload: read the section string outside of the symansistr define to match the code of ppuwrite
git-svn-id: trunk@27467 -
2014-04-04 16:18:08 +00:00
svenbarth
5c1b8fdad9 Fix for Mantis #19697. For this we need to have the internal static var symbol know that it came from a static field var symbol so that we can check that for generic or not.
symsym.pas, tfieldvarsym:
  + add new field fieldvarsym which holds a reference to a tfieldvarsym if the static sym was created based on such a symbol
  + add necessary methods and code to correctly load from and store to PPU
  + add new constructor create_from_fieldvar
symcreat.pas, make_field_static: 
  * use new create_from_fieldvar constructor instead of the default one
hlcgobj.pas, finalize_static_data:
  * check whether the static var is based on a generic's class var
ppu.pas:
  * increase PPU version

+ added test

git-svn-id: trunk@27466 -
2014-04-04 16:15:41 +00:00
Jonas Maebe
721fd887c3 * moved all jvm-specific code from symsym to jvm/symcpu
git-svn-id: trunk@27384 -
2014-03-30 16:55:09 +00:00
Jonas Maebe
4a79481c51 * isolated segment-related functionality of tabsolutevarsym into i386/i8086-
specific descendent classes and moved the code that deals with this in the
    code generator also to target-specific classes -> only ifdefs left in
    pdecvar

git-svn-id: trunk@27379 -
2014-03-30 15:42:53 +00:00
Jonas Maebe
2474369dde * made all ppuwrite methods in leaf classes "final", because you cannot
override them safely in subclasses to add more data (they finalise
    writing their ibentry)
  * removed "virtual" from all ppuload constructors for similar reason
    as above
  + added virtual (empty) ppuwrite_plaform() method that is called from
    tstoreddef/tstoredsym.ppuwrite(), which can be safely overridden in
    child classes to add extra data (called centrally from a new
    tstoreddef/sym.writeentry() method)
  + added virtual (empty) ppuload_platform() method that is called from
    tstoreddef/tstoredsym.ppuload(), which can be safely overridden in
    child classes to read the extra data (unfortunately cannot be called
    from one single location, and these calls had to be added for each
    generic subclass separately)

git-svn-id: trunk@27378 -
2014-03-30 15:42:49 +00:00