Commit Graph

491 Commits

Author SHA1 Message Date
Jonas Maebe
8bc4e0a32f * inline and compilerproc are now procoptions instead of proccall types
(so both can be combined with each other, as well as with other calling
     conventions)
  * defined COMPPROCINLINEFIXED so SYSTEMINLINE is again activated

git-svn-id: trunk@658 -
2005-07-18 15:27:14 +00:00
florian
7cd67ea3f0 * node optimizer branch merged
* gotonode and gotolabel refactored
  * -Nu added to enable for loop unrolling

git-svn-id: trunk@446 -
2005-06-19 17:42:10 +00:00
peter
34ed3ae7a5 * don't use normal assingments for inlining of formal consts
git-svn-id: trunk@393 -
2005-06-13 06:57:54 +00:00
Jonas Maebe
893f45c9e2 * fixed web bug #4039 (include methodpointer init/fini for inlined methods)
git-svn-id: trunk@390 -
2005-06-12 16:40:10 +00:00
florian
21038de78d + started with refactoring det_resulttype
+ dosimplify
* inlinenig makes use of dosimplify

git-svn-id: trunk@140 -
2005-05-29 15:15:38 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
michael
55e76063df * Fix methodpointer copy from callnode to loadnode 2005-04-06 11:49:37 +00:00
peter
521b7cfa3b * load all complex loads of parameters that are needed multiple times
to a temp to prevent calling functions twice
2005-04-05 21:07:43 +00:00
peter
e71066495c fix type of temps generated for parameters during inlining 2005-03-28 15:05:17 +00:00
peter
3f9d6ab32f * add hint when passing an uninitialized variable to a var parameter 2005-03-25 22:20:18 +00:00
peter
20ad7813c2 * fix empty varargs codegeneration for x86_64 2005-03-14 20:18:46 +00:00
peter
047c28d993 * member call to constructor returns void to prevent
generating unexpected code. Otherwise the return value is always
    equal to self, which can also be directly accessed
2005-02-17 17:50:26 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
florian
5007b3e395 * inherited; works now in delphi mode for private methods; looks like a delphi bug 2005-02-01 22:50:50 +00:00
peter
8d251e8506 * unit mapping rewrite
* new derefmap added
2005-01-19 22:19:41 +00:00
peter
720815e13b * fix aftercosntruction calls, vmt=1 is used to indicate that
afterconstruction needs to be called
  * only accept resourcestring when objpas is loaded
2005-01-04 16:36:31 +00:00
peter
a15f1c3283 * Don't release methodpointer. It is maybe still needed when we need to
convert the calln to loadn
2005-01-02 16:58:48 +00:00
peter
c1bf99c30a * fix crash with callnode.ppuload when symtableproc=nil 2004-12-27 16:36:10 +00:00
peter
ced6bf20cd * fix lineinfo for with blocks 2004-12-26 16:22:01 +00:00
peter
29db12ecfa * disable inlining across units when the inline procedure references
a variable or procedure in the static symtable
2004-12-15 21:08:15 +00:00
peter
d387fda801 * give error when paraloc is not filled in order_parameter 2004-12-15 19:30:16 +00:00
peter
78c2af7b3c * set vo_explicit_paraloc flag 2004-12-07 16:11:52 +00:00
peter
2b6456fe16 * procvar handling for tp procvar mode fixed
* proc to procvar moved from addrnode to typeconvnode
  * inlininginfo is now allocated only for inline routines that
    can be inlined, introduced a new flag po_has_inlining_info
2004-12-05 12:28:10 +00:00
peter
57dc23a294 * fix crashes with nodeinlining 2004-12-03 16:07:04 +00:00
peter
959bdccc49 * disable pass2inline 2004-12-02 19:26:14 +00:00
Jonas Maebe
38db3679d8 * only try to replace locals from the inlined procedure with temps,
cycle now works with -dNODEINLINE
2004-11-28 14:34:59 +00:00
Jonas Maebe
f244dea6ec * fixed some bugs in the node inlining code due to the transition from
dynamic array to tlist
  * fixed some register temp bugs (node inlining still does not work again
    though)
2004-11-27 22:43:01 +00:00
peter
576e1825aa * enabled pass1 inlining from Jonas 2004-11-22 22:19:00 +00:00
peter
8cf8c54609 * fixed varargs
* replaced dynarray with tlist
2004-11-22 22:01:19 +00:00
peter
89b1b583c9 * ttempcreatenode.create_reg merged into .create with parameter
whether a register is allowed
  * funcret_paraloc renamed to funcretloc
