Commit Graph

939 Commits

Author SHA1 Message Date
Jonas Maebe
6558d7a521 * no longer store the tprocdef.synthetickind field in ppu files
git-svn-id: trunk@34130 -
2016-07-14 15:26:03 +00:00
Jonas Maebe
f55a403270 * specify the packenum setting to use when creating a tenumdef
git-svn-id: trunk@33942 -
2016-06-09 22:00:10 +00:00
svenbarth
b4354aff5e tprocdef.customprocname:
* if we have a compilerproc with a syssym then use the syssym's name when generating the name

git-svn-id: trunk@33892 -
2016-06-03 20:55:48 +00:00
svenbarth
7c5c5d2e4b symdef.pas, tprocdef:
* don't check the type of the owner symtable if we don't have one

git-svn-id: trunk@33842 -
2016-05-28 22:08:00 +00:00
Jonas Maebe
9d2bba1917 * create a separate type and def for the LLVM "i1" type, because reusing
pasbool8type for this results in too much trouble (we mustn't use i1
    for parameters, because then LLVM will try to apply the ABI convention
    for passing "1 bit" values, or in records because then this may
    result in unwanted bitpacking). Downside: the new LLVMBool1 type is
    also exposed in the system unit, because we need it to define LLVM
    intrinsics...

git-svn-id: trunk@33726 -
2016-05-20 20:51:44 +00:00
Jonas Maebe
266dee9258 * update tprocvardef.GetTypeName() for blocks so it prints them using the
syntax required by the compiler ("reference to ...; cdecl")

