Commit Graph

708 Commits

Author SHA1 Message Date
Jonas Maebe
78535bbcd8 agllvm: support for writing specialised metadata nodes 2022-05-13 22:49:02 +02:00
Jonas Maebe
d294731542 LLVM: enable DWARF debug info generation 2022-05-13 22:49:02 +02:00
Jonas Maebe
527c68b6c3 agllvm: remove useless code 2022-05-13 22:49:02 +02:00
Jonas Maebe
a8cb061a50 LLVM: support for attaching metadata to instructions 2022-05-13 22:49:02 +02:00
Jonas Maebe
4293d4455c LLVM: factor out writing operands in agllvm 2022-05-13 22:49:02 +02:00
Jonas Maebe
411fa298ae LLVM: data location debug info support
This was added to LLVM for Fortran arrays, but can also be used for Pascal
dynamic arrays
2022-05-13 22:49:02 +02:00
Jonas Maebe
1d010d918b LLVM metadata: specialised metadata fleshing out 2022-05-13 22:49:02 +02:00
Pierre Muller
69d40dd17a Use round to convert float constant into s64comp type for LLVM compiler as is done in general case 2022-05-12 22:32:26 +02:00
pierre
04ebdf8df8 Fix compilation for x86_64 llvm variant
git-svn-id: trunk@49477 -
2021-06-05 06:47:46 +00:00
pierre
aadcb00977 Add -march option to clang call for llvm target
git-svn-id: trunk@49475 -
2021-06-04 21:14:34 +00:00
florian
fe57cd3536 * fix LLVM after r48828
* global gotos really use the return type of fpc_setjmp to test where we come from

git-svn-id: trunk@48835 -
2021-02-27 22:07:58 +00:00
Jonas Maebe
80282d6eff * llvm: only set custom parameter alignments for byval parameters, the rest
is handled automatically by llvm (and since llvm 11.0 you get an error if
    you specify an alignment for them anyway)

git-svn-id: trunk@48100 -
2021-01-06 22:35:40 +00:00
Jonas Maebe
c3e2285c45 * when getting an llvm temporary recorddef, recurse into arrays rather than
treating them as opaque defs. This is required to ensure that the temporary
    recorddef for all x86-64 function results are the same on the caller and
    callee side, as we allocate new arrays when generating them

git-svn-id: trunk@47584 -
2020-11-25 18:44:44 +00:00
pierre
96f2e683e7 Also accept s80bit real constants when FPC_SOFT_FPUX80 macro is defined
git-svn-id: trunk@47557 -
2020-11-24 15:31:26 +00:00
Jonas Maebe
6d0ce1c4b6 * LLVM: ensure that the parameter types are processed of procdefs that are
declared when they get first called
   o fixes compilation of several tests/test/tobjc* tests after r46675

git-svn-id: trunk@47160 -
2020-10-23 15:09:34 +00:00
Jonas Maebe
080d8c28f7 * LLVM 11.0 support
git-svn-id: trunk@47121 -
2020-10-17 14:59:04 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +00:00
Jonas Maebe
3208929e17 * add Xcode-11.0 as LLVM target version versin
git-svn-id: trunk@46676 -
2020-08-23 21:11:13 +00:00
Jonas Maebe
453bfcd370 * emit the correct declaration for procdefs used to force a procname in LLVM
o fixes lazarus startup on macOS/AArch64 when compiled with the LLVM cg

git-svn-id: trunk@46675 -
2020-08-23 21:11:09 +00:00
yury
6e777d8967 * ait_comment,ait_regalloc,ait_tempalloc,ait_varloc instructions produce only comments in the external assembler output. Moved handling of these instructions to TExternalAssembler.WriteComments().
This eliminates code duplication and improves maintainability.