2004-11-21 17:54:59 +00:00
peter
e740a66636 * tparaitem removed, use tparavarsym instead
* parameter order is now calculated from paranr value in tparavarsym
2004-11-15 23:35:30 +00:00
peter
7c0b6e129e * fixed wrong typecasts 2004-11-09 17:26:47 +00:00
peter
6458bd0ce1 * tvarsym splitted 2004-11-08 22:09:58 +00:00
peter
2e161c5e9e * nf_internal flag for internal inserted typeconvs. This will
supress the generation of warning/hints
2004-11-02 12:55:16 +00:00
peter
0d506c579e * removed wrong check for symtableprocentry 2004-11-01 18:16:48 +00:00
peter
6a0aa09b20 * give IE instead of crash when no procsym is passed for calln 2004-11-01 16:58:57 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
peter
e7459f5466 * heap and heapsize removed
* checkpointer fixes
2004-10-25 15:38:41 +00:00
mazen
581b52422c - remove $IFDEF DELPHI and related code
- remove $IFDEF FPCPROCVAR and related code
2004-10-15 09:14:16 +00:00
peter
560a790a57 * gen high tree makes copy in temp when there is a calln 2004-10-12 14:36:38 +00:00
peter
b0c25b50a0 * symtable allocation rewritten
* loading of parameters to local temps/regs cleanup
  * regvar support for parameters
  * regvar support for staticsymtable (main body)
2004-10-10 20:22:53 +00:00
peter
63cf4464d3 * tvarsym.varregable added, split vo_regable from varoptions 2004-10-08 17:09:43 +00:00
peter
33a834821f * paraloc branch merged 2004-09-21 17:25:12 +00:00
peter
384e764831 * use realname for abstract procs found 2004-09-13 20:29:00 +00:00
peter
8694a4b86b * use objrealname in Message1 2004-08-28 20:00:50 +00:00
peter
923569eee2 * fixed crash when passing array constructor to formal parameter 2004-08-22 10:17:13 +00:00
florian
6368652be2 * fixed several sparc alignment issues
+ Jonas' inline node patch; non functional yet
2004-08-14 14:50:42 +00:00
Jonas Maebe
ddf175f171 + temps can now also hold fpu values in registers (take care with use,
bacause of the x86 fpu stack)
  * fpu parameters to node-inlined procedures can now also be put in
    a register
2004-07-16 19:45:15 +00:00
Jonas Maebe
7cdc049df1 * the condition for when to use a temp in case of reference var/const
parameters was inverse
2004-07-15 21:02:05 +00:00
Jonas Maebe
c7fbf7b11b + (incomplete) node_complexity function to assess the complexity of a
tree
  + support for inlining value and const parameters at the node level
    (all procedures without local variables and without formal parameters
     can now be inlined at the node level)
2004-07-15 19:55:39 +00:00
Jonas Maebe
1563d986c5 * inline procedures at the node tree level, but only under some very
limited circumstances for now (only procedures, and only if they have
    no or only vs_out/vs_var parameters).
  * fixed ppudump for inline procedures
  * fixed ppudump for ppc
2004-07-12 09:14:04 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
peter
330a86b7d6 * fix tcallnode.getcopy. the parameters need to be copied after
methodpointerinit is copied
2004-05-25 18:51:49 +00:00
peter
eca9713796 * fix passing of array to open array of array (bug 3113) 2004-05-24 17:31:51 +00:00
peter
b86f2c6a25 * methodpointer is loaded into a temp when it was a calln 2004-05-23 18:28:40 +00:00
peter
72365ec95b * implicit_finally flag must be set in pass1
* add check whether the implicit frame is generated when expected
2004-05-23 15:06:20 +00:00
Károly Balogh
3175dd4c6b * few small changes to add syscall support to M68k/Amiga target 2004-05-12 13:21:09 +00:00
florian
e8098f6b71 + added lib support for Amiga/MorphOS syscalls 2004-05-01 22:05:01 +00:00
peter
d3f035df50 * removed unused paravisible 2004-03-14 20:07:13 +00:00
peter
b8fad24f31 * fix check for parameter length when calling procvar, broken by the
previous default parameter for procvar fix
2004-03-04 17:25:16 +00:00
peter
2213f0433c * fix procvars with default paras 2004-02-26 16:09:49 +00:00
peter
05e0d83348 * operator overload chooses rewrite
* overload choosing is now generic and moved to htypechk
2004-02-24 16:12:39 +00:00
peter
c844c5a505 * procvar cleanup 2004-02-20 21:55:59 +00:00
florian
06a33abebd * fixed arg. area calculation 2004-02-19 17:07:42 +00:00
peter
3a3fdde6d1 * compare_defs_ext has now a options argument
* fixes for variants
2004-02-13 15:42:21 +00:00
peter
ee569d7817 * make extcycle is working again 2004-02-12 15:54:03 +00:00
florian
465aa5851b * several fixes to compile x86-64 system 2004-02-05 01:24:08 +00:00
peter
ecfbbeffc3 * renamed xNNbittype to xNNinttype
* renamed registers32 to registersint
  * replace some s32bit,u32bit with torddef([su]inttype).def.typ
2004-02-03 22:32:53 +00:00
daniel
97e87aaebc * reginfo now also only allocated during register allocation
* third round of gdb cleanups: kick out most of concatstabto
2004-01-26 16:12:27 +00:00
daniel
7a6b6f4bd4 * Some minor stuff
* Managed to eliminate speed effects of string compression
2004-01-15 15:16:17 +00:00
peter
2063100f51 * ignore hidden parameters when default parameters are used 2004-01-14 17:53:58 +00:00
daniel
4a4b8f2a72 * Experiment: Compress strings to save memory
Did not save a single byte of mem; clearly the core size is boosted by
    temporary memory usage...
