* Set fc_no_direct_exit in case when a routine has an additional implicit exit code, such as calling FreeInstance in the destructor.
git-svn-id: trunk@47749 -
than when the first temprefnode to it gets processed. Solves the issue
the foreachnodestatic processes the tempinitcode when seeing the
tempcreatenode and ignores it when seeing temprefnodes, even though
it may actually be executed/generated for the temprefnode. It's
impossible to easily process it for the "correct" temprefnode
(since there may be multiple temprefnodes for the same tempcreatenode)
o fixes tarray12 for Darwin/i386 and Linux/i386
git-svn-id: trunk@46457 -
(needed for LLVM, where we need two copies of the finally code: one in case
an exception occurs, and one in case none is raised)
o also first finalize parameters and only then code generator temps, since
in theory the former could create more of the latter
git-svn-id: trunk@40345 -
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 -
from cpubase unit to a method in the tcg class. The reason for doing that is
that this is now a standard part of the 16-bit and 8-bit code generators and
moving to the tcg class allows doing extra checks (not done yet, but for
example, in the future, we can keep track of whether there was an extra
register allocated with getintregister and halt with an internalerror in case
GetNextReg() is called for registers, which weren't allocated as a part of a
sequence, therefore catching a certain class of 8-bit and 16-bit code
generator bugs at compile time, instead of generating wrong code).
- removed GetLastReg() from avr's cpubase unit, because it isn't used for
anything. It might be added to the tcg class, in case it's ever needed, but
for now I've left it out.
* GetOffsetReg() and GetOffsetReg64() were also moved to the tcg unit.
git-svn-id: trunk@37180 -
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 -
and getters for the ttemp*node classes instead
o this will allow descendants to prevent certain flags from being added
or removed. E.g. for LLVM, certain temps must never be put in registers
because it cannot typecast a value in a register from a non-record/array
type to an array type without forcing it to memory (so if that is done
on an lvalue, the result will be written to the memory temp instead of
to the register)
git-svn-id: trunk@34358 -
release the source location in case it was also a temp. Reason: we
don't increase reference counts when assigning to a ti_const (they are
like const parameters), so the original value must stay alive until
the ti_const temp is freed
o free the original data in the ttempdelete node for the ti_const temp
o don't increase reference counts when assigning composite types to
ti_const temps either
git-svn-id: trunk@34287 -
CPU target for inline assembler blocks. In addition to the different CPUs
(as listed under 'Supported CPU instruction sets:' in the output of 'fpc -i'),
it also supports the special values 'ANY' and 'CURRENT'. 'ANY' means no
restrictions (i.e. all instructions are available). 'CURRENT' means the
current CPU target (as specified with the '-Cp' command line option). For
backward compatibility, the default value is 'ANY' for all CPU targets, except
i8086, where it defaults to 'CURRENT'.
This directive requires support for the new asd_cpu directive in the assembler
writer. This is currently implemented only for NASM, but will be supported in
some of the other assembler writers as well (incl. the x86 internal assembler
writer).
git-svn-id: trunk@33138 -
If assembler block has no modified register list, it is still handled in pass2, by allocating all volatile registers (not only the integer ones as before).
git-svn-id: trunk@30011 -
e.g. being a const parameter or immutable temp. values), managed types like dyn. arrays, new string types and interfaces can be kept in registers.
git-svn-id: trunk@24953 -
the result location is a simple location (a single register/reference)
(mantis #22490)
* print an error when accessing "result" in a nostack pure assembler routine
if the result location is not simple
git-svn-id: trunk@22166 -
function result parameter, because reference counted function results
are not guaranteed to be initialized (we sometimes even pass the,
non-finalized, left-hand side of an assignment as hidden function
result parameter)
git-svn-id: trunk@21955 -
for regular temps. This is required for targets that need special
handling of the temps depending on the type
* converted most gettemp() calls to gethltemp() calls
git-svn-id: branches/jvmbackend@18376 -
represent complex locations (required for full x86-64 ABI support,
which is not yet implemented) -> lots of special result handling
code has been removed and replaced by the parameter handling
routines
+ added support for composite parameters (and hence function
results) to tcg.a_load_ref_cgpara() (so it can be used for
handling, e.g., 64 bit parameters on 32 bit platforms)
* the above fixed writing past the end of allocated memory when
handling records returned in registers on x86-64 whose size is
not a multiple of 8 bytes (mantis #16357)
- removed the x86-64 and PPC specific versions of a_load_ref_cgpara(),
as they are now handled correctly by the generic version
* moved the responsibility of allocating tcgpara cpu registers
(using paramanager.allocparaloc()) from the callers of
cg.a_load*_cgpara() to the cg.a_load*_cgpara() methods
themselves (so the register allocation can be done efficiently
when dealing with function results)
* for the above, renamed paramanager.alloc/freeparaloc() to
paramanager.alloc/freecgpara(), and use paramanager.allocparaloc()
to allocate individual pcgparalocations instead
* fixed the register size of SSE2 function result registers for
x86-64 (when used for floating point), which results in removing
a few superfluous "movs? %xmm0,%xmm0" instructions
* fixed compilation of paramanagers of avr, m68k and mips after r13695
and also updated them for these new changes
git-svn-id: trunk@15350 -
tobjectdef.needs_inittable returns false for classes nowadays (and already
since quite some time)
* nevertheless replaced all usages in the compiler of x.needs_inittable with
is_managed_type(x) (in case some other condition is added again in the
future) and removed all remaining accompanying "and not is_class(x)"
checks
git-svn-id: trunk@15320 -