git-svn-id: trunk@46550 -
2020-08-22 19:53:39 +00:00
yury
5ec489c018 * ait_varloc instructions are handled and removed by Trgobj.translate_registers() and never left for an assembler.
git-svn-id: trunk@46541 -
2020-08-22 10:58:21 +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
Jonas Maebe
86d55055df * made internalerror unique
git-svn-id: trunk@46236 -
2020-08-04 21:12:06 +00:00
Jonas Maebe
3047ce71bc * fixed LLVM register allocator after r46199
git-svn-id: trunk@46212 -
2020-08-03 20:36:02 +00:00
Jonas Maebe
a5bad32b7c - removed no longer used -target $TARGET parameter (triplet is used instead)
git-svn-id: trunk@45853 -
2020-07-25 16:11:54 +00:00
Jonas Maebe
eb7ba1690e * mark all external assemblers using an LLVM tool using af_llvm
+ added support for constructing target triplets
  * pass "-target triplet" when using an LLVM assembler
   o removed no longer needed $DARWINVERSION and $ARCH parameters
  * consistently use as_clang_gas when clang is used to assembler GAS-style
    assembly, and rename as_llcm_clang to as_clang_llvm (for consistency)
  * support pipe assembling when using clang on *nix in all cases

git-svn-id: trunk@45807 -
2020-07-19 14:30:35 +00:00
Jonas Maebe
e7d1a77f9a * rename the ARM/AArch64-Darwin targets to ARM/AArch64-iOS
* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
  * repurpose the AArch64/Darwin target for AArch64/macOS
   o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler

git-svn-id: trunk@45758 -
2020-07-10 21:52:24 +00:00
Jonas Maebe
4caa471a24 * implemented a_load_undefined_cgpara for LLVM, fixes LLVM code generator
after the changes to optimize unused parentfp parameters

git-svn-id: trunk@45456 -
2020-05-21 10:56:39 +00:00
yury
627fcb4354 * Do not use the LOC_VOID location to indicate unused parameters.
* Added the tprocdef.parentfpsym property. Set parentfpsym.varstate to vs_read instead of using the pio_needs_parentfp flag.
* Replaced tcgcallparanode.push_zero_sized_value_para by tparamanager.has_strict_proc_signature.

git-svn-id: trunk@45454 -
2020-05-21 09:36:40 +00:00
marcus
589b2b956f Fixed LLVM compilation after r45143
git-svn-id: trunk@45155 -
2020-04-28 18:41:45 +00:00
nickysn
3d81dd0b00 * ReplaceForbiddenAsmSymbolChars renamed ApplyAsmSymbolRestrictions, because now it also applies the
label length limit

git-svn-id: branches/z80@45085 -
2020-04-26 10:42:07 +00:00
nickysn
a8fe46c0f5 + introduced labelmaxlen in tasminfo and added code in ReplaceForbiddenAsmSymbolChars that limits the
output label to that length

git-svn-id: branches/z80@45066 -
2020-04-25 12:59:25 +00:00
Jonas Maebe
d5de84c6c5 * use typenames in more cases in the generated LLVM IR (results in smaller
IR in textual form)

git-svn-id: trunk@44518 -
2020-04-02 21:21:44 +00:00
Jonas Maebe
afd0ae44ee * use tprocvardef.getreusableprocaddr also for non-address-only copies of
proc(var)defs

git-svn-id: trunk@44517 -
2020-04-02 21:21:40 +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
Jonas Maebe
79974a9671 + -XlS<x> option to specify a suffix for externally called LLVM utilities,
e.g. -XlS-7 to call clang-7 instead of clang)
  * IMPORTANT: changed the -CL llvm code generation options to -Cl, for
    consistency with the new -Xl option (-XL was already taken)