2004-01-11 23:56:19 +00:00
florian
d38abc3a3f + setting of bit 6 of cr for c var args on ppc implemented 2003-12-28 22:09:12 +00:00
florian
b52cee6639 * fixed ppc inlining stuff
* fixed wrong unit writing
  + added some sse stuff
2003-12-21 19:42:42 +00:00
florian
9fd5217032 * some x86-64 compilation fixe 2003-12-20 12:38:51 +00:00
florian
77f0eff7db * better inheritence of procinfo flags of inlined procedures 2003-12-16 22:09:31 +00:00
florian
2258e941af + inlined procedures inherit procinfo flags 2003-12-16 21:29:24 +00:00
peter
57b4d5a0b9 * paralength is private again 2003-12-08 22:37:28 +00:00
peter
52ffda0bc4 * varargspara is left-right, so adding paraitems needs insert
instead of concat
2003-12-08 16:34:23 +00:00
peter
9aba5c8c7a * fixed some crashes
* fixed varargs and register calling probs
2003-12-01 18:44:15 +00:00
peter
b26e3c444a * reversed offset calculation for caller side so it works
correctly for interfaces
2003-11-28 17:24:22 +00:00
peter
51384ca53c * register calling is left-right
* parameter ordering
  * left-right calling inserts result parameter last
2003-11-23 17:05:15 +00:00
peter
f663d2488f * cross unit inlining fixed 2003-11-10 22:02:52 +00:00
peter
a3c14e9c2d * procvar default value support 2003-11-10 19:09:29 +00:00
peter
25bf6452b4 * fixed calling classmethod for other object from classmethod 2003-11-06 15:54:32 +00:00
peter
9168d87b35 * use explicit typecast when generating the high value 2003-11-01 16:17:48 +00:00
peter
b34b0141d5 * support creating classes using <class of tobject>.create 2003-10-31 15:52:58 +00:00
peter
19727a3609 * don't search for overloads in parents for constructors 2003-10-30 16:23:13 +00:00
florian
6a06df943b * fixed passing of dyn. arrays to open array parameters 2003-10-29 22:01:20 +00:00
peter
4a1ecb07d1 * splitted buildderef and buildderefimpl to fix interface crc
calculation
2003-10-23 14:44:07 +00:00
peter
6878c55c80 * write derefdata in a separate ppu entry 2003-10-22 20:39:59 +00:00
peter
aaf9043988 * only search for overloaded constructors in classes 2003-10-21 18:17:02 +00:00
peter
a57d25b3ed * also search in parents for overloads when calling a constructor 2003-10-21 15:14:55 +00:00
peter
303b5252e4 * removed is_visible_for_proc
* search also for class overloads when finding interface
    implementations
2003-10-13 14:05:12 +00:00
daniel
b2343f4b16 * Register allocator splitted, ans abstract now 2003-10-09 21:31:37 +00:00
florian
8fcfcc6606 * fixed constructor call in class methods 2003-10-09 15:00:13 +00:00
peter
95f132db3d * set_varstate cleanup 2003-10-08 19:19:45 +00:00
peter
e720d73bd9 * compare_paras() has a parameter to ignore hidden parameters
* cross unit overload searching ignores hidden parameters when
    comparing parameter lists. Now function(string):string is
    not overriden with procedure(string) which has the same visible
    parameter list
2003-10-07 21:14:32 +00:00
peter
da9f5e2319 * c style array of const generates callparanodes
* varargs paraloc fixes
2003-10-05 21:21:52 +00:00
peter
d3e0bca919 * don't check for abstract methods when the constructor is called
by inherited
  * fix private member error instead of wrong number of parameters
2003-10-05 12:54:17 +00:00
florian
538164aa0a * fixed TP 6.0 styled inherited call; fixes IDE with 1.1 2003-10-04 19:00:52 +00:00
peter
3a92a2a25a * parameter alignment fixes 2003-10-03 22:00:33 +00:00
peter
9f2ec4dabd * fix IE when callnode was firstpassed twice 2003-10-03 14:44:38 +00:00
peter
00801693bb * protected visibility fixes 2003-10-02 21:13:46 +00:00
peter
70fe77ca7c * procinfo unit contains tprocinfo
* cginfo renamed to cgbase
  * moved cgmessage to verbose
  * fixed ppc and sparc compiles
2003-10-01 20:34:48 +00:00
peter
2c4df4364e * fix check that filedef needs var para 2003-09-28 21:44:55 +00:00
peter
99bb20747e * parent framepointer changed to hidden parameter
* tloadparentfpnode added
2003-09-28 17:55:03 +00:00
peter
2392f28675 * parameter fixes 2003-09-25 21:28:00 +00:00
peter
8af51ea6d3 * locals and paras are allocated in the code generation
* tvarsym.localloc contains the location of para/local when
    generating code for the current procedure
