Commit Graph

989 Commits

Author SHA1 Message Date
Jonas Maebe
0db9ff5c39 * fixed packed bitsize calculation for types with a negative lower bound and
and upper bound just below the next power of two (mantis #34971)

git-svn-id: trunk@41161 -
2019-02-01 17:31:53 +00:00
florian
8d3d5276d7 * open arrays and arrays of consts might be only stack tainting if they are passed by value
git-svn-id: trunk@41008 -
2019-01-22 21:58:05 +00:00
Jonas Maebe
91d5457b38 * moved around/replaced the following procedures to stop nflw from depending
on pdecsub (node units should not depend on parser units):
   o maybe_add_public_default_java_constructor()
   o handle_calling_convention()
   o create_finalizer_procdef() (replaced with create_outline_procdef())
   o insert_record_hidden_paras()
   o handle_calling_convention()
   o proc_add_definition()
   o build_parentfpstruct()
   o maybe_guarantee_record_typesym()
   o get_first_proc_str()
  * factored out the creation of a procinfo for a nested procdef based on a
    subnodetree of the current procdef into tprocinfo.create_for_outlining()

git-svn-id: trunk@40773 -
2019-01-05 16:26:33 +00:00
Jonas Maebe
f754978540 * handle constructor function results that have been migrated to the
parentfpstruct the same as regular function results (see r32687)

git-svn-id: trunk@40641 -
2018-12-25 15:36:24 +00:00
Jonas Maebe
acf02ab64b * when creating wrappers, add a prefix to parameter names to prevent them
hiding the method name of the wrapped routine
   o also add a few more '&' prefixes to the generated wrapper code to
     prevent issues when keywords are used as identifiers

git-svn-id: trunk@40634 -
2018-12-24 22:10:06 +00:00
Jonas Maebe
95d79296bd * fixed alignment of tfiledef (same as corresponding file recorddef)
* cap set alignment to sizeof(aint)

git-svn-id: trunk@40442 -
2018-12-01 23:07:05 +00:00
Jonas Maebe
50ab607676 + customint torddef type to create arbitraty bit-width integers
o use this to handle non-power-of-two-sized parameters for llvm
   o no general support in the parser/code generator, so don't expose

git-svn-id: trunk@40398 -
2018-11-29 20:57:08 +00:00
yury
c2c942374d * Removed inline for methods which are too big.
git-svn-id: trunk@40224 -
2018-11-05 14:33:39 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
pierre
ae0c180e0b Avoid overflow in code
git-svn-id: trunk@40113 -
2018-10-31 15:49:14 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
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