git-svn-id: trunk@44436 -
2020-03-30 19:58:49 +00:00
Jonas Maebe
523ebb42cf * fix LLVM backend compilation (mantis #36833)
git-svn-id: trunk@44374 -
2020-03-27 21:26:39 +00:00
Jonas Maebe
3188dc18d4 * fixed tdel1/2 tests again for AArch64/LLVM
git-svn-id: trunk@44195 -
2020-02-16 16:58:25 +00:00
Jonas Maebe
254b85c352 + new pio_inline_forbidden flag to indicate that while parsing the
implementation the compiler determined the routine must never be
    inlined
   o difference with po_noinline: can also be set in the implementation
   o difference with pio_inline_not_possible: it indicates that e.g.
     LLVM must not inline the routine either

git-svn-id: trunk@44065 -
2020-01-29 22:21:17 +00:00
Jonas Maebe
08f9ec98e5 * use same Windows platform name as clang
git-svn-id: trunk@44063 -
2020-01-29 22:21:10 +00:00
Jonas Maebe
df6516c29f * fix internalerror if adding the object info for LLVM requires creating new defs
git-svn-id: trunk@44061 -
2020-01-29 22:21:03 +00:00
Jonas Maebe
31ef82b9c6 * constrained sitofp is not yet supported in LLVM for all targets
git-svn-id: trunk@43885 -
2020-01-07 20:22:17 +00:00
Jonas Maebe
9462d6b1ea * handle non-smallset sets in registers in LLVM like arrays and records
git-svn-id: trunk@43884 -
2020-01-07 20:22:13 +00:00
Jonas Maebe
32be078ab8 * fixed for targets where currency is implemented via int64 after r43829
git-svn-id: trunk@43882 -
2020-01-07 20:22:06 +00:00
Jonas Maebe
f659e91a95 * fixed LLVM compilation after r43860
git-svn-id: trunk@43862 -
2020-01-05 13:15:10 +00:00
Jonas Maebe
044d946782 * fixed missing sign extension when adding a signed integer variable with
size < sizeof(pointer) to a pointer for LLVM (fixes tfmtbcd)

git-svn-id: trunk@43833 -
2020-01-01 19:19:12 +00:00
Jonas Maebe
ec0d98156c * use maytrap instead of strict FP exception behaviour in LLVM, so constant
propagation is still allowed

git-svn-id: trunk@43832 -
2020-01-01 19:19:08 +00:00
Jonas Maebe
1f5efe2a95 * support for constrained sitofp/uitofp with (the upcoming) LLVM 10.0
(fixes most of test/units/math/troundm, although there's still an LLVM
     optimizer/code generation bug that breaks some qword -> double
     conversions)

git-svn-id: trunk@43829 -
2019-12-31 18:05:54 +00:00
Jonas Maebe
9b53ed53e3 * the llvm.experimental.constrained.fpext intrinsic doesn't have a rounding
mode parameter

git-svn-id: trunk@43828 -
2019-12-31 18:05:50 +00:00
Jonas Maebe
3885ce98ac * fix LLVM code generator after r43808
o share the high/length code for LLVM rather than duplicating it, since
      LLVM will optimize away the minor inefficiencies
    o removed temp reference in the old code, as it was useless (it doesn't
      prevent spilling to get to an SSA representation since the same
      register is written at least twice in all cases)

git-svn-id: trunk@43821 -
2019-12-30 15:05:17 +00:00
Jonas Maebe
a6a17efa42 * use LLVM constrained fpext/fptrunc intrinsics when fastmath is not enabled
for accurate exception behaviour

git-svn-id: trunk@43820 -
2019-12-30 15:05:13 +00:00
Jonas Maebe
797077855e * use constrained LLVM fp intrinsics for add/sub/mul/slash/fma/sqrt
operations when fastmath is not enabled

git-svn-id: trunk@43819 -
2019-12-30 15:05:09 +00:00
Jonas Maebe
b355ba3d39 * record whether a function uses fastmath, and define the function as
strictfp if it doesn't (so LLVM doesn't perform transformations that can
    change the fp/exception behaviour)

git-svn-id: trunk@43818 -
2019-12-30 15:05:06 +00:00
Jonas Maebe
67dbd0cdb3 * support nf_internal to ignore currency conversion adjustments also on
platforms that implement currency using a floating point type

git-svn-id: trunk@43817 -
2019-12-30 15:05:02 +00:00
Jonas Maebe
9bd33f7a45 + support for LLVM metadata constant string parameters
o they are implemented as a new metadata register class, whereby the
     subregister indicates the metadata type (currently always a string)
     and the superregister is an index in the metadata array (which
     contains the strings). LLVM metadata can only be passed as parameters
     to intrinsics in bitcode, so moves of metadata into other registers
     triggers internal errors and when moving them into parameters, we
     replace the parameter's register with the metadata register (and look
     up the corresponding string when writing out the bitcode)

