Commit Graph

978 Commits

Author SHA1 Message Date
pierre
66e7c78a8f fix position of ppuload_platform for trecorddef
git-svn-id: trunk@39913 -
2018-10-11 21:02:25 +00:00
pierre
88bddc2cb0 Fix ppuload for string type for i8086, use getasizeint for all string defs but short string
git-svn-id: trunk@39912 -
2018-10-11 20:38:39 +00:00
svenbarth
06267006f3 * explicitely handle the boolean types to determine the bit size as all of them have the bit size 1
+ added test

git-svn-id: trunk@39786 -
2018-09-21 13:24:49 +00:00
svenbarth
ecc02f3fdb * always search in the current module as well as its symtables are be popped already in case of RTTI generation
git-svn-id: trunk@39688 -
2018-08-29 19:21:28 +00:00
svenbarth
190716ac0e * move getrecorddef and gettabledef from TVMTWritter to symdef as they might be used from the RTTI as well
git-svn-id: trunk@39687 -
2018-08-29 19:21:23 +00:00
svenbarth
61bde67082 + add method has_non_trivial_init_child() to tdef which provides access to the symtable's
sto_has_non_trivial_init flag

git-svn-id: trunk@39253 -
2018-06-20 19:00:11 +00:00
svenbarth
8423fd7632 * also process procsyms when adding a symtable as they may be generic dummy symbols as well
git-svn-id: trunk@39231 -
2018-06-15 13:49:16 +00:00
nickysn
17823821ca * make procedures and functions, declared in the interface part of a unit in an
i8086 far code memory model to be 'far' even in {$F-} mode. This is TP7
  compatible.

git-svn-id: trunk@38728 -
2018-04-10 15:37:28 +00:00
nickysn
55386ba547 + show whether a procedure or function is far in tprocdef.customprocname
git-svn-id: trunk@38725 -
2018-04-10 13:23:06 +00:00
nickysn
c7503ca291 + introduced tabstractprocdef.ofs_address_type - the address type, generated for
ofs()

git-svn-id: trunk@38681 -
2018-04-04 15:16:42 +00:00
nickysn
7a7e09982b + show whether a procdef is far in tprocvardef.GetTypeName
git-svn-id: trunk@38599 -
2018-03-22 22:57:34 +00:00
florian
6d5ce55232 * unified def creation for open arrays
git-svn-id: trunk@38408 -
2018-03-04 17:59:05 +00:00
svenbarth
b765d661ce * when registering a def also register the syms and defs of its symtables
git-svn-id: trunk@37340 -
2017-09-27 20:34:38 +00:00
svenbarth
a6821c63e0 * store the type of the helper that had been encountered during parsing in the objectdef and by extension the PPU
git-svn-id: trunk@37202 -
2017-09-13 21:24:06 +00:00
svenbarth
0b02dab684 + new Delphi-compatible intrinsic GetTypeKind() which returns the TTypeKind of a type as a constant value (and thus can be optimized away in If- and Case-statements)
+ added test

git-svn-id: trunk@36875 -
2017-08-11 22:12:53 +00:00
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