Commit Graph

963 Commits

Author SHA1 Message Date
svenbarth
06d7e26df0 * move code to add a symbol to the current module's generic dummy symbols into a new function pgenutil.add_generic_dummysym()
git-svn-id: trunk@36466 -
2017-06-09 14:30:23 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
svenbarth
5f8135dd84 * tarraydef.setelementdef: don't call size for array constructors as they'll only have one once they're converted to dynamic arrays
git-svn-id: trunk@36089 -
2017-05-04 20:57:06 +00:00
maciej-izak
b912deae33 * each record with managed field or with any management operator needs init table (update for symdef.pas, trecorddef.needs_inittable)
git-svn-id: trunk@35440 -
2017-02-18 18:50:57 +00:00
maciej-izak
15ba9b54c6 Store informations about management operators in ppu files for records.
ppu.pas:
  * increase ppu version

symconst.pas:
  + new enum tmanagementoperator and set tmanagementoperators

symtable.pas, trecordsymtable:
  + new field managementoperators
  + new method includemanagementoperator

symdef.pas, trecorddef.ppuload and trecorddef.ppuwrite:
  * save/load for managementoperators

git-svn-id: trunk@35439 -
2017-02-18 18:43:25 +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
6e05c78a54 + support for recording an exception catching personality function for a
procdef for ABI-conformant exception handling

git-svn-id: trunk@35162 -
2016-12-18 13:57:45 +00:00
svenbarth
f8c23c84b6 * have pointerdefs and classrefdefs "inherit" the df_generic and df_specialization flags from the def they point to and set the genericdef accordingly
git-svn-id: trunk@35091 -
2016-12-09 16:20:36 +00:00
Jonas Maebe
472b5228fe * changed ncgutil.has_alias_name(pd,s) to a method of tprocdef
git-svn-id: trunk@35085 -
2016-12-09 13:39:28 +00:00
svenbarth
ee466b9a28 * extend tdef.fullownerhierarchyname() with a parameter that skips the inclusion of a procdef's parameter declaration using the new pno_noparams option
git-svn-id: trunk@35009 -
2016-11-28 18:06:35 +00:00
svenbarth
930070a8ca + new tprocnameoption pno_noparams to prohibit tprocdef.customprocname() from adding the procdef's parameters
git-svn-id: trunk@35008 -
2016-11-28 18:01:53 +00:00
Jonas Maebe
477283031c * fixed tprocvardef.size() for
a) C-blocks: they are equivalent to a voidpointertype, as they are
      implicit pointer types
   b) procvardefs created from static class methods (there is no
      self pointer in this case)
  o fixes webtbs/tw30936.pp with LLVM

git-svn-id: trunk@34977 -
2016-11-26 21:51:21 +00:00
florian
67570a6262 + patch to support assigning class procedures to procedure variables by Ondrej Pokorny, resolves #30936
+ additional tests

git-svn-id: trunk@34909 -
2016-11-17 19:40:42 +00:00
pierre
3919ffccf2 Fix calcsavesize for cross-compilation from aarch64 to arm, by forcing 64-bit computation also on min<low(longint) part
git-svn-id: trunk@34864 -
2016-11-10 17:04:31 +00:00
nickysn
657685a8b6 * use sizesinttype instead of ptrsinttype for the index and high parameter of
open arrays/dynarrays/string-like char arrays, etc.

git-svn-id: trunk@34665 -
2016-10-08 13:56:24 +00:00
nickysn
35b0201002 + added an unsigned counterpart to tpointerdef.pointer_arithmetic_it_type (needed by inc/dec)
git-svn-id: trunk@34653 -
2016-10-08 11:45:24 +00:00
nickysn
acfe6d2f2c + added alusinttype and aluuinttype to symdef, which correspond to the ALU size,
sizeof(aint) and the ALUSInt/ALUUInt types in the RTL

git-svn-id: trunk@34628 -
2016-10-04 22:36:20 +00:00
nickysn
35b2ffa872 + added types sizesinttype and sizeuinttype, corresponding to the SizeInt and
SizeUInt types for the target platform

git-svn-id: trunk@34619 -
2016-10-04 13:40:02 +00:00
nickysn
481a8ec58d * for pointers, converted to arrays, use a newly added virtual method
tpointerdef.converted_pointer_to_array_range_type to obtain their integer
  range type, instead of using ptrsinttype

git-svn-id: trunk@34612 -
2016-10-04 00:01:06 +00:00
svenbarth
2ea587f746 * fix for Mantis #30537: also allow the parasymtable as a parent symtable when generating the mangled name as that is needed for generic functions
+ added test

git-svn-id: trunk@34527 -
2016-09-16 14:10:53 +00:00
Jonas Maebe
ffd4870a60 * add backticks around special type identifiers in
tabstractprocdef.typename_paras(), after accidentally committing the
    removal of the double quotes in r34358
   o the reason for not using double quotes is that the output of this routine
     is used for some LLVM identifier names, and you can't have double quotes in
     LLVM identifiers (any other character, including space, is no problem)

git-svn-id: trunk@34392 -
2016-08-29 16:05:22 +00:00
pierre
dfeb6e3ae1 Avoid memory leak on trecorddef.variantrecorddesc field
git-svn-id: trunk@34363 -
2016-08-21 22:25:13 +00:00
Jonas Maebe
179c1ab328 * changed ttemp*node.tempinfo^.flags to a private field, and added setters
and getters for the ttemp*node classes instead
   o this will allow descendants to prevent certain flags from being added
     or removed. E.g. for LLVM, certain temps must never be put in registers
     because it cannot typecast a value in a register from a non-record/array
     type to an array type without forcing it to memory (so if that is done
     on an lvalue, the result will be written to the memory temp instead of
     to the register)

git-svn-id: trunk@34358 -
2016-08-21 14:23:09 +00:00
svenbarth
c2662bd96a * mark defs created with create_global_internal() with df_internal so that they can be easily identified
git-svn-id: trunk@34316 -
2016-08-15 14:30:46 +00:00
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