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 -
* 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 -
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 -
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 -
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 -
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 -
* 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 -
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 -
the parent exception frame (-> pop current exception label, invoke/call
reraise, push current exception label again)
git-svn-id: branches/debug_eh@40417 -
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 -
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 -
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 -
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 -
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 -
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 -
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 -
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 -
so that they can still be freed after the reference has been changed
(e.g. in case of array indexing or record field accesses) (mantis #33628)
git-svn-id: trunk@38814 -
indirectly depends on llvmpara and hence is initialised after instead
of before it (since llvmpara should override cpupara in its init code)
git-svn-id: trunk@36264 -
+ support for LLVM nil tai operands (will be used for terminating a daisy
chain of catch/filter clauses of landingpads): don't try to write it
git-svn-id: trunk@35160 -
as list of defs to be stored in the record, so we don't need to create and
free a class instance every time we call this routine
git-svn-id: trunk@35155 -
TP-style object to another and the sizes differ, at least if they are
related
* restructured and commented the LLVM type conversion checks
git-svn-id: trunk@35137 -
floating point type to currency, as fptosui is defined as always rounding
to zero while on other platforms we use the FPU's current rounding mode
(fixes webtbs/tw21449 for LLVM, and also webtbs/tw24197 because LLVM's
code generated for fptosui temporarily changes the FPU control word so
it rounds to zero and also to disable FPU exceptions)
git-svn-id: trunk@35061 -
add such symbols to the pseudo-arrays llvm.compiler.used or llvm.used
depending on their nature (fixes compiling Objective-C programs with
optimization, and keeps the FPC ident in the linked binary)
git-svn-id: trunk@35041 -
typed constant does not match the equivalent LLVM definition (it's only
used to check whether any emitted data's type differs from the LLVM
definition's field types)
o fixed a potential out-of-bounds access related to this: the index of the
equivalent LLVM field kept getting increased and at some point we checked
whether the current emitted data's type was different from the LLVM field
type without verifying first that the LLVM equivalent field index was not
yet beyond the number of LLVM equivalent fields
git-svn-id: trunk@35018 -
the buffer in the type, and support typecasting the typed file to a
different size (needed to be able to pass it to the compiler helpers that
expected a "TypedFile", whose buffer is 0 bytes and which hence will
always have a smaller size than the original type) (fixes test/tisoext1)
git-svn-id: trunk@35017 -
o separate information for reading and writing, because e.g. in a
try-block, only the writes to local variables and parameters are
volatile (they have to be committed immediately in case the next
instruction causes an exception)
o for now, only references to absolute memory addresses are marked
as volatile
o the volatily information is (should be) properly maintained throughout
all code generators for all archictures with this patch
o no optimizers or other compiler infrastructure uses the volatility
information yet
o this functionality is not (yet) exposed at the language level, it
is only for internal code generator use right now
git-svn-id: trunk@34996 -
stored in more than one register (has a self and a code pointer), instead
of assuming it always occupies more than one register if the original
procdef had a self pointer (can be different when getting the address
of a static class procedure)
git-svn-id: trunk@34976 -
get randomly passed as either byval or not (while they don't contain any
data and hence this can't cause bugs in the generated code, it can cause
signature mismatches in llvm)
git-svn-id: trunk@34956 -
o ensure that the label's local "jumpbuf" variable gets moved to the
parentfpstruct soon enough
o don't generate global symbols for interprocedural labels: they're not
necessary if they are only used via setjmp/longjmp (all references are
local in that case), and if they are referenced via an assembler block
then we'll have to handle them by passing a blockaddress() expression
as parameter to that assembler block (which does not require a global
symbol, but which is not yet implemented)
git-svn-id: trunk@34946 -
o temporarily encode the uses of '$' for references to function-level inline
assembly arguments as '^', because those have to remain/become a single
'$'
git-svn-id: trunk@34898 -
writer decorators (for LLVM function-level inline assembly: there
newline has to be replaced by the character sequence '\0A')
git-svn-id: trunk@34854 -
string constants instead of giving an internal error if we can't find it in
the current context (in most cases it will exist, but not when inlining a
routine from another unit that accesses a locally declared string constant)
git-svn-id: trunk@34373 -
it was AT_NONE, which is invalid and should never be used
* explicitly pass the correct value for all calls to those methods elsewhere
in the compiler
git-svn-id: trunk@34250 -
symbol is defined
o removed all places where AB_INDIRECT symbols were explicitly generated
o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
o for some symbols an indirect symbol is always required (because they are
dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type
git-svn-id: trunk@34165 -
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 -
list, so that the assembler directives generated for Darwin are emitted
correctly for LLVM
o extracted the library init code generation from hlcgobj to pmodules so
we don't add things to another list than what's passed to
gen_proc_symbol_end(), and so it's done where we generate the init
routine for libraries (rather then checking for every routine whether
it's the init routine for a library)
o removed the llvm-specific gen_proc_symbol_end() because the regular one
now does the same
git-svn-id: trunk@34134 -
moved the code to create the procedure start/end etc. that was at the
call sites of g_external_wrapper() into the new g_external_wrapper()
-> got rid of the x86-specific code in expunix, and fixed expunix for
llvm (e.g. tests/test/tlib1{a,b})
git-svn-id: trunk@34131 -
methods. Implementing a fully functional g_external_wrapper() for llvm is
quite hard, and the regular wrapper method that calls FPC_ABSTRACTERROR can
in principle be optimized to a plain jump by tail call optimisation on other
targets (to the extent that this matters, because most of them will be
smartlinked away, and the ones that are executed will trigger an exception)
o this means that the synthetic method generation needs to be run for all
objectdefs on all platforms now, rather than only for Java classes
git-svn-id: trunk@34127 -
than of their loadsize, because otherwise if they are e.g. part of a record
they would occupy more space than allowed
o adapted llvm code to deal with the fact that bitpacked arrays are now
always arrays of bytes rather than arrays of integers with the same size
as their loadsize -- this also fixes several type inconsistencies
detected by llvm
git-svn-id: trunk@34125 -
of the same size -> ensure that this is the case for the shifts in
a_bit_test/set_reg_reg_reg() (fixes tests/tbs/tb0219.pp for llvm)
git-svn-id: trunk@34123 -
using their actual type (array/record) rather than using the
simplified type (void), so we can also return an actual value and
assign it to something (void means that nothing is returned and
cannot be assigned to anything) (completes fixing
tests/test/tnoext4.pp for llvm)
git-svn-id: trunk@34120 -
(e.g. an empty record): return an "undefined" instance of the result
type (since it's empty, its contents are irrelevant). Before, we
returned "void", but that means returning nothing rather than returning
something empty (part of fixing test/tnoext4 for llvm)
git-svn-id: trunk@34119 -