Commit Graph

438 Commits

Author SHA1 Message Date
florian
ea00759588 + final modifier support for methods by Paul Ishenin
-- Zusammenführen von r13887 in ».«:
A    tests/test/tfinal1.pp
U    compiler/msgtxt.inc
U    compiler/msgidx.inc
U    compiler/pdecsub.pas
U    compiler/tokens.pas
U    compiler/symconst.pas
U    compiler/msg/errore.msg
U    compiler/utils/ppudump.pp
-- Zusammenführen von r13890 in ».«:
G    compiler/msgtxt.inc
G    compiler/msgidx.inc
U    compiler/nobj.pas
G    compiler/msg/errore.msg
-- Zusammenführen von r13891 in ».«:
A    tests/test/tfinal2.pp

git-svn-id: trunk@13938 -
2009-10-24 11:48:52 +00:00
Jonas Maebe
fffa66e2f9 * only allow implicit conversions from 0 to NIL in Delphi mode, rather than
from any ordinal constant, and give a warning for this one allowed
    conversion like Kylix does (mantis #14713)
  * this required calling simplify from typecheckpass in ttypeconvnode for
    cord_to_pointer, because this simplification prevents the type checking
    from happening (but the typecheck itself also does that simplification)

git-svn-id: trunk@13919 -
2009-10-22 19:49:08 +00:00
florian
eb433d1bdd * merged sealed and abstract support by Paul Ishenin
-- Zusammenführen von r13884 in ».«:
U    compiler/msgtxt.inc
U    compiler/msgidx.inc
U    compiler/pdecsub.pas
U    compiler/pdecobj.pas
U    compiler/tokens.pas
U    compiler/ppu.pas
U    compiler/symconst.pas
U    compiler/msg/errore.msg
U    compiler/utils/ppudump.pp
-- Zusammenführen von r13885 in ».«:
A    tests/test/tsealed1.pp
A    tests/test/tabstract1.pp
A    tests/test/tsealed2.pp
-- Zusammenführen von r13893 in ».«:
A    tests/test/tsealed3.pp
A    tests/test/tsealed4.pp

git-svn-id: trunk@13908 -
2009-10-18 20:05:29 +00:00
sergei
2fe34085b1 * Missing percent in russian messages, Mantis 14772
git-svn-id: trunk@13834 -
2009-10-10 14:25:06 +00:00
sergei
5e6bc7d36c * Also updated errorr.msg, cp866 encoding is needed for Windows console.
git-svn-id: trunk@13815 -
2009-10-07 17:43:44 +00:00
sergei
337d0b1b21 Updated Russian message file, and changed cp1251 encoding to UTF-8.
git-svn-id: trunk@13814 -
2009-10-07 17:36:27 +00:00
Jonas Maebe
e8216ff397 * changed error about unsupported -Xr option into a warning, because the
Makefiles automatically pass it when cross compiling (mantis #14527)

git-svn-id: trunk@13665 -
2009-09-06 18:50:11 +00:00
marco
32c6253c07 * Last commit broke helpfile/doc compilation. Items should be within description,
not after.

git-svn-id: trunk@13646 -
2009-09-05 12:12:31 +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
florian
e022a86c47 * update of german error message files by Karl-Michael Schindler
git-svn-id: trunk@13506 -
2009-08-09 16:35:09 +00:00
Jonas Maebe
aba66582a8 * corrected the description of the option_only_one_source_support warning:
only the last source file specified will be compiled, not the first one
  * also print out both the old and the new source file name to be compiled
    when showing that message (to more easily find where the error is)
  * give an error if an unknown parameter is used, instead of silently
    ignoring it

git-svn-id: trunk@13429 -
2009-07-23 13:48:27 +00:00
Jonas Maebe
97072cd21a * corrected the description of the -Xr parameter
git-svn-id: trunk@13428 -
2009-07-23 13:36:57 +00:00
Jonas Maebe
52c6f14de5 * do not allow local type definitions such as string[1] and "file of byte"
inside parameter lists and function results (fixes second problem
    reported in mantis #14104, see also
    http://wiki.freepascal.org/User_Changes_Trunk#Local_type_definitions_in_parameter_lists
    )

git-svn-id: trunk@13372 -
2009-07-08 20:21:37 +00:00
Jonas Maebe
c6733ed9a5 * disallow placing fields after method/property definitions, because this
can create ambiguities for the parser in case the field names also exist
    as modifiers (TP- and Delphi-compatible, mantis #13971) + tests
  * fixed tests that broke because of this change

git-svn-id: trunk@13334 -
2009-06-27 12:59:46 +00:00
Jonas Maebe
5c006b9b86 * enable the directory cache by default starting with the first lookup
(fixes mantis #13756)
  + added -Fd command line parameter to disable the directory cache

git-svn-id: trunk@13325 -
2009-06-26 14:55:31 +00:00
Jonas Maebe
b05992b8a2 * stabs -> Stabs
* dwarf/Dwarf -> DWARF

git-svn-id: trunk@13287 -
2009-06-18 09:10:35 +00:00
florian
22745d74a8 o Message file update by Karl-Michael Schindler
* Updates of error message files, mainly the two German files and a small typo correction of the English 

git-svn-id: trunk@13286 -
2009-06-17 21:30:18 +00:00
florian
d15e6bbe2a + -vs is shown in the help screen, resolves #13958
* -v options slightly reordered so they are easier to read

git-svn-id: trunk@13257 -
2009-06-11 16:15:31 +00:00
Jonas Maebe
7bff50becd * give an error message when the specified wpo feedback input file
is a directory
  * always quote wpo feedback file name in messages

git-svn-id: trunk@13242 -
2009-06-06 12:39:09 +00:00
Jonas Maebe
bbfd8812c9 * small fixes from Karl-Michael Schindler (mantis #13048)
git-svn-id: trunk@13165 -
2009-05-17 14:50:44 +00:00
Jonas Maebe
84cdb246fa * copyright in comments updated (from mantis #13048)
git-svn-id: trunk@13164 -
2009-05-17 14:42:17 +00:00
yury
c4439e4e39 * Properly write 64-bit relocations into .reloc section.
* Warning when 64-bit object file contains 32-bit absolute relocations. In such case an executable image can be loaded into lower 4Gb of address space only.

git-svn-id: trunk@13110 -
2009-05-07 10:46:56 +00:00
yury
2b3a54cec0 * Allow usage of internal linker when dwarf debug info is used.
git-svn-id: trunk@13094 -
2009-05-04 10:19:54 +00:00
Jonas Maebe
40247d2d87 * give an error when the typeinfo() function is called for an enumeration
whose base is not 0, or that has jumps in its value range (manits #9551)

git-svn-id: trunk@12960 -
2009-03-22 20:54:49 +00:00
Jonas Maebe
d61a09debf * assigment -> assignment in explanation of warning about uninitialized
variables

git-svn-id: trunk@12940 -
2009-03-21 16:15:20 +00:00
Jonas Maebe
41dcda600c * disabled the internal linker when using DWARF debug info (it doesn't
work correctly with DWARF)
  * only force the internal linker for STABS when generating relocatable
    output (rather than for all debugging formats)

git-svn-id: trunk@12917 -
2009-03-19 09:01:29 +00:00
Jonas Maebe
c6470a75e7 * do not disable smart linking when using DWARF debug information on Darwin,
because there it does work correctly
  * print a note if smart linking is disabled due to using DWARF

git-svn-id: trunk@12896 -
2009-03-15 12:16:45 +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
Tomas Hajny
29f0a1096c * add reference to the bug tracker rather than just an e-mail address
git-svn-id: trunk@12833 -
2009-02-28 23:13:36 +00:00
florian
d511f8d84e * year of copyright updated
git-svn-id: trunk@12789 -
2009-02-25 15:44:20 +00:00
florian
acb06dac1b + Wp<Controllertype> support for arm and avr
git-svn-id: trunk@12664 -
2009-02-02 20:16:25 +00:00
florian
3430f90b2c * updated german message files from Karl-Michael Schindler
git-svn-id: trunk@12547 -
2009-01-13 21:39:42 +00:00
Jonas Maebe
b73ed1587a * added warning to stack checking option
* clarified that -Cs only guarantees setting the stack *checking*
    size, not necessarily the stack size

git-svn-id: trunk@12528 -
2009-01-08 18:42:24 +00:00
Jonas Maebe
423ee926c2 * verify during parameter parsing that -gc and -pg are implemented/
supported for the chosen target platform

git-svn-id: trunk@12451 -
2008-12-28 15:53:15 +00:00
Jonas Maebe
e54aed98a4 * fixed some small errors/inconsistencies in the wpo messages
git-svn-id: trunk@12450 -
2008-12-28 10:10:16 +00:00
florian
7d849d312b + added missing LaTeX statement for wpo error messages
git-svn-id: trunk@12449 -
2008-12-28 09:51:27 +00:00
Jonas Maebe
3216e8c7bc * mark produced object files as "does not require executable stack" by
default for Linux (overridable using -WX switch) (mantis #11563)

git-svn-id: trunk@12356 -
2008-12-12 16:26:25 +00:00
Jonas Maebe
1597aac6d2 * first search for gnm and only then for nm
* fixed error message in case the output of (g)nm/objdump can't be parsed

git-svn-id: trunk@12349 -
2008-12-12 13:03:27 +00:00
Jonas Maebe
060d81b8fa Merged revisions 11878,11881-11882,11889,11891-11893,11895,11899-11902,11935,11938,12212,12304,12308-12310,12316,12330-12332,12334,12339-12340 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/branches/wpo

........
r11878 | jonas | 2008-10-11 02:25:18 +0200 (Sat, 11 Oct 2008) | 19 lines

  + initial implementation of whole-program optimisation framework
  + implementation of whole-program devirtualisation
  o use:
     a) generate whole-program optimisation information (no need
        to completely compile the program and all of its units
        with -OW/-FW, only the main program is sufficient)
      fpc -OWdevirtcalls -FWmyprog.wpo myprog
     b) use it to optimise the program
      fpc -B -Owdevirtcalls -Fwmyprog.wpo myprog
     (the -B is not required, but only sources recompiled during
      the second pass will actually be optimised -- if you want,
      you can even rebuild the rtl devirtualised for a particular 
      program; and these options can obviously also be used         
      together with regular optimisation switches)
  o warning:
    - there are no checks yet to ensure that you do not use 
      units optimised for a particular program with another
      program (or with a changed version of the same program)

........
r11881 | jonas | 2008-10-11 19:35:52 +0200 (Sat, 11 Oct 2008) | 13 lines

  * extracted code to detect constructed class/object types from
    tcallnode.gen_vmt_tree into its own method to avoid clutter
  * detect x.classtype.create constructs (with classtype = the
    system.tobject.classtype method), and treat them as if a
    "class of x" has been instantiated rather than a
    "class of tobject". this required storing the instantiated
    classrefs in their own array though, because at such a
    point we don't have a "class of x" tdef available (so
    now "x", and all other defs instantiated via a classref,
    are now stored as tobjectdefs in a separate array)
  + support for devirtualising class methods (including
    constructors)

........
r11882 | jonas | 2008-10-11 20:44:02 +0200 (Sat, 11 Oct 2008) | 7 lines

  + -Owoptvmts whole program optimisation which replaces vmt entries
    with method names of child classes in case the current class'
    method can never be called (e.g., because this class is never
    instantiated). As a result, such methods can then be removed
    by dead code removal/smart linking (not much effect for either
    the compiler, lazarus or a trivial lazarus app though).

........
r11889 | jonas | 2008-10-12 14:29:54 +0200 (Sun, 12 Oct 2008) | 2 lines

  * some comment fixes

........
r11891 | jonas | 2008-10-12 18:49:13 +0200 (Sun, 12 Oct 2008) | 4 lines

  * fixed twpofilereader.getnextnoncommentline() when reusing a previously
    read line
  * fixed skipping of unnecessary wpo feedback file sections

........
r11892 | jonas | 2008-10-12 23:42:43 +0200 (Sun, 12 Oct 2008) | 31 lines

  + symbol liveness wpo information extracted from smartlinked programs
    (-OW/-Owsymbolliveness)
  + use symbol liveness information to improve devirtualisation (don't
    consider classes created in code that has been dead code stripped).
    This requires at least two passes of using wpo (first uses dead code
    info to locate classes that are constructed only in dead code,
    second pass uses this info to potentially further devirtualise).
    I.e.:
     1) generate initial liveness and devirtualisation feedback
       fpc -FWtt.wpo -OWall tt.pp -Xs- -CX -XX
     2) use previously generated feedback, and regenerate new feedback
        based on this (i.e., disregard classes created in dead code)
       fpc -FWtt-1.wpo -OWall -Fwtt.wo -Owall tt.pp -Xs- -CX -XX
     3) use the newly generated feedback (in theory, it is possible
        that even more opportunities pop up afterwards; you can
        continue until the program does not get smaller anymore)
       fpc -Fwtt-1.wpo -Owall tt.pp -CX -XX
  * changed all message() to cgmessage() calls so the set codegenerror
  * changed static fsectionhandlers field to a regular field called
    fwpocomponents
  * changed registration of wpocomponents: no longer happens in the
    initialization section of their unit, but in the InitWpo routine
    (which has been moved from the woinfo to the wpo unit). This way
    you can register different classes based on the target/parameters.
  + added static method to twpocomponentbase for checking whether
    the command line parameters don't conflict with the requested
    optimisations (e.g. generating liveness info requires that
    smartlinking is turned on)
  + added static method to twpocomponentbase to request the
    section name

........
r11893 | jonas | 2008-10-12 23:53:57 +0200 (Sun, 12 Oct 2008) | 3 lines

  * fixed comment error (twpodeadcodeinfo keeps a list of live,
    not dead symbols)

........
r11895 | jonas | 2008-10-13 00:13:59 +0200 (Mon, 13 Oct 2008) | 2 lines

  + documented -OW<x>, -Ow<x>, -FW<x> and -Fw<x> wpo parameters

........
r11899 | jonas | 2008-10-14 22:14:56 +0200 (Tue, 14 Oct 2008) | 2 lines

  * replaced hardcoded string with objdumpsearchstr constant

........
r11900 | jonas | 2008-10-14 22:15:25 +0200 (Tue, 14 Oct 2008) | 2 lines

  * reset wpofeedbackinput and wpofeedbackoutput in wpodone

........
r11901 | jonas | 2008-10-14 22:16:07 +0200 (Tue, 14 Oct 2008) | 2 lines

  * various additional comments and comment fixes

........
r11902 | jonas | 2008-10-15 18:09:42 +0200 (Wed, 15 Oct 2008) | 5 lines

  * store vmt procdefs in the ppu files so we don't have to use a hack to
    regenerate them for whole-program optimisation
  * fixed crash when performing devirtualisation optimisation on programs
    that do not construct any classes/objects with optimisable vmts

........
r11935 | jonas | 2008-10-19 12:24:26 +0200 (Sun, 19 Oct 2008) | 4 lines

  * set the vmt entries of non-class virtual methods of not instantiated
    objects/classes to FPC_ABSTRACTERROR so the code they refer to can
    be thrown away if it is not referred to in any other way either

........
r11938 | jonas | 2008-10-19 20:55:02 +0200 (Sun, 19 Oct 2008) | 7 lines

  * record all classrefdefs/objdefs for which a loadvmtaddrnode is generated,
    and instead of marking all classes that derive from instantiated
    classrefdefs as instantiated, only mark those classes from the above
    collection that derive from instantiated classrefdefs as
    instantiated (since to instantiate a class, you have to load its vmt
    somehow -- this may be broken by using assembler code though)

........
r12212 | jonas | 2008-11-23 12:26:34 +0100 (Sun, 23 Nov 2008) | 3 lines

  * fixed to work with the new vmtentries that are always available and
    removed previously added code to save/load vmtentries to ppu files

........
r12304 | jonas | 2008-12-05 22:23:30 +0100 (Fri, 05 Dec 2008) | 4 lines

  * check whether the correct wpo feedback file is used in the current
    compilation when using units that were compiled using wpo information
    during a previous compilation run

........
r12308 | jonas | 2008-12-06 18:03:39 +0100 (Sat, 06 Dec 2008) | 2 lines

  * abort compilation if an error occurred during wpo initialisation

........
r12309 | jonas | 2008-12-06 18:04:28 +0100 (Sat, 06 Dec 2008) | 3 lines

  * give an error message instead of crashing with an io exception if the
    compiler is unable to create the wpo feedback file specified using -FW

........
r12310 | jonas | 2008-12-06 18:12:43 +0100 (Sat, 06 Dec 2008) | 3 lines

  * don't let the used wpo feedback file influence the interface crc (there's
    a separate check for such changes)

........
r12316 | jonas | 2008-12-08 19:08:25 +0100 (Mon, 08 Dec 2008) | 3 lines

  * document the format of the sections of the wpo feedback file inside the
    feedback file itself

........
r12330 | jonas | 2008-12-10 22:26:47 +0100 (Wed, 10 Dec 2008) | 2 lines

  * use sysutils instead of dos to avoid command line length limits

........
r12331 | jonas | 2008-12-10 22:31:11 +0100 (Wed, 10 Dec 2008) | 3 lines

  + support for testing whole program optimisation tests (multiple
    compilations using successively generated feedback files)

........
r12332 | jonas | 2008-12-10 22:31:40 +0100 (Wed, 10 Dec 2008) | 2 lines

  + whole program optimisation tests

........
r12334 | jonas | 2008-12-10 22:38:07 +0100 (Wed, 10 Dec 2008) | 2 lines

  - removed unused local variable

........
r12339 | jonas | 2008-12-11 18:06:36 +0100 (Thu, 11 Dec 2008) | 2 lines

  + comments for newly added fields to tobjectdef for devirtualisation

........
r12340 | jonas | 2008-12-11 18:10:01 +0100 (Thu, 11 Dec 2008) | 2 lines

  * increase ppu version (was no longer different from trunk due to merging)

........

git-svn-id: trunk@12341 -
2008-12-11 17:40:18 +00:00
peter
2a952c89a5 * store vmt entries in ppu
* give a note if the visibility of a vmt entry is lower than
    the previous (parent) entry
  * refactor vmt method collection using the new always available
    vmt entries

git-svn-id: trunk@12159 -
2008-11-18 18:49:27 +00:00
Jonas Maebe
a00df1033f * changed "Mixing signed expressions and longwords gives a 64bit result"
from warning into a hint (it's not a potential error, but potential
    optimisation advice)

git-svn-id: trunk@12075 -
2008-11-13 19:49:46 +00:00
florian
937067e367 + check if forward definitions and real definitions have the same type, resolves #11970
git-svn-id: trunk@12017 -
2008-11-02 12:36:31 +00:00
Jonas Maebe
a23630260b + "weakexternal" support for imported procedures and variables.
the syntax is exactly the same as for "external", except for
    the keyword. It is currently only active for Darwin targets.
    It should also work at least for Linux targets, but only with
    the GNU assembler (which is why it is not activated there)
  + test for this functionality

git-svn-id: trunk@12009 -
2008-11-01 18:38:32 +00:00
marco
cbbf7f4cfe * fixed a bunch of structural errors and missing escapes to get the docs building again.
git-svn-id: trunk@11910 -
2008-10-18 12:16:00 +00:00
florian
cb9e52826f * fix range check error in options handling, resolves #12365
+ better error output (print filename and line number) for config file directive errors

git-svn-id: trunk@11898 -
2008-10-14 17:06:55 +00:00
Jonas Maebe
64ddae4eff + -vq parameter to show message numbers
+ -vm<x>,<y> parameter to mask messages <x> and <y>
   (both based on a patch submitted by Petr Kristan)
  * alphabetically ordered -v<x> option processing code so it's easier
    to see which characters are still free (not many anymore)
  + some tests for the -vm functionality

git-svn-id: trunk@11888 -
2008-10-12 12:19:41 +00:00
Jonas Maebe
2b067a427d * give warning if a routine in the interface of a non-interface-only
macpas routine is not implemented and therefore considered to be
    external

git-svn-id: trunk@11703 -
2008-09-04 18:15:26 +00:00
yury
c84aa860bd * Added error message if resulting executable image size is too big to fit in memory. bug #11702.
git-svn-id: trunk@11481 -
2008-07-28 21:54:18 +00:00
yury
d5c0ba9a1e * Improved warning about constructing class instance with abstract methods. Warning is issued for each method and method name is specified in the message. It makes easy to find out which abstract methods still not overrode.
git-svn-id: trunk@11450 -
2008-07-23 12:24:25 +00:00
florian
c3605645ff + warn if someone still uses ppc386.cfg
git-svn-id: trunk@10992 -
2008-05-18 07:57:54 +00:00