git-svn-id: trunk@33530 -
2016-04-17 19:07:30 +00:00
Jonas Maebe
f50dec5202 * don't allow implicit type conversions from pointers to c-style blocks in
Delphi mode, because unlike for procvars we need full type information
    to be able to generate a block (mantis #30022)

git-svn-id: trunk@33529 -
2016-04-17 19:07:26 +00:00
svenbarth
27ab1c61c5 Fix for Mantis #29745.
symdef.pas, getansistringdef:
  * use a temporary, non-defaware symtablestack to create the ansistringdef

+ added test

git-svn-id: trunk@33214 -
2016-03-10 19:43:45 +00:00
Jonas Maebe
3e59c05ecc * only check trecorddef(self).contains_cross_aword_field (for checking
whether the record can be kept in a register) after determining that the
    record is < 2*sizeof(aword) (it's a much more expensive check, especially
    for big records)

git-svn-id: trunk@33190 -
2016-03-06 14:16:38 +00:00
Jonas Maebe
096e1c45d6 * don't keep records in registers if they contain a field that spans the
boundary between two awords, as our subscript code does not handle
    them correctly (second part of mantis #29669)

git-svn-id: trunk@33180 -
2016-03-06 13:20:25 +00:00
svenbarth
dea4ac557d Fix for Mantis #28100.
symdef.pas, tstoreddef:
  * deref: don't free the deref list and it's entries as deref() might be called again when the unit reloaded a second time

git-svn-id: trunk@33054 -
2016-02-05 19:04:38 +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
florian
53e89b25d1 * reverted r32746: *inttype shall be the normally used integer type, os*inttype shall be the int type with the max. size of integer registers
git-svn-id: trunk@32789 -
2015-12-29 15:07:58 +00:00
Jonas Maebe
8471d93bf8 * include the unit name in tstoreddef.fullownerhierarchyname()
git-svn-id: trunk@32781 -
2015-12-28 15:06:43 +00:00
Jonas Maebe
9258b5d76b + non-functional 128 bit integer types (inaccessible from Pascal), for use
in the LLVM high level code generator to implement overflow checking

git-svn-id: trunk@32735 -
2015-12-26 20:00:33 +00:00
nickysn
bfa96171e0 * changed the asizeint and asizeuint to 32-bit on CPUs with 16-bit address
space, in order to allow data structures larger than 32k (and less than 64k)

git-svn-id: trunk@32529 -
2015-11-25 15:35:38 +00:00
Jonas Maebe
ba92fdafcc * free the calleeside paraloc information after a unit has been compiled
git-svn-id: trunk@32519 -
2015-11-24 20:10:32 +00:00
Jonas Maebe
2504a0ce6c + codeptruinttype/codeptrsinttype that has the same size as
voidcodepointertype

git-svn-id: trunk@32470 -
2015-11-22 11:49:32 +00:00
nickysn
7990b55a87 * use sizeof(aint) instead of sizeof(asizeint) to determine whether a record is
intregable in tstoreddef.is_intregable

git-svn-id: trunk@32447 -
2015-11-21 19:43:18 +00:00
Jonas Maebe
9a0cb50a08 * converted the result of fullownerhierarchyname to tsymstr so it (and
contcatenations based on it) can be longer than 255 characters in
    case tsymstr=ansistring

git-svn-id: trunk@32412 -
2015-11-21 12:37:04 +00:00
Jonas Maebe
8e43a8a9cf * changed fix for reusable defs and exceptiontables again: we cannot create
reusable defs for defs in exceptionsymtables, or indeed use any defs from an
    exceptionsymtable in the high level code generator, as those defs are freed
    before the module is completely compiled -> crashes while trying to use them
    in the assembly writing phase ->
   o when the symtablestack top is an exception symtable, keep looking for
     another symtable to put the def in
   o give an internalerror if we encounter a def in an exceptionsymtable anyway
     in getreusablesymtab

git-svn-id: trunk@32401 -
2015-11-21 12:36:29 +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
46dfa1af30 * correctly handle t*def.getreusable*() in case the original def was in
an exception symtable (then the new def cannot be safely made reusable,
    as the exception symtable may be freed before the module is completely
    compiled)

git-svn-id: trunk@32340 -
2015-11-15 22:23:00 +00:00
florian
70b8789262 o basic extended pascal support:
+ automatically loaded helper unit
  * Makefiles adapted
  * mode switch
  * mode switches reorganized
+ TimeStamp support

git-svn-id: trunk@32330 -
2015-11-15 15:13:36 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +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
4f7b4a2735 * changed {$ifdef x86} code in defcmp into virtual methods
git-svn-id: trunk@32180 -
2015-10-28 18:06:27 +00:00
Jonas Maebe
9c0d550320 * immediately register interface defs so their defid cannot vary depending
on the implementation (which would change the interface crc, even though
    the interface didn't change)

git-svn-id: trunk@32171 -
2015-10-28 13:19:01 +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
b2144d1da0 * give an internalerror if we try to write a tdef that doesn't belong to any
symtable to a ppufile

git-svn-id: trunk@32065 -
2015-10-16 19:15:37 +00:00
Jonas Maebe
cebcf0afa8 * add "doregister" parameter to tfloatdef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions

git-svn-id: trunk@32049 -
2015-10-13 15:59:15 +00:00
Jonas Maebe
b22e2ef400 * add "doregister" parameter to tsetdef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions

git-svn-id: trunk@32048 -
2015-10-13 15:59:12 +00:00
Jonas Maebe
e921d7847a * add "doregister" parameter to tstringdef.create*, and don't register
temporary defs created in the scanner for evaluating compile time
    expressions

git-svn-id: trunk@32047 -
2015-10-13 15:59:09 +00:00
Jonas Maebe
2778bf55c7 * add "doregister" parameter to torddef.create, and don't register temporary
defs created in the scanner for evaluating compile time expressions, or in
    the code generator for range checking

git-svn-id: trunk@32046 -
2015-10-13 15:59:06 +00:00
Jonas Maebe
91be1d0f2d * removed the DWARF label fields from tdef/tobjectdef, and dynamically
allocate them only while necessary
   o also unified the conditions under which we allocate a separate
     struct label

git-svn-id: trunk@32045 -
2015-10-13 15:59:03 +00:00
Jonas Maebe
192bb3e032 * free the implementation info for procdefs immediately after a module
has been compiled

git-svn-id: trunk@32042 -
2015-10-13 15:58:54 +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
nickysn
12a9664181 * use 16-bit offsets for threadvars on CPUs with 16-bit address space
git-svn-id: trunk@32013 -
2015-10-11 12:16:26 +00:00
Jonas Maebe
2cf8e50771 * fixed unwanted disabling of a codepage set via -FcXXX/{$codepage XXX}
when {$modeswitch systemcodepage} gets disabled without having been
    enabled first (such as when initially setting the syntax mode)
    (mantis #28718)

git-svn-id: trunk@31831 -
2015-09-25 18:31:58 +00:00
svenbarth
e44a51f10d symdef.pas, tprocdef:
+ new token buffer that holds the declaration of the generic function/method while the one from tdef contains the body
ppu.pas:
  * increase PPU version
utils/ppuutils/ppudump.pp:
  * also read the declaration token buffer, it's however not printed yet (ToDo!)

git-svn-id: trunk@31759 -
2015-09-18 13:46:50 +00:00
svenbarth
040786e5bb + extend tundefineddef with the possiblity to create it as unregistered
* for now all undefineddefs are created as registered
Note: an additional parameter instead of an overload is used for tundefineddef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31757 -
2015-09-18 13:08:58 +00:00
yury
432248cbf1 * Removed lot of unused vars.
git-svn-id: trunk@31732 -
2015-09-17 12:48:58 +00:00
Jonas Maebe
75992c1274 * don't allow records to be put in registers for the llvm target
git-svn-id: trunk@31685 -
2015-09-15 11:51:25 +00:00
Jonas Maebe
83ae160057 + get_threadvar_record() to get a recorddef representing a threadvar (index
and data in case of single threaded)

git-svn-id: trunk@31643 -
2015-09-12 23:33:07 +00:00
Jonas Maebe
54642f5f09 * return the added symbol from trecorddef.add_field_by_def()
git-svn-id: trunk@31638 -
2015-09-12 23:32:49 +00:00
svenbarth
65c37df999 + extend tprocdef with the possiblity to create it as unregistered
* for now all procdefs are created as registered
Note: an additional parameter instead of an overload is used for tprocdef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31593 -
2015-09-11 13:36:00 +00:00
svenbarth
84b9d9839c + extend tobjectdef with the possiblity to create it as unregistered
* for now all objectdefs are created as registered
Note: an additional parameter instead of an overload is used for tobjectdef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31592 -
2015-09-11 13:28:49 +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
938c8335a9 symdef.pas:
* provide possibility to create defs that are not registered in the current module and also not in the symtablestack. These defs won't be stored in the ppu.

git-svn-id: trunk@31510 -
2015-09-04 14:24:27 +00:00
Jonas Maebe
6f5905684f + support for specifying the name of fields added to anonymous record
types that are constructed on the fly by the high level typed const
    builder

git-svn-id: trunk@31249 -
2015-07-30 16:57:58 +00:00