2003-09-23 17:56:05 +00:00
peter
76a53a375d * varspez in calls to push_addr_param 2003-09-16 16:17:01 +00:00
peter
b9d09a4e5c * preparations for different default calling conventions
* various RA fixes
2003-09-07 22:09:34 +00:00
florian
f3e9e7a24f * fixed web bug #2669
* cosmetic fix in printnode
  * tobjectdef.gettypename implemented
2003-09-06 22:27:08 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
peter
f86df421ce * only check for size matches when parameter is enum,ord,float 2003-08-23 18:42:57 +00:00
peter
6731abb0db * fixed some reported bugs 2003-08-10 17:25:23 +00:00
Jonas Maebe
a783aea0b9 * fixed bogus abstract method warnings 2003-07-25 09:54:57 +00:00
peter
bfb8ae2151 * sym,def resolving partly rewritten to support also parent objects
not directly available through the uses clause
2003-06-25 18:31:23 +00:00
Jonas Maebe
404d344d92 * lots of newra fixes (need getfuncretparaloc implementation for i386)!
* renamed all_intregisters to volatile_intregisters and made it
    processor dependent
2003-06-17 16:34:44 +00:00
Jonas Maebe
75b147ba60 * fixed revious commit 2003-06-15 16:47:33 +00:00
Jonas Maebe
4e7fac9e7e * callparatemp fix: if a threadvar is a parameter, that paramter also
does a call
2003-06-15 15:10:57 +00:00
peter
0dceec9a64 * current_procdef removed, use current_procinfo.procdef instead 2003-06-13 21:19:30 +00:00
Jonas Maebe
10eb92c546 * optimized assignments with on the right side a function that returns
an ansi- or widestring
2003-06-08 20:01:53 +00:00
Jonas Maebe
8e09d78f79 + ability to change the location of a ttempref node with changelocation()
method. Useful to use instead of copying the contents from one temp to
    another
  + some shortstring optimizations in tassignmentnode that avoid some
    copying (required some shortstring optimizations to be moved from
    resulttype to firstpass, because they work on callnodes and string
    addnodes are only changed to callnodes in the firstpass)
  * allow setting/changing the funcretnode of callnodes after the
    resulttypepass has been done, funcretnode is now a property
  (all of the above should have a quite big effect on callparatemp)
2003-06-08 18:27:15 +00:00
peter
563e8d205f * creating class with abstract call checking fixed
* there will be only one warning for each class, the methods
    are listed as hint
2003-06-08 11:42:33 +00:00
peter
e7975c7592 * re-resolving added instead of reloading from ppu
* tderef object added to store deref info for resolving
2003-06-07 20:26:32 +00:00
peter
4d67ae9f31 * fix check for procedure without parameters
* calling constructor as member will not allocate memory
2003-06-03 21:05:48 +00:00
daniel
41e0bc4cec * Register allocator finished 2003-06-03 13:01:59 +00:00
peter
047a066711 * procinlinenode removed
* aktexit2label removed, fast exit removed
  + tcallnode.inlined_pass_2 added
2003-05-26 21:17:17 +00:00
peter
072a55b73e * methodpointer self pushing fixed 2003-05-25 11:34:17 +00:00
peter
b1369666c4 * inline fixes 2003-05-25 08:59:16 +00:00
Jonas Maebe
527153658e * added missing firstpass for callparatemp code 2003-05-24 17:16:37 +00:00
peter
8ff5792776 * remove some unit dependencies
* current_procinfo changes to store more info
2003-05-23 14:27:35 +00:00
Jonas Maebe
56b4360422 * fixed callparatemp for ansi/widestring and interfacecoms 2003-05-17 14:05:58 +00:00
Jonas Maebe
cb279b2029 * changed tt_persistant to tt_persistent :)
* tempcreatenode now doesn't accept a boolean anymore for persistent
    temps, but a ttemptype, so you can also create ansistring temps etc
2003-05-17 13:30:08 +00:00
peter
abca40f041 * regvar fixes 2003-05-16 14:33:31 +00:00
Jonas Maebe
bfd98ec80d * fixed callparatemp so it works with vs_var, vs_out and formal const
parameters
2003-05-14 19:35:50 +00:00
peter
b52ba06662 * constructors return in register 2003-05-13 20:53:41 +00:00
peter
a467b84faa * fixed various crashes 2003-05-13 15:18:49 +00:00
peter
26d78ff5c9 * moved implicit exception frame from ncgutil to psub
* constructor/destructor helpers moved from cobj/ncgutil to psub
2003-05-11 21:37:03 +00:00
peter
15b0132f6f * tloadnode does not support objectsymtable,withsymtable anymore
* withnode cleanup
  * direct with rewritten to use temprefnode
2003-05-11 14:45:12 +00:00
peter
1a2eedd767 * self moved to hidden parameter
* removed hdisposen,hnewn,selfn
2003-05-09 17:47:02 +00:00
peter
e2cbae0ff1 * vs_hidden replaced by is_hidden boolean 2003-05-05 14:53:16 +00:00
peter
60978ba89c * aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
  * procinfo will now be stored in current_module so it can be
    cleaned up properly
  * gen_main_procsym changed to create_main_proc and release_main_proc
    to also generate a tprocinfo structure
  * fixed unit implicit initfinal