git-svn-id: trunk@43816 -
2019-12-30 15:04:57 +00:00
Jonas Maebe
6d51c69dbe * fixed writing of calling convention for function declarations/definitions
in LLVM

git-svn-id: trunk@43785 -
2019-12-24 22:12:40 +00:00
Jonas Maebe
96dfe3d03a * LLVM support for writing vector types
git-svn-id: trunk@43783 -
2019-12-24 22:12:34 +00:00
Jonas Maebe
1e3f72403e * renamed getintparaloc to getcgtempparaloc
o it can be used for more than integer parameters

git-svn-id: trunk@43781 -
2019-12-24 22:12:25 +00:00
Jonas Maebe
0f57151d36 + recognise LLVM 9.0 (no changes needed compared to LLVM 8.0)
git-svn-id: trunk@43686 -
2019-12-14 17:15:27 +00:00
Jonas Maebe
c477816100 - removed LLVM support for clang < 7.0 and Xcode < 10.0: those versions
contain various bugs and can't even complete "make all", so there is no
    point in keeping them
   o changed default LLVM target version to 7.0

git-svn-id: trunk@43682 -
2019-12-14 14:59:05 +00:00
Jonas Maebe
a352a12bb4 * use value_real rather than value_curency when writing currency
realconstnodes (fixes tcurrency1, tw33439 and tw36179 with LLVM)
   o we need to load the fpu representation of the currency values,
     not the scaled currency value

git-svn-id: trunk@43681 -
2019-12-14 14:11:12 +00:00
Jonas Maebe
e775ecdc43 * cleaned up safecall support: use a hidden localvarsym instead of result
register hacking
   o this also allowed fixing/adding safecall support for LLVM

git-svn-id: trunk@43578 -
2019-11-24 20:23:22 +00:00
Jonas Maebe
49026e1261 * add "readonly" attribute for constant pointer parameters on LLVM
git-svn-id: trunk@43089 -
2019-09-29 10:29:57 +00:00
Jonas Maebe
b99323bb19 * fix LLVM compilation after r43076
git-svn-id: trunk@43088 -
2019-09-29 10:29:54 +00:00
Jonas Maebe
9678542ba6 + add "thunk" attribute for stubs/thunks and emit it for LLVM
- also removed wrong "noreturn" attribute for interface thunks generated
     for high level code generator targets

git-svn-id: trunk@43018 -
2019-09-15 20:43:12 +00:00
Jonas Maebe
ff2d718699 * fixed occasional rounding error with currency constants on the LLVM targets
(fixes test/tcustomattr13.pp)

