Commit Graph

154 Commits

Author SHA1 Message Date
Jonas Maebe
6e9a8c9187 * write node flags to log file instead of to stdout
git-svn-id: trunk@23150 -
2012-12-15 22:47:07 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
florian
dd18d0bd4d * write flags in tnode.printnodeinfo
git-svn-id: trunk@22072 -
2012-08-13 14:50:37 +00:00
Jonas Maebe
eedb5c89de * part of r20140, forgot to commit
git-svn-id: trunk@20145 -
2012-01-21 21:16:47 +00:00
florian
6ec0f2549a * factored load node flags out of node flags to gain space
+ implemented iso mode mod, resolves #17685

git-svn-id: trunk@19558 -
2011-10-30 15:14:21 +00:00
florian
111d05c68f o patch by Alexander Shishkin, resolves #20409
* eliminate warnings in compiler (i386 & i368->x86_64) and minor refactorings
    - comment out unused vars and types
    - comment out unneeded comparisons (Longword <=> 0)
    - suppress some "comparison always true|false" warnings
    - tweak visiblity sections

git-svn-id: trunk@19385 -
2011-10-05 20:11:09 +00:00
paul
ee6fe6c4f5 compiler: add unary plus node, search for unary plus operator if a type cannot be handled by compiler, increase ppu version because of node types change
git-svn-id: trunk@16640 -
2010-12-26 12:19:28 +00:00
Jonas Maebe
94d976bc87 * when simplifying ordinal expressions during inlining, keep the resultdef
that was set during the typecheck pass because typeconversion nodes
    may have been optimised away previously and sometimes the resultdef is
    important (e.g. for the value of callparanodes) (mantis #17458)

git-svn-id: trunk@16101 -
2010-10-07 15:08:52 +00:00
Jonas Maebe
1f4d7d6057 * add type symbol names to -vp output (patch by Adriaan van Os, mantis
#15737)

git-svn-id: trunk@14903 -
2010-02-13 16:47:37 +00:00
Jonas Maebe
3660bf7f98 * integrated the transformation of an Objective-C method call into a call
to objc_msgSend* into the callnode. This allows reusing the current
    call node rather than having to create a new one, and is in particular
    necessary because even though the objc_msgSend* functions are declared
    as varargs, you're supposed to typecast them to the function type
    describing the method before calling them (so they should *not* use
    varargs calling conventions!)
  * for the above, a field called fobjcforcedprocname has been added to the
    callnode, which can be set to a string that will be used as the (mangled)
    name of the function to call instead of the mangled name of the procsym
  -> fixes calling obj-c methods with floating point arguments on ppc

git-svn-id: branches/objc@13783 -
2009-10-01 12:05:11 +00:00
Jonas Maebe
ed9656d1e6 Merged revisions 13627-13631,13637-13638,13640,13642-13648,13650-13653,13656-13658,13660,13664-13667,13672-13675,13680,13682,13687 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/trunk

git-svn-id: branches/objc@13697 -
2009-09-12 12:42:38 +00:00
florian
cf215d5097 o patch by Michael V. Denisenko to handle case <string> of (see also #13700)
+ compiler implementation
  + tests

git-svn-id: trunk@13642 -
2009-09-03 20:21:30 +00:00
Jonas Maebe
2799cfd83f + parser-side of objcprotocol() expression to obtain the metaclass
associated with an Objective-C protocol. Code generator part will
    always generate an internalerror currently, because it cannot yet
    be implemented (needs support for generating RTTI for Objective-C
    classes)

git-svn-id: branches/objc@13461 -
2009-07-26 16:03:37 +00:00
Jonas Maebe
92de010fe1 Merged revisions 13218-13347 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/trunk

git-svn-id: branches/objc@13350 -
2009-06-28 16:09:53 +00:00
Jonas Maebe
66c14c8a88 * don't mark classes used in "is"- or "as"-expressions as potentially
instantiated (for wpo)
  * also replace vmt-entries for classes for which we don't have any
    information at all with FPC_ABSTRACTERROR (since that means they
    certainly are not instantiated), except for their published and
    virtual class methods
  * fixed check for published methods in wpo

git-svn-id: trunk@13219 -
2009-05-31 13:52:40 +00:00
Jonas Maebe
b1b9894ae3 * initial Objective-C 1.0 support:
o support for declaring external Objective-C classes (see
      rtl/inc/objcbase.pas), including derived classes
    o support for converting methods of objcclasses into selectors
      (see tests/test/tobjc1.pp)
    o support for loading from/storing to fields of objcclasses
    o support for calling Objective-C methods using regular
      Object Pascal syntax (see tests/test/tobjc1.pp)
    o some things that are known to be not yet working:
      o automatic conversion from ID to objcclasses and back
      o declaring and implementing new objcclasses/methods in Pascal code
      o debug information (objcclasses are currently plain pointers
        as far as the debugger knows)

git-svn-id: branches/objc@13162 -
2009-05-17 13:42:50 +00:00
Jonas Maebe
6165536b5e + added {$modeswitch objectivec1}/-Mobjectivec1 mode switch to enable
the use of Objective-C 1.0 constructs. Because it is a mode switch, it
    can be used cumulatively with every syntax mode. Note that a {$mode xxx}
    statement resets all mode switches as well, so you cannot use the
    -Mobjectivec1 variant if you have such a statement in a unit. This
    modeswitch is currently only enabled for Darwin/PowerPC and Darwin/i386,
    as the backend support is not yet implemented for other platforms.
  + implemented selector() statement that can be used to create an Objective-C
    selector for the message with the specified *constant* name (in the future,
    it will also work for Objective-C method identifiers)
  + added SEL type to the system unit (the selector() statement returns it)
  + added all Objective-C segments to the assembler writers
  + (currently mostly dummy) objc1 unit that is automatically included if the
    {$modeswitch objectivec1} statement is used
  + some tests for the selector() statement

git-svn-id: trunk@12870 -
2009-03-08 18:40:32 +00:00
Jonas Maebe
e5920bc2b8 * delay verbosity changes just like localswitches changes
* store a node's verbosity in the node so that e.g. disabling warnings
    also disables warnings for this node in pass_1
   (the above together fix mantis #12076)
  * save/restore verbosity with {$push}/{$pop} (mantis #12075)
  * if warnings/notes/hints are turned off, also do not count encountered
    ones for the totals (otherwise -Sew cannot be used properly in
    combination with {$warnings off}, because disabled warnings will still
    trigger a compiler error) -- this required adding -vw/-vn/-vh to all
    tests using -Sew/-Sen/-Seh
  - removed some superfluous state saving/restoring from firstpass()

git-svn-id: trunk@12025 -
2008-11-03 21:18:27 +00:00
florian
0a8f621a6b * don't waste a register for inc/dec(<pointer>,const);
git-svn-id: trunk@11812 -
2008-09-21 17:42:53 +00:00
peter
060bdbcb47 * fix writing of goto node to ppu
* replace derefnode with resolveppuidx method that only needs to be
    implemented for nodes referencing other nodes
  * fix IE when a label is not defined in inline function

git-svn-id: trunk@11697 -
2008-09-03 20:46:04 +00:00
florian
369ed493f2 * new node flag nf_modify to mark nodes being read and then written by one load node
* dfa takes care of nf_modify to create better life information
o resolves #11846 and #11849

git-svn-id: trunk@11615 -
2008-08-20 21:35:05 +00:00
Jonas Maebe
84159b3cbb * optimize away unnecessary implicit upcasts to int64 for subtractions
of u32bit values on 32 bit platforms (after the int64 values have 
    already been used for overload selection etc, i.e., semantically
    nothing changes)
  + test which checks that not too many typecasts are optimized away

git-svn-id: trunk@9664 -
2008-01-06 23:30:19 +00:00
Jonas Maebe
742ff35c48 + also optimize assignments from calls to by-reference "results":
o it's a by-reference parameter, but ignore that since it's
      guaranteed to be safe because of the escape analysis
    o it's wrapped in an absolute type conversion -> added
      actualtargetnode method to tnode which digs through that

git-svn-id: trunk@9412 -
2007-12-07 17:58:25 +00:00
peter
4492ee39c5 * remove firstpasscount
git-svn-id: trunk@8656 -
2007-09-26 21:13:32 +00:00
peter
6b8aed593f * remove registers{int/mmx/fpu} from firstpass
* small cleanups of unused variables in firstpass
  * node_resources_fpu() created to get an approximation of the
    required fpu registers
  * for the moment use node_complexity in the CG until the
    node_resource_int() is created

git-svn-id: trunk@8655 -
2007-09-26 21:12:01 +00:00
peter
4525df9ea0 * nf_is_funcret node flag added
* remove ti_is_funcret, use new node flag instead
  * check for funcret node in doreplace instead of funcretsym

git-svn-id: trunk@8578 -
2007-09-20 20:24:30 +00:00
florian
b4da246668 + printnode shortcut for lazy people
git-svn-id: trunk@8501 -
2007-09-16 10:47:28 +00:00
florian
867e00dee3 * backup commit of more dfa stuff
git-svn-id: trunk@7287 -
2007-05-06 10:59:09 +00:00
florian
87bdf13f9f + first draft for dfa
git-svn-id: trunk@7282 -
2007-05-05 20:50:09 +00:00
Jonas Maebe
76b190b723 - removed caretn and related code
git-svn-id: trunk@7257 -
2007-05-04 10:53:25 +00:00
florian
ca8d020231 * some node optimizer stuff cleaned up
git-svn-id: trunk@7104 -
2007-04-15 14:41:00 +00:00
Jonas Maebe
1d96dcc50d * renamed nf_swaped to nf_swapped
git-svn-id: trunk@5818 -
2007-01-05 12:47:22 +00:00
florian
c947295cb8 + ttertiarynode
* traise node refactored using tertiarynode
* more dipatch stuff

git-svn-id: trunk@5215 -
2006-11-03 23:03:31 +00:00
florian
a7b317aa96 + tdataconstnode, implemented for usage in dispatch stuff
git-svn-id: trunk@5208 -
2006-11-03 17:56:47 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
florian
ef7bd58c54 * germanism removed (aktfilepos -> current_filepos)
git-svn-id: trunk@5099 -
2006-10-30 22:37:31 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
florian
3d85bfbf7b * fixed coping of goto/label nodes
git-svn-id: trunk@5053 -
2006-10-29 09:50:39 +00:00
florian
ea69e22044 * fixed tail recursion optimization for code using methodpointerinit/done
git-svn-id: trunk@4896 -
2006-10-14 07:57:25 +00:00
micha
8678d52aeb * avoid warning when pointer points to size 1 data
* fix variantmanager for {$T+}

git-svn-id: trunk@4861 -
2006-10-11 16:40:40 +00:00
florian
02d0ac4c3e + only procedures doing recursive calls are checked for tail recursivity
+ parameters are tested if they are usable with tail recursion removal

git-svn-id: trunk@4853 -
2006-10-10 20:29:48 +00:00
micha
5f353d6fef add warning for arithmetic on untyped pointers
git-svn-id: trunk@4823 -
2006-10-07 19:34:16 +00:00
peter
2f0ce31751 * string concat changed from function to procedure to
allow runtime optimization if the destination is the
    same as a source parameter
  * tassignmentnode now sets aktassignmentnode global that can be used
    to use the left node as a destination parameter and
    skip the assignment
  * disabled all cpu specific shortstr concat/append

git-svn-id: trunk@4770 -
2006-10-02 20:00:06 +00:00
Jonas Maebe
733f559267 * also perform C varargs type conversions for cdecl procedures declared
as "varargs" instead of using an array of const parameter

git-svn-id: trunk@4572 -
2006-09-08 16:04:15 +00:00
Jonas Maebe
b5fe67351e * fixed warning
git-svn-id: trunk@4193 -
2006-07-14 19:37:35 +00:00
Jonas Maebe
03302dc7c4 * fixed support for macpas & and | operators: they only work on booleans
now, and always perform short circuit boolean evaluation (also in {$b+})

git-svn-id: trunk@3745 -
2006-05-30 13:02:36 +00:00
Jonas Maebe
4db6e1ddb8 * moved type conversion of C varargs from tcallnode to
tarrayconstructornode.inset_typeconvs() and fixed them:
    * integers < 32 bit are converted to 32 bit (this was previously
      done in the code generator for some targets, and not for others)
    * currency is also converted to double for targets where currency = int64
    * single is converted to double, except for x86_64 (is at least
      necessary on darwin/ppc, darwin/i386 and linux/i386)
    * enums are converted to 32 bit ints
    * procvars are converted to pointers
    * proper errors are given for various unsupported types
   NOTE: in C, floating point constants are by default double, while in
    FPC they are of type extended. On platforms where extended <> double,
    such constants when passed to C varargs are automatically converted
    to double by default (gives warning). If you want to pass them as
    single or extended or get rid of the warning, use an explicit typecast
  * increased ppu version because of introduction of new node flag
    (nf_cvarargs for tarrayconstructornode)
  * fixed tests/test/cg/tprintf
  * changed tests/test/cg/cdecl/taoc5 to use explicit typecasts for
    floating point constants passed to C varargs functions.

git-svn-id: trunk@2949 -
2006-03-17 22:26:48 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
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: trunk@2932 -
2006-03-16 08:52:22 +00:00
peter
b967ae8307 * support @inherited <method> to get the methodpointer
of <method> in a parent class

git-svn-id: trunk@2526 -
2006-02-11 22:49:00 +00:00