2003-04-27 11:21:32 +00:00
Jonas Maebe
b19a9cfc0a * do callparatemp stuff only after the parameters have been firstpassed,
because some nodes are turned into calls during the firstpass
2003-04-27 09:08:44 +00:00
peter
7f14891d66 * aktprocdef cleanup, aktprocdef is now always nil when parsing
a new procdef declaration
  * aktprocsym removed
  * lexlevel removed, use symtable.symtablelevel instead
  * implicit init/final code uses the normal genentry/genexit
  * funcret state checking updated for new funcret handling
2003-04-27 07:29:50 +00:00
peter
f4b818fc1d * removed funcretn,funcretsym, function result is now in varsym
and aliases for result and function name are added using absolutesym
  * vs_hidden parameter for funcret passed in parameter
  * vs_hidden fixes
  * writenode changed to printnode and released from extdebug
  * -vp option added to generate a tree.log with the nodetree
  * nicer printnode for statements, callnode
2003-04-25 20:59:33 +00:00
peter
c21ca3dfa0 + added currency support based on int64
+ is_64bit for use in cg units instead of is_64bitint
  * removed cgmessage from n386add, replace with internalerrors
2003-04-23 20:16:03 +00:00
peter
32d79d4f80 * fix warning for calling constructor inside constructor 2003-04-23 13:21:06 +00:00
florian
0284016ee9 * fixed several issues with powerpc
+ applied a patch from Jonas for nested function calls (PowerPC only)
  * ...
2003-04-23 12:35:34 +00:00
peter
47489f2376 * firstpass uses expectloc
* checks if there are differences between the expectloc and
    location.loc from secondpass in EXTDEBUG
2003-04-22 23:50:22 +00:00
peter
8edbb7afed * fix insert_typeconv to handle new varargs which don't have a
paraitem set
2003-04-22 09:53:33 +00:00
peter
1bfa0a6ba3 * don't firstpass typen 2003-04-11 16:02:05 +00:00
peter
d6838c82b4 * support subscript,vec for setting methodpointer varstate 2003-04-11 15:51:04 +00:00
peter
8da3f59d32 * vs_hidden released 2003-04-10 17:57:52 +00:00
Jonas Maebe
ffb79851e6 * more vs_invisible fixes 2003-04-07 11:58:22 +00:00
Jonas Maebe
a4af1a61e1 * fixed VS_HIDDEN for high parameter so it works again 2003-04-07 10:40:21 +00:00
peter
6a16389f67 * moved generic code from n386cal to ncgcal, i386 now also
uses the generic ncgcal
2003-04-04 15:38:56 +00:00
peter
07f1898c68 * fix missing self setting for method to procvar conversion in
tp_procvar mode
2003-03-17 18:54:23 +00:00
peter
830ea4e876 * support DefaultHandler and anonymous inheritance fixed
for message methods
2003-03-17 16:54:41 +00:00
peter
ec66760702 * store symoptions also for procdef
* check symoptions (private,public) when calculating possible
    overload candidates
2003-03-17 15:54:22 +00:00
daniel
86bcea6ef5 * Code generator converted to new register notation
- Horribily outdated todo.txt removed
2003-02-19 22:00:14 +00:00
peter
34de6782a5 * convert_l3 convertlevel added. This level is used for conversions
where information can be lost like converting widestring->ansistring
    or dword->byte
2003-01-16 22:13:51 +00:00
peter
00e2ee165b * merged methodpointer fixes from 1.0.x 2003-01-15 01:44:32 +00:00
peter
970f5d9112 * only check for auto inherited in objectsymtable 2003-01-12 17:52:07 +00:00
peter
23f6b91c4a * extended information about overloaded candidates when compiled
with EXTDEBUG
2003-01-09 21:45:46 +00:00
Jonas Maebe
ed5a4a6977 * fixed check for whether or not a high parameter was already generated
* no type checking/conversions for invisible parameters
2002-12-26 18:24:33 +00:00
florian
c7ca2ff901 + some stuff for the new hidden parameter handling added 2002-12-15 22:50:00 +00:00
peter
772d7147cd * give sign difference between ordinals a small penalty. This is
needed to get word->[longword|longint] working
2002-12-15 21:34:15 +00:00
florian
1da30f2610 * tcallnode.paraitem introduced, all references to defcoll removed 2002-12-15 21:30:12 +00:00
peter
5ebf9afd63 * fix crash with default parameters 2002-12-15 20:59:58 +00:00
peter
a2a1a36e83 * ignore vs_hidden parameters when choosing overloaded proc 2002-12-15 11:26:02 +00:00
peter
d611c25599 * tcallnode.det_resulttype rewrite, merged code from nice_ncal and
the old code. The new code collects the information about possible
    candidates only once resultting in much less calls to type compare
    routines
2002-12-11 22:42:28 +00:00
carl
081a4aab35 * 3% memory optimization
* changed some types
  + added type checking with different size for call node and for
     parameters
