implementation the compiler determined the routine must never be
inlined
o difference with po_noinline: can also be set in the implementation
o difference with pio_inline_not_possible: it indicates that e.g.
LLVM must not inline the routine either
git-svn-id: trunk@44065 -
the frame of the caller rather than of the current routine, which could
cause e.g. stackframes to be missed in RTL helpers that are known to be
only called from run time error routines)
git-svn-id: trunk@44064 -
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.
git-svn-id: trunk@42356 -
the generation of the procdef's asmsymbols
o also removed unnecessary definition of procdef alias symbols for Darwin
(they are already defined in ncgutil.alloc_proc_symbol)
git-svn-id: trunk@42341 -
private_extern (or plain global in case of PECOFF, as the effect is
the same there): visible across object files, but they become local
when linked into a binary/library. This enables cross-unit inlining
of functions accessig implementation-only symbols.
git-svn-id: trunk@42340 -
Allows compilation of compiler using -dDEBUG_NODE_XML
which will generate a NAME-node-dump.xml file for each
unit, program or library compiled,
containing a XML description of the nodes handled during
compilation of the unit, program or library.
git-svn-id: trunk@42271 -
* 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 -
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 -
on pdecsub (node units should not depend on parser units):
o maybe_add_public_default_java_constructor()
o handle_calling_convention()
o create_finalizer_procdef() (replaced with create_outline_procdef())
o insert_record_hidden_paras()
o handle_calling_convention()
o proc_add_definition()
o build_parentfpstruct()
o maybe_guarantee_record_typesym()
o get_first_proc_str()
* factored out the creation of a procinfo for a nested procdef based on a
subnodetree of the current procdef into tprocinfo.create_for_outlining()
git-svn-id: trunk@40773 -
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 -
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 -
get initialised, so that parameters in this struct are already available
in any wrappers generated for the parent routine (e.g. in case self is
moved to the parentfpstruct in a destructor, which calls beforestruction
in its wrapper)
git-svn-id: trunk@40384 -
(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 -
Fix passing of vararg register pairs.
Fix passing of big record, and return of records.
Disabled framepointer elimination for the time being.
git-svn-id: branches/laksen/riscv_new@39519 -
a) correctly determine whether token recording is required or not (nested routines of generic routines don't need it)
b) correctly determine whether the trailing ";" needs to be parsed (nested routines of generic routines need to)
git-svn-id: trunk@36469 -
* don't parse a semicolon at the end for real specializations or specializations of methods that belong to a specialized class/record
git-svn-id: trunk@35146 -
This unit was empty unless OLDREGVARS macro was set,
but this does not compile and no change has been made since 2011.
* Remove regvars from all _USES clauses.
git-svn-id: trunk@34808 -
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 -
* always register implementation-only, public routines as they might only be called from other units using an external declaration
git-svn-id: trunk@33967 -
psub.pas, read_proc_body:
* also try to generate pending specializations before generating a routine's code so that these might be inlined as well
git-svn-id: trunk@33827 -
fmodule.pas, tmodule:
+ new list pendingspecializations which keeps track of all pending specializations of the current module
psub.pas:
* move generate_specialization_procs and related routines to pgenutil
+ new procedure read_proc_body to read a routine's body, cause generate_specialization_procs needs it (unlike the already existing overload in the implementation section, this one can only handle bodies of non-nested routines)
pgenutil.pas:
* generate_specialization_phase2: add the newly specialized generic to the current module's pending specializations
* generate_specialization_procs: reworked so that it uses the new pendingspecializations field instead of walking the global and local symboltable of the current unit
pmodules.pas:
+ add pgenutil to uses due to the moved generate_specialization_procs
+ added test
git-svn-id: trunk@33826 -
pkgutil.pas, createimportlibfromexternals:
* findpackagewithsym: ignore other (weak) external symbols
........
pkgutil.pas, createimportlibfromexternals:
* import_proc_symbol: at least import the mangled name if there is no alias available
........
pkgutil.pas:
* exportabstractrecordsymproc & insert_export: don't try to export a typedef if it doesn't belong to the current symtable, happens for cross unit type aliases
........
psub.pas:
* read_proc: extract the code that creates an import library entry into its own function import_external_proc so that the same code can be used from other locations as well
........
Correctly handle external functions that are used from other units.
pkgutil.pas, createimportlibfromexternals:
* processasmsyms: also check the import name when checking for duplicates (just for safety, the cache check should have caught these already)
* processimportedsyms: if we have a routine imported from a library of whihc the symbol resides in a unit loaded from a package we need to import the routine ourselves instead of trying to import it from the package; also add an entry in the cache to speed up finding it again in processasmsyms()
........
git-svn-id: trunk@33519 -
The added test shows such a bogus warning (sadly the test suite can handle the occurence or absense of certain messages yet :/ )
git-svn-id: trunk@33324 -
psub.pas, tcgprocinfo.parse_body:
* ensure that parse_generic and current_genericdef are set correctly when parsing a generic routine
pgenutil.pas, generate_specialization_phase2:
* when we're specializing inside a generic we don't want to have the routine definitions, so let the compiler assume that the routine is no longer a forward definition
+ added test
git-svn-id: trunk@33275 -
Merged revision(s) 28793, 28903, 31951 from branches/svenbarth/packages:
psub.pas, read_proc:
* don't generate assembler symbols for compiler internal code
........
Ensure that unneeded initialization/finalization procedures don't leave assembler symbols.
ncgutil.pas:
+ new function release_proc_symbol which removes all assembler symbols of a procdef
pmodules.pas, proc_unit:
* if the initialization or finalization procedure is empty also remove their assembler symbols so they are exported
........
Ensure that readonly sections that need relocations are indeed declared as such.
Thanks to Jonas for this.
ncgvmt.pas, TVMTWriter:
* writeinterfaceids: use sec_rodata instead of sec_rodata_norel
........
git-svn-id: trunk@32982 -
psub.pas, specialize_objectdefs:
+ new nested procedure process_procdef() to handle the generation of method bodies for procdefs both in generic types as well as of generic functions
+ new nested procedure process_procsym() to handle the generation of method bodies for each specialization procdef of a procsym
* allow all procsyms and recursively walk all non-generic types to find all method bodies that need to be generated
git-svn-id: trunk@32383 -
Supporting such a prefix of course means that all section handling code ("var", "type", etc.) needs to respect the case of a "generic" token followed by "function", "procedure" or "class" and thus abort doing its own business.
Maybe I'll find the time somewhen in the future to rework the parser (plus scanner?) a bit so that code like this gets more easy to add and more importantly less ugly.
pdecsub.pas:
* extend parse_proc_dec() and parse_record_method_dec() so that they can be told that they are supposed to handle the to be parsed function/procedure/method header as a generic
pdecvar.pas:
+ new entry for tvar_dec_option named "vd_check_generic" to tell read_var_decls() and read_record_fields() to look out for "generic"
* extend read_var_decls() and read_record_fields() to check for "generic" if needed and to clean up correctly if it is encountered
pdecl.pas:
* the section handling procedures types_dec(), resourcestring_dec(), var_dec(), threadvar_dec() and consts_dec() all return whether they had encountered a "generic" token that was followed by one of $
pdecobj.pas:
* extend method_dec() to take a parameter that says whether the method is supposed to be a generic one
* parse_object_members: while read_record_fields() can handle "generic" we also need to handle the case of "generic" if no fields are allowed anymore
psub.pas:
* extend read_proc() by the possibility to tell it that the procedure/function to be parsed is supposed to be generic
* adjust read_declarations() and read_interface_declarations() to keep track of parsed "generic" tokens and to pass them on accordingly
ptype.pas:
* parse_record_members: same remark as for pdecobj.parse_object_members
git-svn-id: trunk@32380 -
references to defs that are not stored in the ppu files (causing
errors) and are never used for inlining (only the specialisations
may be inlined) (fixes webtbs/tw27658.pp after r32031)
git-svn-id: trunk@32050 -