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 -
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 -
* 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 -