summaryrefslogtreecommitdiff
path: root/compiler/procinfo.pas
Commit message (Collapse)AuthorAgeFilesLines
* * if a subroutine has an lsda record, the actions have to cover all codeflorian2019-02-241-0/+16
| | | | | | * cleanup git-svn-id: https://svn.freepascal.org/svn/fpc/branches/debug_eh@41453 3ad0048d-3df7-0310-abae-a5850022a9f2
* * refactored psabieh handling, most code is now in psabiehpiflorian2019-02-171-3/+17
| | | | git-svn-id: https://svn.freepascal.org/svn/fpc/branches/debug_eh@41367 3ad0048d-3df7-0310-abae-a5850022a9f2
* * synchronised with trunk till r40775jonas2019-01-051-2/+17
|\ | | | | | | git-svn-id: https://svn.freepascal.org/svn/fpc/branches/debug_eh@40776 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * moved around/replaced the following procedures to stop nflw from dependingjonas2019-01-051-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: https://svn.freepascal.org/svn/fpc/trunk@40773 3ad0048d-3df7-0310-abae-a5850022a9f2
* | + new tf_use_psabieh target flag to indicate a target uses PSABI/Dwarf EHjonas2018-11-291-0/+8
|/ | | | | | | | | | 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: https://svn.freepascal.org/svn/fpc/branches/debug_eh@40415 3ad0048d-3df7-0310-abae-a5850022a9f2
* + initial work for tls-based threadvar support on arm-linuxflorian2018-11-071-0/+13
| | | | git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@40267 3ad0048d-3df7-0310-abae-a5850022a9f2
* * removed unused unitsflorian2017-05-091-6/+4
| | | | git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@36165 3ad0048d-3df7-0310-abae-a5850022a9f2
* + added volatility information to all memory referencesjonas2016-11-271-1/+1
| | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/trunk@34996 3ad0048d-3df7-0310-abae-a5850022a9f2
* * replaced current_procinfo.currtrue/falselabel with storing the true/falsejonas2015-08-271-25/+1
| | | | | | | | | labels of LOC_JUMP in the node's location. This generates some extra jumps for short circuit boolean and/or-expressions if optimizations are off, but with optimisations enabled the generated code is the same (except for JVM because the jump threading optimisation isn't enabled there yet). git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@31431 3ad0048d-3df7-0310-abae-a5850022a9f2
* * reduce dependencies of the procinfo unitflorian2015-05-161-19/+4
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@30871 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Added virtual method tprocinfo.postprocess_code and moved target-specific ↵sergei2014-04-021-0/+7
| | | | | | processing from base class into target-specific descendant classes (ARM and AVR, other targets still to do). git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@27449 3ad0048d-3df7-0310-abae-a5850022a9f2
* compiler: fix calling class methods from a nested routine of a static class ↵paul2013-08-171-0/+8
| | | | | | method (mantis #0024865) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25274 3ad0048d-3df7-0310-abae-a5850022a9f2
* compiler: if method has no self node then load it as a usual identifier ↵paul2013-08-171-0/+3
| | | | | | (issue #0024871) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25273 3ad0048d-3df7-0310-abae-a5850022a9f2
* * estimatedtempsize should be a longint to avoid warnings on 8 bit targetsflorian2013-04-071-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24198 3ad0048d-3df7-0310-abae-a5850022a9f2
* + support of stackframesize for arm thumbflorian2013-04-071-0/+4
| | | | | | + estimatedtempsize to get a good estimatation for architectures which require to know the stack size before git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24188 3ad0048d-3df7-0310-abae-a5850022a9f2
* + nested exit supportflorian2013-01-041-0/+3
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23309 3ad0048d-3df7-0310-abae-a5850022a9f2
* * keep track of required stack frame alignment (this information is howeverjonas2012-09-021-0/+14
| | | | | | not yet actually used for anything) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@22280 3ad0048d-3df7-0310-abae-a5850022a9f2
* + implement auto inlining (-Ooautoinline)florian2012-05-191-11/+7
| | | | | | | | | | | | + implement trashing of local variables if subroutine is inlined * fix some errors releated to interproc. gotos and inlining + node_count function * inline cannot be used with iochecking and safecall calling conventions * track inherited usage * don't inline if inherited is used git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21335 3ad0048d-3df7-0310-abae-a5850022a9f2
* * merged trunk up to r20882jonas2012-04-151-1/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o support for the new codepage-aware ansistrings in the jvm branch o empty ansistrings are now always represented by a nil pointer rather than by an empty string, because an empty string also has a code page which can confuse code (although this will make ansistrings harder to use in Java code) o more string helpers code shared between the general and jvm rtl o support for indexbyte/word in the jvm rtl (warning: first parameter is an open array rather than an untyped parameter there, so indexchar(pcharvar^,10,0) will be equivalent to indexchar[pcharvar^],10,0) there, which is different from what is intended; changing it to an untyped parameter wouldn't help though) o default() support is not yet complete o calling fpcres is currently broken due to limitations in sysutils.executeprocess() regarding handling unix quoting and the compiler using the same command lines for scripts and directly calling external programs o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1 to the make command line git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@20887 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * use r7 instead of r11 as frame pointer on Darwin/iOS, and make sure r7jonas2012-03-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | always points to the previous r7 on the stack (with the saved return address coming right after it) so that the debugger and crashreporter can use it for backtraces as specified in the ABI o changed NR_FRAME_POINTER_REG and RS_FRAME_POINTER_REG from a symbolic into a typed constant, and added a new method to tprocinfo that can be used to initialze it (so it can be inited to r7/r11 depending on the target platform) * allow using r9 on Darwin, it was only used by the system on iOS up to 2.x, which we no longer support * prefer using r9 and r12 before r4..r11 on Darwin, because they are volatile and hence do not have to be saved git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@20661 3ad0048d-3df7-0310-abae-a5850022a9f2
| * + Platform-specific exception support for x86_64-win64. Enable by cycling ↵sergei2012-01-161-0/+11
| | | | | | | | | | | | with OPT=-dTEST_WIN64_SEH. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@20098 3ad0048d-3df7-0310-abae-a5850022a9f2
| * + Generate unwind bytecode for function prologues on win64.sergei2011-09-231-1/+6
| | | | | | | | | | | | * For now placed actual processing of unwind info under {$ifdef TEST_WIN64_UNWIND}, because in the current state it doesn't add much value. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@19200 3ad0048d-3df7-0310-abae-a5850022a9f2
* | * implemented declaring and calling constructors for Java classesjonas2011-08-201-0/+5
|/ | | | | | | | | | | | | | | | | | | | o handle them like for regular classes (return a class instance, although this is technically not true since they don't return anything; will be changed in the future) o because of the previous point, make sure that we handle the "function result" properly and don't pop too many values from the evaluation stack when calling one constructor from another o added "extra_pre_call_code" method used by njvmcal to insert the "new" opcode to create the new class instance before calling a constructor o when a constructor does not call any other constructor (inherited or otherwise), automatically insert a call to the inherited parameterless constructor as required by the jvm standard) TODO: check that *if* an inherited or other constructor is called from another constructor, that it does so as the first statement/ call git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18328 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Improvements of tprocinfo class:sergei2011-03-271-0/+65
| | | | | | | | | | | * Moved nestedprocs from tcgprocinfo to tprocinfo, in order to be able to access the entire nested procedure hierarchy without depending on psub.pas or code generator. * Creating an instance of tprocinfo automatically inserts it into list of parent's nested procedures. * nestedprocs list is created on demand. Public read-only access is provided by has_nestedprocs and get_first_nestedproc functions. + Method destroy_tree is provided for destroying the entire hierarchy of procinfo's. It can be called on any procinfo object in the tree. + Also added methods save_jump_labels and restore_jump_labels for asmlabel maintenance, which is currently being repeatedly done all over the codegenerator. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@17197 3ad0048d-3df7-0310-abae-a5850022a9f2
* * moved use_fixed_stack from cgutils to a method in paramgr so it canjonas2010-09-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | be used outside the code generator * renamed tabstractprocdef.requiredargarea into callerargareasize, and also added calleeargareasize field; added init_paraloc_info(side) method to init the parameter locations and init those size fields and replaced all "if not procdef.has_paraloc_info then ..." blocks with procdef.init_paraloc_info(callersize)" * moved detection of stack tainting parameters from psub to symdef/tabstractprocdef + added tcallparanode.contains_stack_tainting_call(), which detects whether a parameter contains a call that makes use of stack paramters * record for each parameter whether or not any following parameter contains a call with stack parameters; if not, in case the current parameter itself is a stack parameter immediately place it in its final location also for use_fixed_stack platforms rather than first putting it in a temporary location (part of mantis #17442) * on use_fixed_stack platforms, always first evaluate parameters containing a stack tainting call, since those force any preceding stack parameters of the current call to be stored in a temp location and copied to the final location afterwards git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16050 3ad0048d-3df7-0310-abae-a5850022a9f2
* * propagate pi_has_assembler_block and pi_uses_exceptions flags from inlinedjonas2010-07-081-1/+5
| | | | | | | | routines to their host, as in this case the stack frame cannot be omitted (mantis #16874) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15535 3ad0048d-3df7-0310-abae-a5850022a9f2
* * the compiler now explicitly keeps track of the minimally guaranteedjonas2009-02-081-1/+1
| | | | | | | | | | | | | | | | alignment for each memory reference (mantis #12137, and test/packages/fcl-registry/tregistry1.pp on sparc). This also enables better code generation for packed records in many cases. o several changes were made to the compiler to minimise the chances of accidentally forgetting to set the alignment of memory references in the future: - reference_reset*() now has an extra alignment parameter - location_reset() can now only be used for non LOC_(C)REFERENCE, use location_reset_ref() for those (split the tloc enum so the compiler can catch errors using range checking) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@12719 3ad0048d-3df7-0310-abae-a5850022a9f2
* + PIC support for darwin/ppc32 (-Cg works now, no regressions in testjonas2007-09-261-0/+9
| | | | | | | | | | | suite compiled with -Cg compared to without -Cg) + support for using a virtual register as PIC/got base register * moved got loading code from ncgutil to cgobj/cgcpu (can't test whether it didn't break anything under linux/i386, because "make cycle OPT=-Cg" was already broken due to the *prt*.as -> si_*.pp changes) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8651 3ad0048d-3df7-0310-abae-a5850022a9f2
* * proper handling of dummy result node in dfa, resolves #8717 and #8079florian2007-07-231-3/+0
| | | | | | | + tests git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8147 3ad0048d-3df7-0310-abae-a5850022a9f2
* + give more sophisticated warnings about uninitalized variables when life ↵florian2007-06-031-1/+5
| | | | | | info is available git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@7562 3ad0048d-3df7-0310-abae-a5850022a9f2
* * settings refactoredflorian2006-10-301-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@5094 3ad0048d-3df7-0310-abae-a5850022a9f2
* Merged revisions 2921-2922,2925 via svnmerge from peter2006-03-161-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | http://svn.freepascal.org/svn/fpc/branches/linker/compiler ........ r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines * pass ObjectWriter to ObjectOuput ........ r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines * refactor asmdata ........ r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines * add cfi to asmdata * move asmlist, asmcfi, asmdata to own unit ........ git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2932 3ad0048d-3df7-0310-abae-a5850022a9f2
* + support for passing parameters via pre-allocated stack space on i386jonas2006-03-101-1/+4
| | | | | | | | | (override/adjust cgutils.use_fixed_stack to change conditions where this is done, currently only activated for darwin-i386) * make sure the stack is always aligned to 16 bytes on darwin-i386 git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2840 3ad0048d-3df7-0310-abae-a5850022a9f2
* * support multiple asmlabel types, renamed getlabel topeter2005-09-181-2/+2
| | | | | | | | | getjumplabel and added type para to getlabel for specific types * moved lineinfo generation from assemble and aggas to dbgstabs git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1120 3ad0048d-3df7-0310-abae-a5850022a9f2
* * log and id tags removedfpc2005-05-211-7/+0
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@42 3ad0048d-3df7-0310-abae-a5850022a9f2
* initial importfpc2005-05-161-0/+190
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1 3ad0048d-3df7-0310-abae-a5850022a9f2