Commit Graph

54738 Commits

Author SHA1 Message Date
Jonas Maebe
cec839ab30 - removed the -(m)stack-alignment parameter, as it prevents stack-realignment
by llc (so avx code crashes on targets wich 16 byte stack alignment --
    which is all of them)

git-svn-id: branches/debug_eh@40445 -
2018-12-01 23:08:48 +00:00
Jonas Maebe
60488c3c06 * synchronised with trunk till r40443
git-svn-id: branches/debug_eh@40444 -
2018-12-01 23:08:18 +00:00
Jonas Maebe
e8512d19b5 * set constalignmax to the same value as varalignmax for all targets where
constalignmax was lower (which does not make sense)

git-svn-id: trunk@40443 -
2018-12-01 23:07:09 +00:00
Jonas Maebe
95d79296bd * fixed alignment of tfiledef (same as corresponding file recorddef)
* cap set alignment to sizeof(aint)

git-svn-id: trunk@40442 -
2018-12-01 23:07:05 +00:00
michael
b84e02b0a9 * Fix compilation with debug output defines
git-svn-id: trunk@40441 -
2018-12-01 23:05:07 +00:00
michael
333b4f3193 * Move everything not related to file searching from cache to compiler
git-svn-id: trunk@40440 -
2018-12-01 22:11:49 +00:00
michael
a3337afa98 * Move InsertJSFiles to compiler
git-svn-id: trunk@40439 -
2018-12-01 21:06:59 +00:00
Jonas Maebe
eb742bcacc * pass on the value of -CfXXX to llc/clang for x86-64
git-svn-id: branches/debug_eh@40438 -
2018-12-01 20:30:46 +00:00
Jonas Maebe
bd23ac0dab - disable I/O-port-related intrinsic functionality when using LLVM, as the
x86-specific inline nodes are not available then

git-svn-id: branches/debug_eh@40437 -
2018-12-01 20:30:43 +00:00
Jonas Maebe
c0ce94528f * use Dwarf-EH for Linux/x86-64 when using the LLVM code generator
git-svn-id: branches/debug_eh@40436 -
2018-12-01 20:30:40 +00:00
Jonas Maebe
37ae70f925 * pass --eh-frame-hdr to the linker on Linux when using Dwarf-based EH, as
libgcc's unwinder does not work without it

git-svn-id: branches/debug_eh@40435 -
2018-12-01 20:30:37 +00:00
Jonas Maebe
a1db586c81 * define CPULLVM for compilers with an llvm-based code generator (in addition
to the regular CPUXXX define for the target architecture)

git-svn-id: branches/debug_eh@40434 -
2018-12-01 20:30:34 +00:00
Jonas Maebe
42f82f4d40 * the libunwind API resides in libgcc_s on Linux
o also link against libc (the current llvm code generator assumes it for
     memcpy, and libgcc_s depends on it anyway)

git-svn-id: branches/debug_eh@40433 -
2018-12-01 20:30:31 +00:00
Jonas Maebe
68ce5dc91f * register static symbols references from assembly code as "used" so that LLVM won't
remove them if there are no references from regular code

git-svn-id: branches/debug_eh@40432 -
2018-12-01 20:30:27 +00:00
Jonas Maebe
85702dd263 + added support for clang as an assembler for llvm IR
* adapted string used for macOS/iOS version in triple in llvm IR files to
    what clang expects (always a single digit patch version)

