Commit Graph

143 Commits

Author SHA1 Message Date
Michaël Van Canneyt
8696ca652d * Emit comments in RTTI info for classes/interfaces 2023-05-29 13:41:25 +00:00
Jonas Maebe
a8352f3e99 ttai_typedconstbuilder: do not remove tcalo_vectorized_dead_strip_item
This was done because originally getting the finalized asmlist happend
through a single proc that either called the vectorized version or the
regular version depending on the presence of tcalo_vectorized_* flags.

Nowadays, calling either get_final_asmlist_vectorized_dead_strip or
get_final_asmlist happens directly as needed.

This flag will be used by the LLVM asmwriter to add appropriate
address sanitizer information.
2022-07-06 22:25:05 +02:00
Jonas Maebe
70908b1449 llvm: support for adding/subtracting constants to pointers in typed constants
Fixes webtbs/tw34027 for llvm
2022-05-29 13:33:27 +02:00
J. Gareth "Curious Kit" Moreton
f6c741ee73 * Corrected label reference counts caused by TAsmLabel.GetName incrementing refs 2022-05-14 18:57:05 +00:00
Jonas Maebe
f1bcd02aaf Typed const builder: store tsym
Useful for LLVM debug info generation
2022-05-13 22:49:02 +02:00
Sven/Sarah Barth
1180589046 * free the placeholder for the count of the dynamic array in end_dynarray_const() and document it as such 2022-04-08 16:11:49 +02:00
florian
ee10850a57 * patch by Sergey Larin: Reducing and aligning the size of TAnsiRec, TUnicodeRec for CPU64, resolves :
For CPU64, the size of record TAnsiRec and TUnicodeRec is 16 bytes instead of 24.
    Which is very good also because of the alignment. when allocating memory, the address
    of the first character of the string will be aligned on the 16-byte boundary.
    At the same time, the useless Dummy field, which is needed in CPU64 for exactly alignment, has been removed.
    For CPU32 (and CPU16), the record size has not changed, so procedures such as
    fpc_AnsiStr_Decr_Ref, implemented in assembler (see i386, arm), remained working correctly.
  * tests adapted
2021-10-17 11:13:29 +02:00
Jonas Maebe
ab01b0ebd7 Typed constants: no internalerror on failure
Don't check whether the expression queue is empty in the destructor in case
there was an error. Also improved error messages (constant expression instead
of variable expression expected).

Resolves 
2021-10-03 21:46:23 +02:00
nickysn
940738a3a1 * synchronized with trunk
git-svn-id: branches/wasm@48846 -
2021-03-01 13:21:24 +00:00
Jonas Maebe
6beb28316e * Darwin targets that don't support link order sym files can't smart link
vectorized sections

git-svn-id: trunk@48765 -
2021-02-21 21:41:09 +00:00
nickysn
ae75c87d65 * synchronized with trunk
git-svn-id: branches/wasm@48515 -
2021-02-06 08:27:24 +00:00
florian
d0910b5ac8 * allow sub/add nodes in constant pointer expressions, resolves
git-svn-id: trunk@48514 -
2021-02-05 22:10:27 +00:00
nickysn
60d21bcf0d * fix llvm-mc error for string constants missing a .size directive
git-svn-id: branches/wasm@48252 -
2021-01-21 02:59:59 +00:00
Jonas Maebe
1c61c30cd2 * added "const" to some string parameters
git-svn-id: trunk@47299 -
2020-11-03 21:34:15 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
yury
9e11f8122f * Corrected r46481. Use both tcalo_new_section and tcalo_make_dead_strippable flags since only the default implementation implies a new section creation when tcalo_make_dead_strippable is specified.
git-svn-id: trunk@46482 -
2020-08-18 12:27:46 +00:00
yury
17e75004c5 * Allow library based smartlinking of indirect symbol entries.
git-svn-id: trunk@46481 -
2020-08-18 12:02:20 +00:00
yury
764227193a * Added on option to implement library based smartlinking of the dead stripable vectorized lists (e.g. resource strings index). By default smartlinking of such lists only supported when the section based smartlinking (tf_smartlink_sections) is enabled for a target.
git-svn-id: trunk@46479 -
2020-08-18 11:31:39 +00:00
Károly Balogh
1df56495b7 * fix a typo in a comment. no functional change
git-svn-id: trunk@45364 -
2020-05-14 15:23:27 +00:00
svenbarth
b88107fa1d * due to an apparent bug in the clang assembler for COFF when assembling ADRP instructions we can't use symbols that are offset into their section
git-svn-id: trunk@44948 -
2020-04-21 06:06:31 +00:00
Jonas Maebe
4ba19f5418 * add support for creating non-address-only procvars to
cprocvar.getreusableprocaddr()

git-svn-id: trunk@44516 -
2020-04-02 21:21:36 +00:00
yury
1b3a3a7983 * Removed lot of unused local vars. It is useful to turn on the notes in options. :)
git-svn-id: trunk@44053 -
2020-01-28 18:45:33 +00:00
Jonas Maebe
1a9e246c29 * added is_normal_fieldvarsym() helper and use it
o fixes several places where there was a check whether something is a
     fieldvarsym, but not whether it's an instance rather than a class field

git-svn-id: trunk@43786 -
2019-12-24 22:12:44 +00:00
Jonas Maebe
d8903ce6b3 - removed maxcrecordalign parameter/field from recordsymtables, as this value
cannot be modified in the settings (so we can directly use the one from
    current_settings)

