Commit Graph

18398 Commits

Author SHA1 Message Date
Jonas Maebe
e06a759e20 - reverted r31664, it causes crashes with some ld versions :/
git-svn-id: trunk@31670 -
2015-09-13 20:14:46 +00:00
Jonas Maebe
4d0c42ee23 - removed double calling of handlemanagedbyrefpara() for managed targets,
not sure why it didn't cause problems before

git-svn-id: trunk@31668 -
2015-09-13 19:06:29 +00:00
Jonas Maebe
b12bedb9f8 - disabled InsertResStrTablesTable and InsertResStrInits for the JVM target
(they were not functional, but now cause internalerrors due to
     invocations of the high level typed constant builder rather than their
     output gets ignored)

git-svn-id: trunk@31667 -
2015-09-13 19:06:25 +00:00
Jonas Maebe
f4c868b06a * fixed infinite Java assembler writer create loop after r31625
git-svn-id: trunk@31666 -
2015-09-13 19:06:22 +00:00
Jonas Maebe
0ea38852ac * fixed compilation of the jvm compiler after r31591 - r31593
git-svn-id: trunk@31665 -
2015-09-13 19:06:19 +00:00
Jonas Maebe
cd41bf672c * use binutils 2.19+ linker script "augmentation" functionality to specify
how the fpc sections have to be linked *on Linux*. This prevents the
    "did you forget -T" warnings from ld, and in general is more correct than
    our previous approach of specifying a complete linker script without -T
    and hoping that there won't be any unexpected interactions with ld's
    built-in linker script
   o use the new -X9 command line option to generate linker scripts that
     are compatible with binutils older than 2.19 (reverts to the old
     behaviour)

git-svn-id: trunk@31664 -
2015-09-13 19:06:14 +00:00
nickysn
c7ecf84fc0 * fixed compilation of threadvars in i8086 far data memory models
git-svn-id: trunk@31662 -
2015-09-13 12:52:23 +00:00
Jonas Maebe
381270bf30 * changed the threadvars table count back from
tai_const.create_32bit_unaligned() into tai_const.create_32bit() after
    r31649 (Lazarus autocompletion...) (fixes webtbs/tw3540.pp regression)

