Commit Graph

112 Commits

Author SHA1 Message Date
Sven/Sarah Barth
d8aa721f88 * free the placeholder for the count of the dynamic array in end_dynarray_const() and document it as such
(cherry picked from commit 1180589046)
2022-04-09 15:05:32 +02:00
Jonas Maebe
76045bfc04 * merged macOS/AArch64 support + revisions these changes depended on
git-svn-id: branches/fixes_3_2@46866 -
2020-09-15 19:40:36 +00:00
marco
edf32cd5dc The Important Ones:
- 39683, 39684, 39685, 39686 (rework of Interface Method RTTI)
- 39687, 39688, 39689, 39690, 39709, 39710 (change of PPU version)

git-svn-id: branches/fixes_3_2@39809 -
2018-09-26 12:50:46 +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
Jonas Maebe
d664038aa4 * don't add ".reference" assembler directives on Darwin for symbols that are
in sections marked as "no_dead_strip"

git-svn-id: trunk@34387 -
2016-08-28 22:07:49 +00:00
Jonas Maebe
4a42d67b72 + ttai_typedconstbuilder.get_dynstring_rec() class method to get a recorddef
that represents an ansi/unicode/widestring constant of a particular length

git-svn-id: trunk@34372 -
2016-08-24 16:41:02 +00:00
Jonas Maebe
e91ba32b7c * changed the result of get_dynstring_rec_name() to TSymStr
git-svn-id: trunk@34371 -
2016-08-24 16:40:59 +00:00
svenbarth
131a7bbc67 Fix cycling.
* correctly handle tcalo_data_force_indirect in finalize_vectorized_dead_strip_asmlist()
* correctly handle tcdssso_use_indirect in get_vectorized_dead_strip_section_symbol()

git-svn-id: trunk@34193 -
2016-07-23 16:34:26 +00:00
svenbarth
4df4449933 Extend the ttypedconstbuilder's dead_stripe_section handling (get_vectorized_dead_strip_section_symbol() and finalize_vectorized_dead_strip_asmlist()) with the ability to
- register a symbol in the unit's public or extern asm symbol list
 - add an indirect symbol when defining the symbol
 - use an indirect symbol instead of the direct one
This will be needed to correctly handle resourcestrings for packages

git-svn-id: trunk@34182 -
2016-07-22 15:55:14 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
Jonas Maebe
8fea7344c9 * added an extra parameter to ttai_typedconstbuilder.emit_pchar_const() to
indicate whether it should create a copy of the pchar or not

git-svn-id: trunk@34153 -
2016-07-19 14:30:36 +00:00
Jonas Maebe
8ca9ece66a * fixed buffer overrun in tai_aggregatetypedconst.add_to_string()
git-svn-id: trunk@33988 -
2016-06-15 18:31:42 +00:00
nickysn
452d9b747b * fixed code generation for initialized pointer variables, with the initial
value set to the address of an external variable in the i8086 medium and
  compact memory models. Should fix Mantis #30107

git-svn-id: trunk@33981 -
2016-06-13 00:29:32 +00:00
Jonas Maebe
ccf011dbc5 * C-style blocks are implicit pointers -> don't parse such typed constants
as a record

git-svn-id: trunk@33924 -
2016-06-05 21:34:42 +00:00
Jonas Maebe
508038a691 + emit_pchar_const() helper for high level typed const builder
git-svn-id: trunk@32899 -
2016-01-10 14:01:24 +00:00
Jonas Maebe
53bf43983a + support for emitting weak symbols with the high level typed constant builder
git-svn-id: trunk@32883 -
2016-01-07 22:06:06 +00:00
Jonas Maebe
1046c995a8 * ttai_typedconstbuilder.finalize_asmlist(): fixed handling of non-local
symbols that aren't AB_GLOBAL (e.g. AB_PRIVATE_EXTERN)

git-svn-id: trunk@32878 -
2016-01-07 22:05:28 +00:00
Jonas Maebe
926e62c886 + tai_aggregatetypedconst.changetorecord() to change the type of an
aggregate to a (new) recorddef
   o the size of the original type and that of the record must match
   o will be used by the LLVM generator in case of a variant record, or
     an array of variant records with constant data that does not match
     our canonical LLVM definition

