Commit Graph

95 Commits

Author SHA1 Message Date
Jonas Maebe
7b89072d88 * fixed external wrapper generation on llvm
git-svn-id: trunk@32472 -
2015-11-22 11:49:40 +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
Jonas Maebe
919bce9819 * also construct the high level code generator for high level targets; they
don't use it for creating interface stubs, but they do for the abstract
    wrappers

git-svn-id: trunk@31684 -
2015-09-15 11:51:22 +00:00
Jonas Maebe
c7a418829b * support for implementing interface method wrappers at the node tree
level, used by LLVM

git-svn-id: trunk@31636 -
2015-09-12 23:32:42 +00:00
Jonas Maebe
be2ec5be59 * write full/init rtti and VMTs separately instead of at the same time
o this allows us to write the VMTs earlier (before the synthetic method
     implementations are generated), which means we can create new synthetic
     methods while generating the VMTs (for interface trampolines)

git-svn-id: trunk@31635 -
2015-09-12 23:32:38 +00:00
Jonas Maebe
b4e61b2469 * enable the llvm code generator for VMT generation
git-svn-id: trunk@31288 -
2015-08-05 21:06:04 +00:00
Jonas Maebe
2cfc3ca4d1 * end the vmtdef aggregate so appropriate padding is inserted (if necessary)
git-svn-id: trunk@31253 -
2015-07-30 16:58:11 +00:00
Jonas Maebe
6f4fe415e9 * support specifying the alignment of the start of an anonymous record
in the typed const builder (packrecords is not enough in case there are
    only fields smaller than the desired alignment)

git-svn-id: trunk@31250 -
2015-07-30 16:58:01 +00:00
Jonas Maebe
b55c7df996 * factored out internal type prefixes
git-svn-id: trunk@31248 -
2015-07-30 16:57:55 +00:00
Jonas Maebe
508828958c * changed getprocaddressprocvar() into a tprocvardef.getreusableprocaddr()
class method

git-svn-id: trunk@31148 -
2015-06-23 21:23:22 +00:00
Jonas Maebe
f40ea04540 * changed getarraydef() into a tarraydef.getreusable() class method
git-svn-id: trunk@31147 -
2015-06-23 21:23:18 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
Jonas Maebe
3597e710b6 * fixed several VMT element types to correspond to the types used to
construct the VMT def in the VMT builder in r30950

git-svn-id: trunk@31063 -
2015-06-13 22:48:46 +00:00
Jonas Maebe
3f736f6114 * handle the loading of VMT entries at the node level, so it's done in a
type-safe way (for LLVM, and also internal consistency checking between
    the VMT as generated in nobj.pas and ncgvmt.pas)
   o also converted the VMT validity checking to the node level

git-svn-id: trunk@30950 -
2015-05-31 16:50:47 +00:00
Jonas Maebe
bd8079f896 * cache and reuse procvardefs internally created to get the address of a
procdef (halves the amount of memory needed to compile the googlapi
    package using a build unit, as done by fpmake)

git-svn-id: trunk@30856 -
2015-05-14 15:36:20 +00:00
Jonas Maebe
3be51e1455 * fixed endless recursion in tabstractrecorddef.contains_float_field() in
case a record contains an internal typed constant of its own type
    (which happened becuase such a typed constant is also fieldvarsym, solved
     by checking for sp_static) (mantis #27880)
  * fixed several other similar cases in the compiler where we are only
    interested in instance fields, but processed all fieldvarsyms

git-svn-id: trunk@30614 -
2015-04-16 21:25:22 +00:00
nickysn
9c52c98b77 * use default_settings.packrecords, instead of 0 (since that's different for
i8086) for the packrecords parameter of begin_anonymous_record in
  intf_write_table. This fixes interfaces in i8086 far code or data memory
  models.

git-svn-id: trunk@30389 -
2015-03-30 01:39:47 +00:00
Jonas Maebe
69e7b06cef * converted rest of VMT generation to high level typed const builder
git-svn-id: trunk@30369 -
2015-03-29 18:16:48 +00:00
Jonas Maebe
25e6eaf07f * store the to be used recordalignmin and maxcrecordalign settings inside
(abstract)recordsymtables, so that these settings don't depend on the
    current user settings when internally creating record definitions

git-svn-id: branches/hlcgllvm@30343 -
2015-03-27 21:25:56 +00:00
Jonas Maebe
687bb15299 * renamed getdatalabel() to getglobaldatalabel
git-svn-id: branches/hlcgllvm@30336 -
2015-03-27 21:25:34 +00:00
Jonas Maebe
5e1bb8e408 + tcalo_make_dead_strippable to indicate that a typed constant data block
should be dead-strippable; may imply the creation of a separate section
    (on platforms that dead-strip data based on sections), but does not
    require it
  * replaced all existing tcalo_new_section uses with
    tcalo_make_dead_strippable, as that is their meaning/purpose

git-svn-id: branches/hlcgllvm@30335 -
2015-03-27 21:25:30 +00:00
Jonas Maebe
e924dbed90 * moved the specification of the options for a ttai_typedconstbuilder from
get_final_asmlist() to the constructor, in preparation of supporting the
    creation of internal builders for local data that will ignore some of the
    irrelevant flags (at creation time)

git-svn-id: branches/hlcgllvm@30334 -
2015-03-27 21:25:27 +00:00
Jonas Maebe
427b05e97c * converted TVMTWriter.intf_write_table() to the high level typed constant
builder
   o removed variant record part in the RTL to force a specific size/alignment,
     since we now import the record into the compiler and hence it will always
     be handled correctly

git-svn-id: branches/hlcgllvm@28777 -
2014-10-06 20:54:23 +00:00
Jonas Maebe
8af5ef911b * converted TVMTWriter.writeinterfaceids() to the typed constant builder
git-svn-id: branches/hlcgllvm@28774 -
2014-10-06 20:54:15 +00:00
Jonas Maebe
8fa4c69f1f * converted generation of class and fields table to the typed constant builder
git-svn-id: branches/hlcgllvm@28772 -
2014-10-06 20:54:10 +00:00
Jonas Maebe
984491e435 * factored out emitting a shortstring constant via the typed constant builder
git-svn-id: branches/hlcgllvm@28771 -
2014-10-06 20:54:07 +00:00
Jonas Maebe
f8cda69446 * converted generting published method tables to the typed constant builder
git-svn-id: branches/hlcgllvm@28770 -
2014-10-06 20:54:04 +00:00
Jonas Maebe
5ecb2faf93 * converted generting method message integer dispatch tables to the typed
constant builder

git-svn-id: branches/hlcgllvm@28769 -
2014-10-06 20:54:02 +00:00
Jonas Maebe
67647d4ee0 * converted emitting method message string tables to the typed constant
builder

git-svn-id: branches/hlcgllvm@28768 -
2014-10-06 20:53:59 +00:00
Jonas Maebe
f8d4d20f5a * converted emitting the class name to the typed constant builder class
git-svn-id: branches/hlcgllvm@28767 -
2014-10-06 20:53:57 +00:00
Jonas Maebe
b745dcc64c * moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
for some platforms it depends on that routine

git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
5fa09fa2f4 * changed tcallnode.fforcedprocname from shortstring into tsymstr,
so it doesn't truncate mangled names for the JVM target (it's
    used there since r27149)
   o adapted a number of WPO helpers to use tsymstr instead of
     shortstring, but the WPO devirtualization functionality is
     still limited to shortstrings internally

