Previously, they were stored as localvarsyms in either the localsymtable
(for procedures/functions) or as localvarsyms in the staticsymtable (for
init/fini code of units/main programs). The latter was a hack (staticsymtables
normally cannot contain localvarsyms) and caused the temp allocator to also
allocate them as a local in fini code even if the default was only in the init
code.
The new approach ensures at most one copy gets allocated per unit, it doesn't
require explicit initialisation (since staticvarsyms are in bss -> zeroed by
default), gets rid of the localvarsyms in staticsymtables, and as a bonus
solves an issue with inconsistent LLVM debug information for the localvarsym
in init/fini code (since the staticsymtable is shared between the init and
fini code, so was the local, and therefore we generated debug info stating
it was defined in the fini code but within the scope of the init code).
Resolves#40395
This optimisation can insert code after the call to fpc_setjmp, resulting in
it not getting executed after a longjmp. Fixes tmacnonlocalgoto on AArch64
with -O2 or higher.
before the procedure finalization code. This fixes compilation errors in
procedures with implicit finalization code (e.g. for ansistring local vars,
etc).
* properly fix the internalerror it hid: only replace the local symbols
migrated to the parentfpstruct right before generating debug information,
so that internally generated self/result loads during optimisation passes
don't get confused by the replacement absolutevarsyms (those are normally
never encountered during optimisation, as regular absolutevarsyms are
replaced during parsing)
git-svn-id: trunk@47855 -
* 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 -
This patch extends the DEBUG_NODE_XML debug feature by also outputting,
to the *-node-dump.xml files, the node tree as it appears after the first pass,
since it often contains many more internal nodes like temporary allocations that may need
to be evaluated for debugging and development purposes, or node-level optimisation opportunities.
git-svn-id: trunk@47709 -
bug report #0036882: [Feature] Class and record definition XML dump extension
These patches extend the node dump feature (enabled with DEBUG_NODE_XML)
so it also dumps class and record definitions to the XML file. They are contained within <definition> tags.
Currently only fields and constants are dumped to the XML file. Methods, constant and variable definitions may be added later.
git-svn-id: trunk@47658 -