git-svn-id: trunk@42447 -
2019-07-14 19:24:32 +00:00
Jonas Maebe
3fa6838815 * basic llvm metadata support
git-svn-id: branches/debug_eh@41978 -
2019-05-02 19:45:26 +00:00
Jonas Maebe
079d616978 * fixed double free in LLVM code generator after r41963
git-svn-id: trunk@41976 -
2019-05-02 19:40:00 +00:00
Jonas Maebe
97a144ea6a - removed ttypedconstkind parameter from tai_simpletypedconst constructor,
as it always has to be tck_simple anyway

git-svn-id: trunk@41975 -
2019-05-02 19:39:56 +00:00
Jonas Maebe
213b87fe91 * optimized and simplified tai_aggregatetypedconst destruction
git-svn-id: trunk@41963 -
2019-04-30 19:36:46 +00:00
Jonas Maebe
d150869dea * record symbols that need to remain in their original order, and on Darwin
pass them to the linker so it does not reorder them
   o fixes resource strings on Darwin when using LTO (this used to reorder the
     resource string symbols, so they no longer all appeared between the START
     and END symbols for their compilation module)

git-svn-id: trunk@41907 -
2019-04-20 18:18:10 +00:00
Jonas Maebe
4d03f3a65e * fixed LLVM memory leaks
git-svn-id: trunk@40732 -
2019-01-01 16:22:31 +00:00
Jonas Maebe
f87304f5ca * fixed LLVM code generator not taking into account constalignmin/max
settings for typed constants

git-svn-id: trunk@40605 -
2018-12-21 20:57:22 +00:00
Jonas Maebe
97b40dc16d * fixed dynamic array constants for llvm
git-svn-id: trunk@40383 -
2018-11-28 19:23:25 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
svenbarth
8bf3661f7f + add a method to emit a reference to a pooled shortstring constant (aka one per unit); very useful for new RTTI tables to avoid poluting the binary with string constants
git-svn-id: trunk@39683 -
2018-08-29 19:20:20 +00:00
pierre
a1bbd4c02d Try to avoid inserting all RTTI symbols into executables on targets not supporting smartlinked sections
git-svn-id: trunk@39121 -
2018-05-25 20:44:24 +00:00
svenbarth
2bf5c28077 + add methods begin_dynarray_const and end_dynarray_const which can be used to emit the data of a dynamic array
inbetween
+ add method emit_dynarray_offset to emit a reference to that data with the correct offset

git-svn-id: trunk@39040 -
2018-05-20 11:50:13 +00:00
svenbarth
e863245021 + add method get_dynarray_symofs to retrieve the platform specific offset of the dynamic array data from its
meta data record

git-svn-id: trunk@39039 -
2018-05-20 11:50:11 +00:00
svenbarth
d3d9221c8d + add method get_dynarray_header_size to retrieve the size of the dynamic array meta data record
git-svn-id: trunk@39038 -
2018-05-20 11:50:09 +00:00
svenbarth
2eac60cd87 * use a unique internal error
git-svn-id: trunk@39024 -
2018-05-18 14:43:31 +00:00
florian
2ad265505b * properly align unicode- and ansistring constants
git-svn-id: trunk@36545 -
2017-06-19 21:18:03 +00:00
Jonas Maebe
f3ebde999f * extracted the code to generate the indirect symbols from
finalize_asmlist() into its own method. finalize_asmlist() must not
    generate new data, as it is /the/ method that gets overridden by
    descendent classes to generate the symbol data in the format needed
    by the platform
   o fixes generation of indirect symbol data for LLVM

git-svn-id: trunk@36265 -
2017-05-19 21:52:42 +00:00
svenbarth
822d96776b * extend tai_typedconstbuilder with the ability to add an indirect symbol to the same section as the one that's generated for the constant data (at least if it's also rodata)
git-svn-id: trunk@35365 -
2017-01-29 17:39:52 +00:00
Jonas Maebe
a0c50336f3 * initialize tguid typed constants by searching for the named fields we need,
rather than assuming they appear in a fixed order in the symtable (so that
    adding e.g. record methods doesn't mess things up)

git-svn-id: trunk@35190 -
2016-12-23 20:17:09 +00:00
Jonas Maebe
827e980351 * fixed comment typo
git-svn-id: trunk@35036 -
2016-12-02 12:32:48 +00:00
Jonas Maebe
9727f289b1 + tcalo_apply_constalign option to specify that the alignment should be
modified by applying user alignment settings (so it can be only done for
    user-defined data, not not for internally generated data)
   o set this option for user-defined data

git-svn-id: trunk@34633 -
2016-10-06 06:25:05 +00:00
nickysn
6eeb6ee95a * also use sizesinttype, instead of ptrsinttype for the string reference count
and length in ttai_typedconstbuilder.get_dynstring_rec

git-svn-id: trunk@34622 -
2016-10-04 14:31:49 +00:00
nickysn
b3deb8a152 * use sizeint, instead of pint/ptrsinttype for emitting the reference count and
length of string constants

git-svn-id: trunk@34621 -
2016-10-04 14:23:44 +00:00
Jonas Maebe
4ca50bc9eb * removed optimisation to reduce the number of unnecessary section headers
in the high level typed constant builder, as it does not work if the
    passed list to start_internal_data_builder() is used for multiple
    nested builders (you can't know what the last section was) -> always
    emit a section header for a nested typed const builder

git-svn-id: trunk@34391 -
2016-08-28 22:08:00 +00:00
Jonas Maebe
a7c893064a * only don't insert passing alignment immediately for anonymous records
rather than for any anonymous aggregate, since for arrays we do know
    the alignment even if we don't know the element count (because it only
    depends on the elementdef, which is/will be set immediately)

git-svn-id: trunk@34390 -
2016-08-28 22:07:57 +00:00
Jonas Maebe
6c40105037 * fixed typo
git-svn-id: trunk@34389 -
2016-08-28 22:07:54 +00:00