git-svn-id: trunk@27741 -
2014-05-10 12:47:25 +00:00
Jonas Maebe
8d4c372d50 * removed ifdef jvm from ncgvmt
git-svn-id: trunk@27154 -
2014-03-16 11:24:44 +00:00
sergei
8f6d8b849e * Generate interface wrappers together with data structures of class they belong to, and place everything into single assembler slice (since all wrappers are always referenced by VPTR, attempting to smartlink them is useless). This removes separate iteration pass over symtables and reduces amount of smartlink files.
git-svn-id: trunk@26868 -
2014-02-24 15:33:15 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
nickysn
088c06d308 * fixed class VMT generation for the i8086 medium memory model (near code, far data) by setting correctly the Tasmsymtype to each symbol according to whether it points to code or data
git-svn-id: trunk@25276 -
2013-08-18 00:03:55 +00:00
Jonas Maebe
d8c84706dd * use Tai_symbol.Create_global() when emitting a global symbol for an
abstract method wrapper (tai_symbol.create() currently overrides the
    symbol type from global to local; will fix in next commit)
  * only generate global abstract method wrappers for the class in which
    the abstract method is declared to prevent duplicate symbol errors
    after the above fix

git-svn-id: trunk@25265 -
2013-08-16 10:09:37 +00:00
sergei
92811d09c1 * Generate stub bodies for abstract methods, so corresponding symbols can be referenced from code. Resolves #24536.
git-svn-id: trunk@25260 -
2013-08-15 10:04:37 +00:00
sergei
3a12e94d21 * TVMTWriter.writeinterfaceids: pass target asmlist as parameter.
* Changed section type for interface GUID and name from sec_rodata to sec_rodata_norel, because GUIDs and strings are not relocatable.

git-svn-id: trunk@25259 -
2013-08-14 11:54:00 +00:00
nickysn
d0fa5fff8c * use Tai_const.Create_nil_dataptr in TVMTWriter.intf_gen_intf_ref for writing the nil value for the GUID ptr of Corba interfaces
git-svn-id: trunk@25201 -
2013-07-31 15:18:13 +00:00
nickysn
a000d65447 * use Taiconst.Create_nil_codeptr when writing nil values for abstract methods in TVMTWriter.do_gen_published_methods
git-svn-id: trunk@25199 -
2013-07-31 14:51:18 +00:00
nickysn
b85f87620c * use Tai_const.Create_nil_dataptr for creating the nil pointers located before the method table in the class vmt
git-svn-id: trunk@25194 -
2013-07-30 23:09:52 +00:00
nickysn
0bdd9db7a2 * terminate the list of virtual method pointers in the vmt with Tai_const.Create_nil_codeptr
git-svn-id: trunk@25193 -
2013-07-30 23:04:25 +00:00
nickysn
9b364f4989 * use Tai_const.Create_nil_dataptr instead of Tai_const.Create_sym(nil) when writing nil for the parent vmt pointer
git-svn-id: trunk@25191 -
2013-07-30 22:48:05 +00:00
sergei
d54d38b4ab * Moved all code responsible for writing VMTs and interface wrappers (nobj.TVMTWriter, ncgutil.gen_intf_wrappers, ptype.write_persistent_type_info) into a new unit ncgvmt.pas.
This improves compiling speed a bit (two iterations over symtables replaced by one, code generator is created once per unit rather than once per class).
In perspective it makes possible to reduce amount of generated smartlink sections and global labels.

git-svn-id: trunk@24269 -
2013-04-19 13:31:27 +00:00