git-svn-id: trunk@32718 -
2015-12-25 21:05:40 +00:00
Jonas Maebe
f83f9168ee * emit all resource strings and internal dynamic string data using the
def representing that string type, instead of using p(wide)char
   o these string types are represented the same in llvm as p(wide)char,
     but this way we can check whether the emitted data type matches the
     expected one in the future

git-svn-id: trunk@32715 -
2015-12-25 21:05:26 +00:00
Jonas Maebe
5774238887 * always keep track of the field about to be emitted in curfield, as we
will need this for LLVM to determine whether the emitted data completely
    matches the definition (if not, we have to create a def for the actual
    data)
  - removed no longer used fieldoffsets property

git-svn-id: trunk@32712 -
2015-12-25 21:05:12 +00:00
Jonas Maebe
ce40b2e449 * added/clarified some comments
* made internal method check_add_placeholder() protected

git-svn-id: trunk@32606 -
2015-12-07 09:17:11 +00:00
Jonas Maebe
ac743195b6 * fixup for r32534: don't define external symbols, only reference them
(mantis #29091)

git-svn-id: trunk@32535 -
2015-11-26 07:56:50 +00:00
Jonas Maebe
ac18eb005f * make the vectorized dead strip section symbol external for files that
don't define it

git-svn-id: trunk@32534 -
2015-11-25 22:25:54 +00:00
Jonas Maebe
f37576cf0f * fixed type of resourcestrings in typed constants
git-svn-id: trunk@32467 -
2015-11-22 11:49:21 +00:00
Jonas Maebe
0bceb953e5 * fixed high level type of unicodestring records
git-svn-id: trunk@32466 -
2015-11-22 11:49:18 +00:00
Jonas Maebe
27219ae5ff * actually assign the section name for end of the resourcestrings
git-svn-id: trunk@32430 -
2015-11-21 14:31:08 +00:00
florian
1142fdeccd * initialize variables to avoid warnings
git-svn-id: trunk@32428 -
2015-11-21 14:14:30 +00:00
Jonas Maebe
f60a33f5af * moved darwin/aix-specific code for resource string sections to
ttai_lowleveltypedconstbuilder (will have to be handled differently
    for llvm)

git-svn-id: trunk@32427 -
2015-11-21 12:37:53 +00:00
Jonas Maebe
4974201d7f + provide way to specify a custom section name for vectorized dead strippable
sections
   o does nothing by default, will be used by llvm

git-svn-id: trunk@32398 -
2015-11-21 12:36:20 +00:00
Jonas Maebe
91abc54314 * implemented emitting items in a vectorized dead strippable section to
high level typed constant builder
  * converted resource string emission to this system

git-svn-id: trunk@32395 -
2015-11-21 12:36:10 +00:00
Jonas Maebe
96b529072a * factored out generating the start and end of a vectorized dead strippable
section to the high level typed const builder, and use this functionality
    for the resource strings (generating items: todo)
  * fixed dead stripping unused resource strings (all string data was put in the
    same section since r30342)

git-svn-id: trunk@32394 -
2015-11-21 12:36:06 +00:00
Jonas Maebe
964f8c9f9b * factored out the creation of start/end symbols of vectorized dead strippable
sections such as the resourcestring data

git-svn-id: trunk@32391 -
2015-11-21 12:35:56 +00:00
Jonas Maebe
998cdbfe79 - removed useless ansistring pointer def creation from r32209
git-svn-id: trunk@32210 -
2015-10-30 20:56:34 +00:00
Jonas Maebe
0dee7cb4a0 * converted emitting resourcestring references to the high level typed
constant builder

git-svn-id: trunk@32209 -
2015-10-30 20:45:22 +00:00
yury
b26fa07f1a * Fixed notes "var is assigned but not used".
git-svn-id: trunk@31734 -
2015-09-17 13:03:04 +00:00