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 -
pass them to the linker so it does not reorder them
o fixes resource strings on Darwin when using LTO (this used to reorder the
resource string symbols, so they no longer all appeared between the START
and END symbols for their compilation module)
git-svn-id: trunk@41907 -
Add possibiliy to throw InternalError
for unhandled case values inside tentryfile,
But avoid adding dependency on verbose unit
as this would break ppudump handling of ppu files.
Add RaiseAssertion virtual method to tentryfile class.
Call RaiseAssertion in tentryfile methods
where an internal error is wanted.
Override RaiseAssertion method in symtype.pas unit
to call InternalError.
Add new class tppudumpfile to override RaiseAssertion
in utils/ppuutils/ppudump.pp unit.
git-svn-id: trunk@41896 -
procoptions even when it's through an array-of-const parameter
* always call create_varargs_paraloc_info() instead of create_paraloc_info()
in the former case, even when no varargs parameters are specified (because
on some platforms even some non-variadic parameters need to be passed
differently, such as on ARM with gnueabihf)
git-svn-id: trunk@41420 -
o unsetting po_inline while parsing the implementation for various reasons
(interprocedural goto/label, accessing a local in a parent frame,
having nested procedures)
o instead handle this via the pio_inline_not_possible flag
o noreturn can no longer be specified only in the implementation
git-svn-id: trunk@40789 -
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 -
* entfile.pas: Change PPU header falgs filed from longint to dword.
* ngtcon.pas: Change local variable startoffset type to aword.
* omfbase.pas: Avoid calling move with a nil string s indexed as s[1],
to avoid a range check error.
* owomflib.pas: Disable range check explicitly in hash computation.
* utils/ppuutils/ppudump.pp: Adapt to flags type change in entfile.pas
git-svn-id: trunk@40163 -
and filled it with the dwarf register mapping, used by Open Watcom (Watcom
also uses this mapping on i386, but we don't need to support their debugger on
i386 for now)
git-svn-id: trunk@39097 -
* ppu version update
* -Sf might be used only during system unit compilation
* loadsystemunit factored out so the system unit can be loaded earlier than other units to get features set
git-svn-id: trunk@37708 -
easily and so that all the values are now available to the compiler
(previously, there were several, which were mapped to the same value and thus
were only used to make x86ins.dat easier to read)
git-svn-id: trunk@37299 -
this removes the limit of 3 Ch_XXX flags per instruction (thus allowing adding
more precise flags, e.g. for tracking only certain bits of the flags register,
etc.) and avoids the ugliness of having the Ch_None filler, which makes
x86ins.dat less readable.
git-svn-id: trunk@35850 -
Note: I'm not yet really happy with both AT_DATA_FORCEINDIRECT and AT_DATA_NOINDIRECT; maybe I should replace them with flags or something like that...
git-svn-id: trunk@35366 -
Use new cs_checkpointer_called moduleswitches set element.
Use new uf_checkpointer_called PPU flag (reusing obsolete uf_local_browser flag value)
Emit warning if compiled library/program has any code using checkpointer.
* ppu.pas: New constant: uf_checkpointer_called
* globtype.pas: New constant: cs_checkpointer_called
* fppu.pas: Set uf_checkpointer_called flag if cs_checkpointer_called is set in current_settings.module_switches
* i8086/n8086mem.pas: Include cs_checkpointer_called in current_settings.moduleswitches
* ncgmem.pas: Likewise.
* msg/errore.msg: Add new message saying that -gc and -Ur options are incompatible
Add description to -gc option, saying it is experimental.
Add warning at link time for program/library if checkpointer is used in any unit or main code.
* options.pas: if -gc and -Ur options are used, never enable checkpointer code,
instead output a warning that release is incompatible with -gc option.
* pmodules.pas: proc_program: Check all modules for uf_checkpointer_called flag,
emit a warning if checkpointer is used.
* utils/ppuutils/ppudump.pp: Add code for uf_codepointer_called option.
git-svn-id: trunk@34567 -
This basically revives the globalasmsym entry of the PPU though it feeds to different lists, one for the public (exported) symbols and one for the external (imported) symbols. Also the list of symbols is much smaller as it would be if all symbols would be dumped in there.
git-svn-id: trunk@34174 -
SS=DS. This is currently redundant (whether SS=DS can be derived by the other
i8086 memory model unit flags), but in the future will allow adding extra
memory models, where the SS=DS assumption differs from the current ones.
git-svn-id: trunk@34139 -
it's an automatically generated getter/setter, but a procoption. This
way we no longer have to save/restore the synthetickind procdef field
to/from ppu's. This way we can modify the field also after the interface
has been parsed without affecting the crc (e.g. when creating wrappers
for high level targets for routines that are only declared as "external"
in the implementation)
git-svn-id: trunk@34129 -
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 -
compiler/utils/ppuutils/ppudump, readdefinitions:
* with the move of most target specific PPU data into the target specific sym types the location of the library symbol for the Amiga-like systems has changed
git-svn-id: trunk@33965 -
compiler/utils/pputils/ppudump.pp, readsymbols:
* ibstartsyms only contains one longint, namely the count of the symbols, not two
git-svn-id: trunk@33887 -
utils/ppuutils/ppudump.pp:
+ new procedure ReadUnitImportSyms which simply outputs all imported symbols
* readimplementation: handle ibunitimportsyms with ReadUnitImportSyms
git-svn-id: trunk@33500 -
Extract reading of the PPU/PCP version into tentryfile.
entfile.pas:
+ add new getversion method which uses the pointer returned by getheaderaddr to read the PPU/PCP version
ppu.pas:
- remove GetPPUVersion method
fppu.pas, pmodules.pas, utils/ppufiles.pp, utils/ppumove.pp, utils/ppuutils/ppudump.pp
* replace call to GetPPUVersion by call to getversion
........
git-svn-id: trunk@32980 -
Extract functionality that is shared between the metadata files for units (PPU) and for packages (PCP) into a parent class called tentryfile
+ add new unit entfile which contains the new tentryfile class and related types and constants
* ppu.pas:
- remove methods, fields, types and constants which were moved to entfile.pas
* replace the parts of tppuheader shared with tentryheader by a field of type tentryheader
fppu.pas, pmodules.pas, utils/ppumove.pp, utils/ppuutils/ppudump.pp:
+ add entfile to uses
* adjust access to common header fields
node.pas, symdef.pas, symsym.pas, symtable.pas, wpoinfo.pas, utils/ppufiles.pp:
+ add entfile to uses
........
git-svn-id: trunk@32976 -
"don't free even if not registered"; use for defs that may not be written
to a ppu file, but that must nevertheless survive the compilation of the
current module
* mark all defs created for para locations as "don't free even if not
registered", because we don't discard and recalculate all para locations
after a module has been compiled (since that's not needed)
o solves issues if the paralocations for a routine in the interface of
unit A are calculated while the implementation of unit B gets
compiled, and a new reusable type is allocated at that point which
is not used anywhere else (after r32160)
git-svn-id: trunk@32235 -
+ new token buffer that holds the declaration of the generic function/method while the one from tdef contains the body
ppu.pas:
* increase PPU version
utils/ppuutils/ppudump.pp:
* also read the declaration token buffer, it's however not printed yet (ToDo!)
git-svn-id: trunk@31759 -
Add some VFP registers.
Rebuilt tables.
Added a lot of VFPv3 and Advanced SIMD(not supported yet) oppostfixes.
Implemented code in aasmcpu to generate binary code from the instructions. Only ARM32 supported so far.
git-svn-id: branches/laksen/armiw@29246 -
include this option only of libsym field
is non NIL.
Use this option to only write redef of libsym if needed.
Adapt ppudump source to this new procedure option.
git-svn-id: trunk@28732 -
will only be used for indexing huge pointers (i.e. only huge arrays with the
ado_IsConvertedPointer array option will be supported). In the distant future,
regular huge arrays may be supported as well (but that would require
substantially more work, including adding hugeness support to other structures
such as records, objects and classes, so I'm not planning on doing it anytime
soon).
git-svn-id: trunk@28270 -
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
uses for anonymous function references. The "cdecl;" indicates that this
is for the C-variant of such references, which is what blocks are
git-svn-id: branches/blocks@28233 -
o blocks are implemented as a variation of procedure variables
o declaration of a block variable: "test: procedure(c: char) is block;"
(C equivalent: (void)(^test)(char c) )
o the compiler automatically converts procedures/functions whose address
is passed to a block parameter or assigned to a block variable into
a "block". This consists of
1) generating a block descriptor (containing the size of the "block
literal" (see below) and the signature of the invocation function
encoded as an Objective-C selector)
2) generating a wrapper function around the original funcion (with C
calling convention), that has an extra first hidden parameter
(marked as vo_is_parentfp in the compiler) whose type is a pointer
to the describing "block literal"
3) generating the "block literal", which contains a pointer to an
external variable indicating whether this block captures context or
not, some flags (see compiler/blockutl.get_block_literal_flags for
info), a pointer to the wrapper function and a pointer to the
descriptor. In the future, it will also contain captured variables.
o right now, only global procedures/functions can be converted to blocks
(because they don't require state capturing). The next steps are (Object
Pascal) methods (not Objective-C methods, because Objective-C method
procvars don't exist) and finally nested functions
o on Mac OS X, the functionality will only work on Mac OS X 10.7 and later,
because we have to use the so-called "ABI.2010.3.16" to ensure that
our blocks aren't called as variadic functions by the runtime (which
came out after the Mac OS X 10.6 release)
o while the currently implemented functionality does not require any
library support at all, there's no use enabling it on other platforms
because unless it has been confirmed to work with a blocks runtime,
there's no point in using blocks (they're just somewhat bulky procvars
right now). Enabling it on other platforms (in combination with the
GNUStep Objective-C run time), should simply be a matter of adding
the right {$linklib xxx} statement to rtl/inc/blockrtl.pp file, adding
that file to Makefile.fpc for that platform and adding that platform
to the compiler/systems.systems_blocks_supported set
git-svn-id: branches/blocks@28232 -
o the maintenance effort will be less - previously we had to test 4
combinations:
tiny program with tiny rtl
tiny program with small rtl
small program with tiny rtl
small program with small rtl
I only tested both tiny and small programs with the small rtl, so I missed
a bug, which caused small programs built with the tiny rtl to always give
a "Nil pointer assignment" error. Now we only need to test two cases:
tiny program with tiny rtl
small program with small rtl
o I'm planning a bug fix for interrupt procedures in the tiny model, which
will make their prolog differ between small and tiny. Currently, they're
not used in the rtl, but that may change. And even if it doesn't,
interrupt procedures may also be used by user units.
git-svn-id: trunk@27516 -
on the stack, this can be enabled by -OoFORCENOSTACKFRAME. This reduces the required
entry/exit code and makes an extra register available to the compiler. However, since this is
based on an estimation of the required stack size, it might have two drawbacks:
either the stack frame is estimated to big, the program requires a bigger stack than needed
or it is estimated too small, then the compiler throws an internalerror during compilation. These
issues can be overcome as soon as the compiler supports recompiling subroutines if needed.
git-svn-id: trunk@27239 -
the availability of the body of a function declared as "inline" no
longer changes the CRC and hence no longer triggers recompilations
(mantis #24121)
git-svn-id: trunk@27192 -
* compiler/utils/fpc.pp:
also apply the versionstr suffix to ppcbin if versionstr is set like is done when really executing the compiler
git-svn-id: trunk@26887 -
* This should be applicable to i8086 targets as well (but needs testing), by copying changes from i386/cgcpu.pas to i8086/cgcpu.pas and removing "$ifdef i386" lines in cgx86.pas.
git-svn-id: trunk@25224 -
symsym.pas:
- remove "tgenericconstraintdata" and any using/loading/writing of it in "ttypesym"
- remove "tgenericconstraintflag"
symdef.pas:
+ add "tgenericconstraintdata"
+ load and write "genconstraintdata" in "tstoreddef"
symconst.pas:
+ add "tgenericconstraintflag" so it can be used in "ppudump" as well
defcmp.pas, compare_defs_ext:
* as we allow global operator overloads we can't really determine whether two defs are compatible, because a valid operator for the specialization types might just happen to be in scope of the generic; so for now constraints are only strictly checked when declaring a specialization
pgenutil.pas:
* adjust "parse_generic_parameters" and "check_generic_constraints" to the new location of the constraint data
ppudump.pp:
* corrrectly parse defs which contain generic constraints
git-svn-id: trunk@24628 -
symconst.pas:
+ add "sto_needs_init_final" value to "tsymtableoptions"
symtable.pas:
- TStoredSymtable: remove "b_needs_init_final"
+ TStoredSymtable: add "init_final_check_done" (which is False by default)
* TStoredSymtable.ppuload: set "init_final_check_done" to True if PPU is loaded (because the flag will then already be restored)
* TStoredSymtable.needs_init_final: check the symbols only if "init_final_check_done" is not set yet
* TStoredSymtable._needs_init_final: only check the symbol if "sto_needs_init_final" is not set yet and set the flag accordingly if needed
utils/ppuutils/ppudump.pp:
* respect the new flag
git-svn-id: trunk@24523 -
- Check PPU version to be the same as the current PPU version of the compiler. It prevents reading errors if a unit has wrong PPU version. The version check can be turned off using -S switch.
- User WriteError() in appropriate places in the code.
git-svn-id: trunk@24408 -