git-svn-id: trunk@43017 -
2019-09-15 20:43:09 +00:00
Jonas Maebe
cdafe680c2 * different definitions for the same Objective-C class (can happen with
external class declarations) need a type conversion in LLVM (because
    they're represented by different LLVM types)

git-svn-id: trunk@42970 -
2019-09-09 18:33:37 +00:00
Jonas Maebe
dcf4e4cb2c * support taking the address of labels defined in assembler blocks in the
LLVM code genrator (for the rtti unit's thunk hacking)

git-svn-id: trunk@42969 -
2019-09-09 18:33:33 +00:00
Jonas Maebe
e7fbebfef5 * fixed field alignment when reusing an anonymous recorddef for LLVM and
the LLVM layout of an instance does not match the original one
    (e.g. because it contains procdefs of procedures with different
     signatures)

git-svn-id: trunk@42477 -
2019-07-21 11:06:54 +00:00
Jonas Maebe
145f4299b4 * search dynamic string data record in correct symtable in
tllvmtai_typedconstbuilder.emit_string_offset
   o fixes LLVM internalerror 2014080406 for test/tcustomattr14

git-svn-id: trunk@42464 -
2019-07-20 12:08:59 +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
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
Jonas Maebe
789f13eb24 * LLVM-specific support for popcnt
git-svn-id: trunk@42311 -
2019-06-30 15:23:36 +00:00
Jonas Maebe
0a91fcb44f * LLVM-specific support for bsr*/bsf*
git-svn-id: trunk@42309 -
2019-06-29 16:27:18 +00:00
Jonas Maebe
c425c51963 * simplify and optimize generated LLVM code for case statements
git-svn-id: trunk@42305 -
2019-06-29 12:17:49 +00:00
Jonas Maebe
f1b66a9741 * fixed LLVM type checking of typed files in ISO mode (fixes webtbs/tw34848)
git-svn-id: branches/debug_eh@42205 -
2019-06-10 13:36:57 +00:00
Jonas Maebe
3f2578a3e3 * don't quote LLVM calling convention name (that will cause it to be ignored)
o fixes tasm10a and tx64ccnv.ll with LLVM

git-svn-id: branches/debug_eh@42193 -
2019-06-08 17:11:20 +00:00
Jonas Maebe
faf75095cd * synchronised with trunk till r42189
git-svn-id: branches/debug_eh@42190 -
2019-06-07 18:24:38 +00:00
Jonas Maebe
1dee4c41dd - removed "cmp 0/1, pasbool1" optimization for llvm because this discards
the upper 7 bits of the boolean, while other platforms take it into
    account (even though they're technically always required to be 0, and
    the value is undefined if they're not)

git-svn-id: trunk@42189 -
2019-06-07 18:17:55 +00:00
Jonas Maebe
5473f4fc44 + LLVM support for library init/fini routines
git-svn-id: branches/debug_eh@42108 -
2019-05-19 19:26:59 +00:00
Jonas Maebe
9f18cbf5d6 * support writing aggregate LLVM constants that are not packed
git-svn-id: branches/debug_eh@42107 -
2019-05-19 19:26:55 +00:00
Jonas Maebe
0cd0e1614b * synchronised with trunk till r42105
git-svn-id: branches/debug_eh@42106 -
2019-05-19 19:24:25 +00:00
Jonas Maebe
a418dc6c91 * made the fields array parameter of llvmgettemprecorddef "const", as it
doesn't get modified and hence doesn't need to be copied

git-svn-id: trunk@42103 -
2019-05-19 19:20:42 +00:00
Jonas Maebe
3bee9ab9da * two different specialisations with the same types from different units
still need a type conversion with llvm, as their type identifiers will
    be different

git-svn-id: branches/debug_eh@42097 -
2019-05-18 18:49:05 +00:00
Jonas Maebe
d74b0843df * set null-pointer-is-valid attribute on functions, so that LLVM does not
optimise provable accesses to null as undefined behaviour (requires
    LLVM/Clang 7.0 or later)

git-svn-id: branches/debug_eh@42055 -
2019-05-12 21:09:44 +00:00
Jonas Maebe
853e622fb7 * fix case completeness warnings
git-svn-id: branches/debug_eh@42051 -
2019-05-12 18:46:47 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
7dbbce157f * fixed Objective-C metadata generation for LLVM
git-svn-id: branches/debug_eh@41980 -
2019-05-02 19:45:34 +00:00
Jonas Maebe
024b38e1ff * fixed setting calling convention for calls (the callpd passed to the
taillvm constructors is not necessarily a proc(var)def)

git-svn-id: branches/debug_eh@41979 -
2019-05-02 19:45:30 +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
3a1fb45315 * synchronised with trunk till r41976
git-svn-id: branches/debug_eh@41977 -
2019-05-02 19:44:41 +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
cd3e4d26d4 * recognise extra llvm/Xcode versions
git-svn-id: branches/debug_eh@41912 -
2019-04-20 18:56:19 +00:00
Jonas Maebe
fc60ec2ea4 + support for LLVM LTO: compile units with -CLflto -> when compiling a main
program/library also with -Clflto, all units compiled with that option
    will be linked using their bitcode files and LTO
   o compiling with -CLflto will compile all units twice: once for normal
     (static or smart) linking, and once for LTO. So the result can be
     used both with and without LTO.

git-svn-id: branches/debug_eh@41910 -
2019-04-20 18:56:11 +00:00
Jonas Maebe
810d0ab2fe * use $DARWINVERSION functionality to pass Darwin/iOS version to clang when
assembling llvm bitcode

git-svn-id: branches/debug_eh@41909 -
2019-04-20 18:56:07 +00:00
Jonas Maebe
fcde89cb26 * support forcing to write the parameter alignment for parameters for LLVM,
even when it's the same as the stack alignment (it can also refer to the
    alignment of the data pointed to by pointer parameters)

git-svn-id: branches/debug_eh@41729 -
2019-03-17 15:28:27 +00:00
Jonas Maebe
3b254affb7 * support for the individual alignment flags for the memcpy intrinsic of
LLVM 7.0

git-svn-id: branches/debug_eh@41728 -
2019-03-17 15:28:23 +00:00
Jonas Maebe
cf65c55b72 * support specifying the target LLVM/Xcode version
git-svn-id: branches/debug_eh@41727 -
2019-03-17 15:28:20 +00:00
Jonas Maebe
16cde0da15 * create LLVM TAsmCFI wrapper that calls through to the original TASmCFI for
pure assembler routines and for generating the CFI tables, and does nothing
    for LLVM-handled routines (LLVM takes care of the CFI there)

git-svn-id: branches/debug_eh@41580 -
2019-03-03 17:15:09 +00:00
Jonas Maebe
332af0bc4e * completed license header
git-svn-id: branches/debug_eh@41575 -
2019-03-03 17:14:53 +00:00
Jonas Maebe
8f6820a9f1 * LLVM=: also merge varargs paralocs
git-svn-id: branches/debug_eh@41520 -
2019-02-27 21:13:49 +00:00
Jonas Maebe
e720a1f306 * moved tcgexceptionstatehandler to a new cgexcept unit
* fixed llvm cycle by overriding additional eh-related tcgprocinfo methods

git-svn-id: branches/debug_eh@41519 -
2019-02-27 21:13:45 +00:00
Jonas Maebe
a079e5fa80 * synchronised with trunk till r41449
git-svn-id: branches/debug_eh@41450 -
2019-02-24 20:01:53 +00:00
Jonas Maebe
08791712d7 * also specify the byval alignment at the callee side
git-svn-id: trunk@41448 -
2019-02-24 19:59:00 +00:00
Jonas Maebe
6071263469 * use ` instead of ^ as replacement character in LLVM asmnodes, as ^ can
appear in ARM inline assembly

git-svn-id: trunk@41446 -
2019-02-24 19:58:54 +00:00
Jonas Maebe
a87a7270d5 * remove double "nocapture" attributes
* also add "noalias nocapture" to sret parameters

git-svn-id: trunk@41445 -
2019-02-24 19:58:51 +00:00
Jonas Maebe
e829596750 * type left-over parts of parameters as arrays of "stack slot alignment" if
they're an exact multiple of the ialignment size on LLVM. This prevents
    both overalignment (e.g. remainder of 8 individual bytes on ARM
    would be aligned to 8 bytes instead of 4 if typed as int64) and
    underalignment (e.g. 32 bytes remainder of a record that needs to be
    aligned to 8 bytes would be aligned to 1 or 4 bytes if types as
    array of resp. bytes or longints)

git-svn-id: trunk@41444 -
2019-02-24 19:58:47 +00:00
Jonas Maebe
5cb5b10f8d * fixed LLVM and non-i386 compilation
git-svn-id: branches/debug_eh@41423 -
2019-02-23 17:03:42 +00:00
florian
65aebd22b0 + initial implementation of dwarf/eh_frame based exception handling for i386-linux, basic stuff works, open todos
* nested exception handling statments in one procedure need to be fixed
  * clean up, finally factor out tcgprocinfo from psub at least
  * extensive testing

git-svn-id: branches/debug_eh@41289 -
2019-02-10 18:07:33 +00:00
Jonas Maebe
a0831b058a * fixed LLVM para loading for byval paralocs that are preceded by other
paralocs

git-svn-id: branches/debug_eh@41217 -
2019-02-03 21:10:18 +00:00
Jonas Maebe
af098474f4 * keep track of the alignment requirements of parameters with LLVM, and emit
them when they are different from the default

git-svn-id: branches/debug_eh@41216 -
2019-02-03 21:10:14 +00:00
Jonas Maebe
8eb07ed7b1 * add support for custom calling conventions to LLVM function declarations
git-svn-id: branches/debug_eh@41211 -
2019-02-03 21:09:58 +00:00
Jonas Maebe
9d07e4948f * fix compilation of ARM compiler for LLVM
git-svn-id: branches/debug_eh@41210 -
2019-02-03 21:09:54 +00:00
Jonas Maebe
7aa6a2ec81 * only make a copy of the finally code in pass_1 instead of in pass_typecheck,
to avoid an internalerror in case the finally code contains a goto outside
    the finally code (tbf/tb0209.pp)

git-svn-id: branches/debug_eh@41209 -
2019-02-03 21:09:51 +00:00
Jonas Maebe
d93c05a90c * synchronised with trunk till r41207
git-svn-id: branches/debug_eh@41208 -
2019-02-03 21:05:37 +00:00
Jonas Maebe
f9668f8c03 * let de LLVM parameter manager merge multiple paralocs used to represent a
single ordinal, as such splitting is handled by LLVM itself (and handling
    such split locations is currently not supported by our LLVM code generator)

git-svn-id: trunk@41199 -
2019-02-03 21:00:28 +00:00
Jonas Maebe
503ea604f3 + nolinline modifier to specify that a routine must never be inlined
git-svn-id: trunk@41198 -
2019-02-03 21:00:17 +00:00
Jonas Maebe
a0d796e98d * synchronised with trunk till r41159
git-svn-id: branches/debug_eh@41160 -
2019-02-01 17:01:54 +00:00
Jonas Maebe
e52cf555ab * fix loading of constants in registers in the LLVM CG if the constant
does not fit in ptrsinttype

git-svn-id: trunk@41138 -
2019-01-29 21:39:26 +00:00
Jonas Maebe
14cc517f40 * synchronised with trunk till r40724
git-svn-id: branches/debug_eh@40737 -
2019-01-01 17:15:29 +00:00
Jonas Maebe
a72a12eef6 * don't emit 0-sized parameters for LLVM: clang doesn't either, and some
LLVM backends (like the AArch64 one) trigger internal errors when
    encountering them

git-svn-id: trunk@40736 -
2019-01-01 16:55:41 +00:00
Jonas Maebe
9f928b2805 * fix exception handling code generator memory leaks
git-svn-id: branches/debug_eh@40734 -
2019-01-01 16:24:42 +00:00
Jonas Maebe
473fef315d * synchronised with trunk till r40732
git-svn-id: branches/debug_eh@40733 -
2019-01-01 16:24:18 +00:00
Jonas Maebe
4d03f3a65e * fixed LLVM memory leaks
git-svn-id: trunk@40732 -
2019-01-01 16:22:31 +00:00
Jonas Maebe
882d676bc9 * synchronised with trunk till r40635
git-svn-id: branches/debug_eh@40636 -
2018-12-24 22:12:19 +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
f3d831b480 * fixed result cgsize of LLVM's second_nothing type conversion node (new
size instead of original size, which can be different in case of going
    from void to something else)

git-svn-id: trunk@40632 -
2018-12-24 22:09:58 +00:00
Jonas Maebe
eb769e3859 * force pointer-based self parameters of inlined routines in temps for LLVM
to ensure that their type gets updated

git-svn-id: trunk@40631 -
2018-12-24 22:09:55 +00:00
Jonas Maebe
dd29088430 * simplify all type conversions for formal constants even for LLVM and JVM
(since these happen at compile time and don't result in generated code,
     they never need extra type conversions in the code)

git-svn-id: trunk@40629 -
2018-12-24 22:09:48 +00:00
Jonas Maebe
31c047adf8 * synchronised with trunk till r40605
git-svn-id: branches/debug_eh@40606 -
2018-12-21 20:58:16 +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
4f72edcdd5 + LLVM support for the FMA intrinsics
git-svn-id: trunk@40604 -
2018-12-21 20:57:19 +00:00
Jonas Maebe
1cc995b471 * use ccallnode.createintern() instead of
ccallcnode.createinternfromunit('SYSTEM')

git-svn-id: trunk@40603 -
2018-12-21 20:57:16 +00:00
Jonas Maebe
c55ffa8cc7 * fixed <> comparisons with NaNs (use LLVM "unordered" comparison: succeed
if either operand is a NaN)

git-svn-id: trunk@40602 -
2018-12-21 20:57:12 +00:00
Jonas Maebe
3b4011760a * cleaned up blockaddress instruction (add type rather than hardcoding it
in the assembler writer)
  * fixed taking the address of a label in a typed const for llvm (fixes
    tbs/tb0468a)

git-svn-id: trunk@40599 -
2018-12-20 21:22:44 +00:00
Jonas Maebe
1a0ffbc82b * fixed llvm compiler compilation with -O3/-Oodfa
git-svn-id: branches/debug_eh@40590 -
2018-12-18 21:13:56 +00:00
Jonas Maebe
752a28a41d * enabled more optimization flags for llvm
git-svn-id: branches/debug_eh@40589 -
2018-12-18 21:13:52 +00:00
Jonas Maebe
24c49301e3 * synchronised with trunk till r40578
git-svn-id: branches/debug_eh@40579 -
2018-12-16 21:00:49 +00:00
Jonas Maebe
7cc7268635 * fixed dynamic array constants for non-Darwin LLVM platforms
git-svn-id: trunk@40578 -
2018-12-16 20:59:58 +00:00
Jonas Maebe
f26ac9026e * enable LLVM support Linux/AArch64
o also put the regular function result before the partfpstruct parameter

git-svn-id: branches/debug_eh@40577 -
2018-12-16 20:46:44 +00:00
Jonas Maebe
b41cd1eb6a * synchronised with trunk till r40575
git-svn-id: branches/debug_eh@40576 -
2018-12-16 20:45:55 +00:00
Jonas Maebe
2330164ee2 + internal sqrt support for LLVM (faster on all platforms, necessary on
platforms that don't have RTL support for it, as the the generic
    fpc_sqrt_real just calls runerror)

git-svn-id: trunk@40575 -
2018-12-16 20:44:41 +00:00
Jonas Maebe
e69b4d2d9a * replaced some stray cpointerdef.create() calls with cpointerdef.getreusable()
git-svn-id: trunk@40572 -
2018-12-16 20:44:31 +00:00
Jonas Maebe
93e39fb0cd * only coerce the type of the leftover bytes of a record if the location
size doesn't match the number of remaining bytes
   o prevents a second "single" field of a record getting interpreted as a
     "cardinal"

git-svn-id: trunk@40569 -
2018-12-16 20:44:21 +00:00
Jonas Maebe
97bc58d248 * fixed bug that caused the "sret" argument attribute to never be used (and
a guaranteed internalerror on AArch64/llvm)

git-svn-id: trunk@40565 -
2018-12-16 20:44:09 +00:00
Jonas Maebe
440026bb25 * synchronised with trunk till r40503
git-svn-id: branches/debug_eh@40504 -
2018-12-08 15:33:36 +00:00
Jonas Maebe
32a51d7b62 * add nocapture and dereferenceable/dereferenceable_or_null decorators to
parameters for llvm where appropriate

git-svn-id: trunk@40503 -
2018-12-08 15:31:54 +00:00
Jonas Maebe
51502874af * emit temp lifetime information for llvm
o also allow freeing temps in the middle of a routine for llvm (we won't
     reuse them, but it results in better lifetime information)

git-svn-id: trunk@40502 -
2018-12-08 15:31:51 +00:00