git-svn-id: branches/debug_eh@40431 -
2018-12-01 20:30:24 +00:00
michael
92c07633c2 * Move things out of resolver, into filecache
git-svn-id: trunk@40430 -
2018-12-01 19:40:32 +00:00
michael
d560b9a15d * FindIncludeFile virtual
git-svn-id: trunk@40429 -
2018-12-01 19:39:44 +00:00
michael
5059824f44 * Fix tests so they run on any system
git-svn-id: trunk@40428 -
2018-12-01 19:04:13 +00:00
michael
aa956d2f70 * Refactor so PCU support is separated out
git-svn-id: trunk@40427 -
2018-12-01 19:03:41 +00:00
michael
4d165e542d * Split resolver in baseresolver & resolver
git-svn-id: trunk@40426 -
2018-12-01 18:59:31 +00:00
pierre
67fe756642 Regenerate msgid and msgtxt include files after commit 40422
git-svn-id: trunk@40425 -
2018-12-01 16:18:58 +00:00
michael
4091e31c4f * Rename FindUnitWithName -> FindLoadedUnit
git-svn-id: trunk@40424 -
2018-12-01 08:54:34 +00:00
michael
77446cfe07 * Remove knowledge of directorycache from compiler
git-svn-id: trunk@40423 -
2018-12-01 08:49:04 +00:00
marco
b60cbf3329 * systematically capitalize first word of errormsg/sentence, patch by J. Gareth Moreton, mantis 34618
git-svn-id: trunk@40422 -
2018-11-30 11:21:50 +00:00
Jonas Maebe
758a8dd34a * fixed dwarf debug info after r40398 (mantis #34622)
git-svn-id: trunk@40421 -
2018-11-29 23:21:15 +00:00
Jonas Maebe
645a4da831 - removed "-enable-fp-mad" llc option, as it's not supported for all versions
git-svn-id: branches/debug_eh@40420 -
2018-11-29 21:50:18 +00:00
Jonas Maebe
aff3a15081 * call runerror(217) instead of halt(217) when using Dwarf-EH in similar
cases as where this happens with the standard SjLj-base exception handling

git-svn-id: branches/debug_eh@40419 -
2018-11-29 21:38:58 +00:00
Jonas Maebe
df0a126064 * abstracted rest of the generic exception handling code through the
texceptionstatehandler class + llvm overrides
  + added FPC_DummyPotentialRaise routine that gets called at the begin and end
    of try-blocks to be able to catch hardware exceptions to a limited extent
    with LLVM

git-svn-id: branches/debug_eh@40418 -
2018-11-29 21:31:40 +00:00
Jonas Maebe
7ffd5fc90b * handle explicit reraise for llvm specifically, as it needs to unwind to
the parent exception frame (-> pop current exception label, invoke/call
    reraise, push current exception label again)

git-svn-id: branches/debug_eh@40417 -
2018-11-29 21:31:37 +00:00
Jonas Maebe
03013cf2e1 * make ttryfinallynode inherit from ttertiary node so it has a "third" node
member. This one will be used by the LLVM descendent to keep a copy of
    the finally code, as it must use a separate version for the code that
    gets executed when an exception is caught and when no exception happens

git-svn-id: branches/debug_eh@40416 -
2018-11-29 21:31:34 +00:00
Jonas Maebe
2f8fcf7819 + new tf_use_psabieh target flag to indicate a target uses PSABI/Dwarf EH
o use this flag to set the personality routine of a function if it uses
     exception handlinga
   o also define FPC_USE_PSABIEH if this target flag is set
   o set this target flag for darwin/x86-64 if the compiler is compiled with
     -dllvm

git-svn-id: branches/debug_eh@40415 -
2018-11-29 21:31:30 +00:00
Jonas Maebe
fceb34dbd5 * converted tllvmpara contents from tlocation to toper, so we can also
store tai in them
  + support for direct symbol parameters to llvm routines (without first
    loading them into register)
   o needed to pass such symbols to llvm intrinsics

git-svn-id: branches/debug_eh@40414 -
2018-11-29 21:31:27 +00:00
Jonas Maebe
d363acbe77 * when inserting a reference to an external procdef, also process its
parameter types in case it hasn't been called (because in that case
    the defs of those parameters won't have been used and hence they
    won't have been recorded for writing either)

git-svn-id: branches/debug_eh@40413 -
2018-11-29 21:31:24 +00:00
Jonas Maebe
ae65f88f62 * add support for la_catch in spilling_get_reg_type (it will never need
spilling, but we may need the type to insert bitcasts)
  * load the la_catch symbol operand with loadref instead of loadsymbol,
    as the latter sets refaddr_full and with llvm we use that to indicated
    symbol names of named registers rather than data symbols (which in turn
    prevents it from being processed for inserting bitcasts if necessary)

git-svn-id: branches/debug_eh@40412 -
2018-11-29 21:31:21 +00:00
Jonas Maebe
ce7579bd50 + added "cleanup" landing pad opcode
git-svn-id: branches/debug_eh@40411 -
2018-11-29 21:31:18 +00:00
Jonas Maebe
4cd6f59bc3 * changed create_hlcodegen into a procvar, so that we don't have to insert
hlcgllvm in the uses clause of every unit that calls create_hlcodegen
   o prevents dependency cycles that can cause llvm codegen units to init
     before the cpu variants, which is bad since the llvm versions have to
     override the cpu variants in their init code (+ added checks in the
     init code that they are in fact initialised later)

git-svn-id: branches/debug_eh@40410 -
2018-11-29 21:31:15 +00:00
Jonas Maebe
366bf4294b * constructor to create extractvalue/extractelement instructions
git-svn-id: branches/debug_eh@40409 -
2018-11-29 21:31:11 +00:00
Jonas Maebe
e6c89bbf0a + helper to add an extra clause to a landingpad instruction
git-svn-id: branches/debug_eh@40408 -
2018-11-29 21:31:08 +00:00
Jonas Maebe
4e73919676 - removed FPC 2.6.x bootstrapping code
git-svn-id: branches/debug_eh@40407 -
2018-11-29 21:31:05 +00:00
Jonas Maebe
01ddde2283 * refactored jumping out of exception frames so it can be overridden by descendents
git-svn-id: branches/debug_eh@40406 -
2018-11-29 21:31:02 +00:00
Jonas Maebe
ccb7231744 * generate invoke instead of call when calling a function in a block that
catches exceptions

git-svn-id: branches/debug_eh@40405 -
2018-11-29 21:30:59 +00:00
Jonas Maebe
8711069998 + constructors to create invoke instructions
git-svn-id: branches/debug_eh@40404 -
2018-11-29 21:30:56 +00:00
Jonas Maebe
077d7e8551 * fixed handling of LLVM invoke instruction in the assembler writer and
type inference

git-svn-id: branches/debug_eh@40403 -
2018-11-29 21:30:53 +00:00
Jonas Maebe
5b8f7224af * set the dummy exception handling personality function for functions using
exceptions for LLVM (except on Windows targets, since they (will) use
    their own kind of exception handling)
   o ensure we generate an external function symbol definition for such
     personality functions on LLVM

git-svn-id: branches/debug_eh@40402 -
2018-11-29 21:30:49 +00:00
Jonas Maebe
b6efcb9105 + tllvmexceptionstatehandler that emits LLVM landingpad instructions to be
referred by invoke instructions in exception catching blocks
   o for now we won't actually use ABI-compliant exception handling, but we
     need invoke/landingpad combinations for LLVM's control flow analyses to
     correctly handle code involving exception handling

git-svn-id: branches/debug_eh@40401 -
2018-11-29 21:30:46 +00:00
Jonas Maebe
3cfad8fba8 * renamed FPC_USE_PSEABIEH to FPC_USE_PSABIEH
git-svn-id: branches/debug_eh@40400 -
2018-11-29 21:30:42 +00:00
Jonas Maebe
bc8ed77af1 * synchronised with trunk till r40398
git-svn-id: branches/debug_eh@40399 -
2018-11-29 21:19:12 +00:00
Jonas Maebe
50ab607676 + customint torddef type to create arbitraty bit-width integers
o use this to handle non-power-of-two-sized parameters for llvm
   o no general support in the parser/code generator, so don't expose

git-svn-id: trunk@40398 -
2018-11-29 20:57:08 +00:00
pierre
a1fbde242d Fix cleaning of unicode utils package in fpmake
git-svn-id: trunk@40397 -
2018-11-29 16:55:07 +00:00
michael
f051e1b8dc * Add Payload event
git-svn-id: trunk@40396 -
2018-11-29 15:42:06 +00:00