2002-12-07 14:27:07 +00:00
peter
dc66eafb0b * merged cdecl and array fixes 2002-12-06 17:51:09 +00:00
peter
cab4c8879f * only compile cs_fp_emulation support when cpufpuemu is defined
* define cpufpuemu for m68k only
2002-12-06 16:56:57 +00:00
peter
1b116848d8 * cdecl array of const fixes 2002-11-27 20:04:38 +00:00
peter
67153fd9a1 * the never ending story of tp procvar hacks 2002-11-27 15:33:46 +00:00
peter
1ba12c259e * fixed inlinetree parsing in det_resulttype 2002-11-27 02:31:17 +00:00
carl
6a52e7a9e5 - removed the invalid if <> checking (Delphi is strange on this)
+ implemented abstract warning on instance creation of class with
    abstract methods.
 * some error message cleanups
2002-11-25 18:43:31 +00:00
peter
f3fc72095f * splitted defbase in defutil,symutil,defcmp
* merged isconvertable and is_equal into compare_defs(_ext)
  * made operator search faster by walking the list only once
2002-11-25 17:43:16 +00:00
peter
a496dbe1ff * pass proccalloption to ret_in_xxx and push_xxx functions 2002-11-18 17:31:54 +00:00
peter
bfd72ad5d5 * merged changes from 1.0.7 up to 04-11
- -V option for generating bug report tracing
    - more tracing for option parsing
    - errors for cdecl and high()
    - win32 import stabs
    - win32 records<=8 are returned in eax:edx (turned off by default)
    - heaptrc update
    - more info for temp management in .s file with EXTDEBUG
2002-11-15 01:58:45 +00:00
carl
ed1a28dcdc * var parameter checking for classes and interfaces in Delphi mode 2002-10-14 18:20:30 +00:00
peter
a1b570bc48 * fixed limit checking for qword 2002-10-06 21:02:17 +00:00
peter
ebbf4d8d14 * Write unknwon compiler proc using Comment and only in Extdebug 2002-10-05 15:15:45 +00:00
carl
67486c96c3 * fixes for Delphi 6 compilation
(warning : Some features do not work under Delphi)
2002-10-05 12:43:23 +00:00
peter
9d0437f8aa * support inherited; support for overload as it is handled by
delphi. This is only for delphi mode as it is working is
    undocumented and hard to predict what is done
2002-10-05 00:48:57 +00:00
peter
cea50f7185 * add argument to equal_paras() to support default values or not 2002-09-16 14:11:12 +00:00
peter
6d0e34fa5e * don't have strict var parameter checking for procedures in the
system unit
2002-09-15 17:49:59 +00:00
peter
ab536bffc2 * don't allow convertable parameters for var and out parameters in
delphi and tp mode
2002-09-09 19:30:34 +00:00
peter
dcd9e0107c * old logs removed and tabs fixed 2002-09-07 15:25:00 +00:00
carl
6c2bede5a8 * second part bug report 1996 fix, testrange in cordconstnode
only called if option is set (also make parsing a tiny faster)
2002-09-07 12:16:03 +00:00
peter
f5a4b06b8a * fixed old callnode.det_resulttype code
* old ncal code is default again
2002-09-05 14:53:41 +00:00
daniel
c2fcc297ad * Small bugfix for procdef selection 2002-09-03 21:32:49 +00:00
daniel
d5870e8075 * Activated new ncal code 2002-09-03 19:27:22 +00:00
daniel
b0364566d1 * Make Tprocdef.defs protected 2002-09-03 16:26:26 +00:00
daniel
f4c6d762fd - write_access fields removed in favor of a flag 2002-09-01 13:28:37 +00:00
peter
8ee2462ba4 * remove debug line
* containself methods can be called directly
2002-09-01 12:14:15 +00:00
daniel
4b82d30953 * Removed sets from Tcallnode.det_resulttype
+ Added read/write notifications of variables. These will be usefull
   for providing information for several optimizations. For example
   the value of the loop variable of a for loop does matter is the
   variable is read after the for loop, but if it's no longer used
   or written, it doesn't matter and this can be used to optimize
   the loop code generation.
2002-09-01 08:01:16 +00:00
peter
770b338833 * also firstpass funcretrefnode if available. This was breaking the
asnode compilerproc code
2002-08-23 16:13:16 +00:00
daniel
ba29715c7a * Tcallnode.det_resulttype rewritten 2002-08-20 10:31:26 +00:00
peter
91b49914f6 * More fixes for cross unit inlining, all tnodes are now implemented
* Moved pocall_internconst to po_internconst because it is not a
    calling type at all and it conflicted when inlining of these small
    functions was requested
2002-08-19 19:36:42 +00:00
florian
4144773f01 * result type handling in tcgcal.pass_2 overhauled
* better tnode.dowrite
  * some ppc stuff fixed
2002-08-17 22:09:43 +00:00
florian
e313bab4ff * first part of procinfo rewrite 2002-08-17 09:23:33 +00:00
carl
745efb2c47 * issameref() to test if two references are the same (then emit no opcodes)
+ ret_in_reg to replace ret_in_acc
    (fix some register allocation bugs at the same time)
  + save_std_register now has an extra parameter which is the
    usedinproc registers