git-svn-id: trunk@31661 -
2015-09-13 07:56:12 +00:00
Jonas Maebe
06fc6ac491 * fixed threadvar support on linux/i386 and android/i386 after r31639
(mantis #28672)

git-svn-id: trunk@31660 -
2015-09-13 07:46:31 +00:00
Jonas Maebe
75012405fa * add some llvm function flags
o in particular, mark fpc_setjmp as "returns_twice" so calls to it are
     never converted into tail calls

git-svn-id: trunk@31659 -
2015-09-12 23:34:04 +00:00
Jonas Maebe
faf4a9cb38 * moved the generation of the "main" stub for libc-based platforms from
hlcgobj to pmodules/symcreat/ngenutil, so that it also works for llvm

git-svn-id: trunk@31658 -
2015-09-12 23:34:01 +00:00
Jonas Maebe
616dbead35 + handle abs(real) internally for LLVM, as the generic code calls a helper
that is not implemented for some architectures

git-svn-id: trunk@31656 -
2015-09-12 23:33:53 +00:00
Jonas Maebe
8ff5371a6c + support mmregisters in the generic unaryminus code for floats
git-svn-id: trunk@31655 -
2015-09-12 23:33:50 +00:00
Jonas Maebe
2741b37f28 * only specify the "unnamed_addr" flag for initialised data if its symbol is
a tasmlabel, since otherwise the address needs to remain unique

git-svn-id: trunk@31654 -
2015-09-12 23:33:46 +00:00
Jonas Maebe
7a08319d2e * converted taillvmdecl properties to a set
git-svn-id: trunk@31653 -
2015-09-12 23:33:42 +00:00
Jonas Maebe
4b92083006 * converted tnodeutils.InsertRuntimeInitsTablesTable to the high level typed
const builder
   o enabled the routines that use this one for LLVM

git-svn-id: trunk@31652 -
2015-09-12 23:33:38 +00:00
Jonas Maebe
a4ee982269 * converted tnodeutils.InsertInitFinalTable to the high level typed const
builder and enabled it for LLVM

git-svn-id: trunk@31651 -
2015-09-12 23:33:35 +00:00
Jonas Maebe
f7948ff25f * removed outdated comment
git-svn-id: trunk@31650 -
2015-09-12 23:33:31 +00:00
Jonas Maebe
a1c676cc51 * converted tnodeutils.InsertThreadvarTablesTable to the high level typed
constant builder

git-svn-id: trunk@31649 -
2015-09-12 23:33:28 +00:00
Jonas Maebe
5a2217f645 + support for emitting simple placeholder elements in the high level
typed const builder, for use when e.g. emitting a table preceded by
    the number of elements in case that number is only known afterwards

git-svn-id: trunk@31648 -
2015-09-12 23:33:24 +00:00
Jonas Maebe
f49d6e5f26 * converted tnodeutils.InsertThreadvars to the high level typed constant
builder

git-svn-id: trunk@31647 -
2015-09-12 23:33:21 +00:00
Jonas Maebe
7def77dcc9 * we only support resourcestrings in ttai_typedconstbuilder.queue_emit_const()
right now, so give an internalerror if something else is passed
  * use the correct type when emitting a resourcestring like that (it will store
    the address of the resource string -> pointer to an ansistring)

git-svn-id: trunk@31646 -
2015-09-12 23:33:17 +00:00
Jonas Maebe
c813e024ee * support non-section-based threadvars on the LLVM target
git-svn-id: trunk@31645 -
2015-09-12 23:33:14 +00:00
Jonas Maebe
19882aea7e * converted threadvar loading to high level code generator and updated/added
comments

git-svn-id: trunk@31644 -
2015-09-12 23:33:10 +00:00
Jonas Maebe
83ae160057 + get_threadvar_record() to get a recorddef representing a threadvar (index
and data in case of single threaded)

git-svn-id: trunk@31643 -
2015-09-12 23:33:07 +00:00
Jonas Maebe
4da34a6046 + llvm implementation of g_set_addr_nonbitpacked_record_field_ref
git-svn-id: trunk@31642 -
2015-09-12 23:33:03 +00:00
Jonas Maebe
9ee2a0f71c + g_set_addr_nonbitpacked_record_field_ref() thlcgobj method to make a
reference pointing to the base address of a record point to a field
    of that same record

git-svn-id: trunk@31641 -
2015-09-12 23:33:00 +00:00
Jonas Maebe
5a50d05e50 * fixed skipping if intermediate fields in llvm shadow symtable
git-svn-id: trunk@31640 -
2015-09-12 23:32:56 +00:00
Jonas Maebe
3c6aa91a96 * factored out the loading of threadvars in its own method, and put the
x86-specific part in nx86ld

git-svn-id: trunk@31639 -
2015-09-12 23:32:53 +00:00
Jonas Maebe
54642f5f09 * return the added symbol from trecorddef.add_field_by_def()
git-svn-id: trunk@31638 -
2015-09-12 23:32:49 +00:00
Jonas Maebe
54172d7de4 * fixed alignment of subscripts if the variant part of a record starts at a
non-zero offset from the reference field in the llvm version of the record

git-svn-id: trunk@31637 -
2015-09-12 23:32:46 +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
cabb16efdb - removed the no longer used generation of uninitialised results for
pure assembler routines

git-svn-id: trunk@31634 -
2015-09-12 23:32:35 +00:00
Jonas Maebe
839482751d * when generating code for a pure assembler routine with LLVM, instantiate
a code and temp generator for the architectural target instead of for LLVM
  * write the code for pure assembler routines using a GNU-style external
    assembler writer for the target, with a decorator to wrap it in
    LLVM module-level assembly statements

git-svn-id: trunk@31633 -
2015-09-12 23:32:31 +00:00
Jonas Maebe
5c69d57674 + TLLVMModuleInlineAssemblyDecorator to decorate inline module-level
assembly

git-svn-id: trunk@31632 -
2015-09-12 23:32:28 +00:00
Jonas Maebe
55e84df094 + GetExternalAssemblerWithAsmInfoWriter() to get a GNU-style external
assembler writer that is compatible with the current architecture,
    for use by the LLVM assembler writer to write inline assembly

git-svn-id: trunk@31631 -
2015-09-12 23:32:24 +00:00
Jonas Maebe
6dd06a1aae * put the code for pure assembler routines in a separate asmlist, so
we can easily use a different assembler writer for them on the
    llvm target

git-svn-id: trunk@31630 -
2015-09-12 23:32:21 +00:00
Jonas Maebe
c80fb6a20e * explicitly specify whether an llvm specification is a definition (= locally
defined) or a declaration (external symbol), instead of deriving it from
    from the bind of the tasmsymbol. The reason is that with module-level
    inline assembly, some locally implemented functions (in pure assembler)
    won't have an LLVM IR body

git-svn-id: trunk@31629 -
2015-09-12 23:32:17 +00:00
Jonas Maebe
991e1f49bd * store a pointer to the used tasminfo record in every assembler writer, so
that we can use assembler writers with different conventions from the
    currently set target_asm (e.g. an x86 assembler writer for inline assembly
    in LLVM IR)

git-svn-id: trunk@31628 -
2015-09-12 23:32:13 +00:00
Jonas Maebe
4bb82b0a3f - removed unused OnlyAsm procedure
git-svn-id: trunk@31627 -
2015-09-12 23:32:09 +00:00
Jonas Maebe
e1f78cb774 * added decorator support to the external assembler writers so the LLVM
assembler writer can postprocess their output

git-svn-id: trunk@31626 -
2015-09-12 23:32:05 +00:00
Jonas Maebe
b3d0197f98 * factored out the output file handling (mostly writing data) from the
external assembler writer, so we can reuse the archtecture-specific
    writers to write inline assembly in LLVM IR files

git-svn-id: trunk@31625 -
2015-09-12 23:32:01 +00:00
Jonas Maebe
6ffd8f0201 * finalize managed data passed to untyped "out" parameters after r31328
(mantis #2863)

git-svn-id: trunk@31624 -
2015-09-12 23:31:57 +00:00
Jonas Maebe
6be050b729 * fixed finalization of open array out parameters after r31328
git-svn-id: trunk@31623 -
2015-09-12 23:31:53 +00:00
Jonas Maebe
2205549316 * changed fix for webtbs/tw20075 so that we don't check the need for
parameter/local finalization at all in pure assembler routines;
    the routines that check this also set pi_needs_got, which should
    not be set either for pure assembler routines (fixes tw20075 on
    Darwin/i386, where PIC code is enabled by default)

git-svn-id: trunk@31622 -
2015-09-12 23:31:50 +00:00
nickysn
1181eb0ddb * fixed compilation of the compiler with -dEXTDEBUG after r31588
git-svn-id: trunk@31615 -
2015-09-12 11:55:54 +00:00
nickysn
d579c45656 * pass the option "dosseg" to wlink when compiling for win16 to ensure the
proper segment ordering

git-svn-id: trunk@31613 -
2015-09-12 00:08:23 +00:00
florian
fbda104d54 * do not use a_call_ref for procedures allocating all registers since it break spilling, see also issue #28639, resolves issue #28639
git-svn-id: trunk@31608 -
2015-09-11 20:56:05 +00:00
nickysn
182dffcbd8 * fixed i8086 compilation after r31593
git-svn-id: trunk@31605 -
2015-09-11 16:20:50 +00:00