2002-08-16 14:24:57 +00:00
florian
59abf2555b * types.pas renamed to defbase.pas because D6 contains a types
unit so this would conflicts if D6 programms are compiled
  + Willamette/SSE2 instructions to assembler added
2002-07-20 11:57:52 +00:00
daniel
399036f1c2 * State tracker work
* The whilen and repeatn are now completely unified into whilerepeatn. This
  allows the state tracker to change while nodes automatically into
  repeat nodes.
* Resulttypepass improvements to the notn. 'not not a' is optimized away and
  'not(a>b)' is optimized into 'a<=b'.
* Resulttypepass improvements to the whilerepeatn. 'while not a' is optimized
  by removing the notn and later switchting the true and falselabels. The
  same is done with 'repeat until not a'.
2002-07-19 11:41:34 +00:00
florian
c3f4220f3b * readded removed changes 2002-07-15 18:03:14 +00:00
daniel
eeae0e4c00 + Added the beginning of a state tracker. This will track the values of
variables through procedures and optimize things away.
2002-07-14 18:00:43 +00:00
florian
336808f6c3 * start of the new generic parameter handling 2002-07-11 14:41:27 +00:00
florian
479a745096 * first x86-64 patches 2002-07-04 20:43:00 +00:00
peter
68ce5a00e5 * cg64 patch
* basics for currency
  * asnode updates for class and interface (not finished)
2002-07-01 16:23:52 +00:00
peter
06ebac4e27 * readded missing revisions 2002-05-18 13:34:04 +00:00
carl
21b3a10f02 + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ try to fix temp allocation (still in ifdef)
+ generic constructor calls
+ start of tassembler / tmodulebase class cleanup
2002-05-16 19:46:34 +00:00
peter
2992e1819c * removed old logs and updated copyright year 2002-05-14 19:34:38 +00:00
peter
4dcd96747e * moved entry and exitcode to ncgutil and cgobj
* foreach gets extra argument for passing local data to the
    iterator function
  * -CR checks also class typecasts at runtime by changing them
    into as
  * fixed compiler to cycle with the -CR option
  * fixed stabs with elf writer, finally the global variables can
    be watched
  * removed a lot of routines from cga unit and replaced them by
    calls to cgobj
  * u32bit-s32bit updates for and,or,xor nodes. When one element is
    u32bit then the other is typecasted also to u32bit without giving
    a rangecheck warning/error.
  * fixed pascal calling method with reversing also the high tree in
    the parast, detected by tcalcst3 test
2002-05-12 16:53:04 +00:00
peter
cc8c4d7093 * moved more routines from cga/n386util 2002-04-25 20:16:38 +00:00
florian
6bbaa14daf * block nodes within expressions shouldn't release the used registers,
fixed using a flag till the new rg is ready
2002-04-25 20:15:39 +00:00
carl
87aa88e9b7 + generic FPC_CHECKPOINTER
+ first parameter offset in stack now portable
* rename some constants
+ move some cpu stuff to other units
- remove unused constents
* fix stacksize for some targets
* fix generic size problems which depend now on EXTEND_SIZE constant
2002-04-20 21:32:23 +00:00
peter
c7428a9e4a * allow passing the address of a procedure to a formal parameter
in delphi mode
2002-04-16 16:09:08 +00:00
peter
3bcfe33002 * fixed stackcheck that would be called recursively when a stack
error was found
  * generic changeregsize(reg,size) for i386 register resizing
  * removed some more routines from cga unit
  * fixed returnvalue handling
  * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
2002-04-15 19:44:18 +00:00
carl
5befcda7e5 + target_info.size_of_pointer -> pointer_Size 2002-04-15 18:57:22 +00:00
peter
5b242f7741 * tlocation,treference update
* LOC_CONSTANT added for better constant handling
  * secondadd splitted in multiple routines
  * location_force_reg added for loading a location to a register
    of a specified size
  * secondassignment parses now first the right and then the left node
    (this is compatible with Kylix). This saves a lot of push/pop especially
    with string operations
  * adapted some routines to use the new cg methods
2002-04-02 17:11:27 +00:00
Jonas Maebe
7fb55bf4e4 + a_loadfpu_* and a_loadmm_* methods in tcg
* register allocation is now handled by a class and is mostly processor
    independent (+rgobj.pas and i386/rgcpu.pas)
  * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  * some small improvements and fixes to the optimizer
  * some register allocation fixes
  * some fpuvaroffset fixes in the unary minus node
  * push/popusedregisters is now called rg.save/restoreusedregisters and
    (for i386) uses temps instead of push/pop's when using -Op3 (that code is
    also better optimizable)
  * fixed and optimized register saving/restoring for new/dispose nodes
  * LOC_FPU locations now also require their "register" field to be set to
    R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  - list field removed of the tnode class because it's not used currently
    and can cause hard-to-find bugs
2002-03-31 20:26:33 +00:00
carl
c50d06d4de * avoid crash with inline routines 2002-03-30 23:02:42 +00:00
peter
fd2ad837e2 * implicit result variable generation for assembler routines
* removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
2002-01-24 18:25:48 +00:00
Jonas Maebe
2b3898aeff * adapted ranges of native types to int64 (e.g. high cardinal is no
longer longint($ffffffff), but just $fffffff in psystem)
  * small additional fix in 64bit rangecheck code generation for 32 bit
    processors
  * adaption of ranges required the matching talgorithm used for selecting
    which overloaded procedure to call to be adapted. It should now always
    select the closest match for ordinal parameters.
  + inttostr(qword) in sysstr.inc/sysstrh.inc
  + abs(int64), sqr(int64), sqr(qword) in systemh.inc/generic.inc (previous
    fixes were required to be able to add them)
  * is_in_limit() moved from ncal to types unit, should always be used
    instead of direct comparisons of low/high values of orddefs because
    qword is a special case
2002-01-24 12:33:52 +00:00
peter
2e96721c20 * fixed path appending for lib 2002-01-19 11:57:05 +00:00
peter
60d2ddbbd5 * protected/private symbols parsing fixed 2001-12-31 16:59:41 +00:00
Jonas Maebe
479f1a5ce9 * fixed to my previous patch: the hightree must always be converted to a
longint
2001-12-11 13:21:36 +00:00
Jonas Maebe
8ddb738e07 * gen_high_tree now uses an inline node of type in_high_x in most cases
so that it doesn't duplicate any code anymore from ninl.pas (and
    dynamic array support was still missing)
2001-12-10 14:28:47 +00:00
peter
f20cbc5edf * require overload for cross object overloading 2001-11-20 18:49:43 +00:00
peter
2dc60c9fed * use cp_value_equal_const instead of cp_all 2001-11-18 20:18:54 +00:00
peter
faf78ea813 * overloading supported in child classes
* fixed parsing of classes with private and virtual and overloaded
    so it is compatible with delphi
2001-11-18 18:43:13 +00:00
peter
887f6ba34c * removed obsolete chainprocsym and test_procsym code 2001-11-02 23:16:50 +00:00
peter
d2e1952377 * procsym definition rewrite 2001-11-02 22:58:00 +00:00
peter
ac400051bd * allow assignment of overloaded procedures to procvars when we know
which procedure to take
2001-10-28 17:22:25 +00:00
peter
e37dbf904d * calling convention rewrite 2001-10-25 21:22:32 +00:00
Jonas Maebe
42002892ab * fixed bug with using procedures as procvar parameters in TP/Delphi mode 2001-10-13 09:01:14 +00:00
peter
68bc48c96a * nested inline fix (merged) 2001-10-12 16:04:32 +00:00
peter
43dea5a35f * move class of definitions into type section for delphi 2001-09-02 21:12:06 +00:00
Jonas Maebe
a41949db8e * fixed docompare for the fields I added to tcallnode in my previous
commit
  * removed nested comment warning
2001-08-30 15:39:59 +00:00
Jonas Maebe
105b7ae809 + new createinternres() constructor for tcallnode to support setting a
custom resulttype
  * compilerproc typeconversions now set the resulttype from the type
    conversion for the generated call node, because the resulttype of
    of the compilerproc helper isn't always exact (e.g. the ones that
    return shortstrings, actually return a shortstring[x], where x is
    specified by the typeconversion node)
  * ti386callnode.pass_2 now always uses resulttype instead of
    procsym.definition.rettype (so the custom resulttype, if any, is
    always used). Note that this "rettype" stuff is only for use with
    compilerprocs.
2001-08-29 12:18:07 +00:00
Jonas Maebe
fc92c3b336 + compilerproc implementation of most string-related type conversions
- removed all code from the compiler which has been replaced by
    compilerproc implementations (using {$ifdef hascompilerproc} is not
    necessary in the compiler)
2001-08-28 13:24:46 +00:00
florian
9746f4c2d6 * some cg reorganisation
* some PPC updates
2001-08-26 13:35:06 +00:00
Jonas Maebe
fc1b58c22c * moved "reverseparameters" from ninl.pas to ncal.pas
+ support for non-persistent temps in ttempcreatenode.create, for use
    with typeconversion nodes
2001-08-24 13:47:26 +00:00
Jonas Maebe
a6cfe4083a + tempcreate/ref/delete nodes (allows the use of temps in the
resulttype and first pass)
  * made handling of read(ln)/write(ln) processor independent
  * moved processor independent handling for str and reset/rewrite-typed
    from firstpass to resulttype pass
  * changed names of helpers in text.inc to be generic for use as
    compilerprocs + added "iocheck" directive for most of them
  * reading of ordinals is done by procedures instead of functions
    because otherwise FPC_IOCHECK overwrote the result before it could
    be stored elsewhere (range checking still works)
  * compilerprocs can now be used in the system unit before they are
    implemented
  * added note to errore.msg that booleans can't be read using read/readln
2001-08-23 14:28:35 +00:00
florian
7db13ea48f * some bugs fix:
- overload; with external procedures fixed
    - better selection of routine to do an overloaded
      type case
    - ... some more
2001-08-19 21:11:20 +00:00