This basically revives the globalasmsym entry of the PPU though it feeds to different lists, one for the public (exported) symbols and one for the external (imported) symbols. Also the list of symbols is much smaller as it would be if all symbols would be dumped in there.
git-svn-id: trunk@34174 -
SS=DS. This is currently redundant (whether SS=DS can be derived by the other
i8086 memory model unit flags), but in the future will allow adding extra
memory models, where the SS=DS assumption differs from the current ones.
git-svn-id: trunk@34139 -
Correctly parse the directives DenyPackageUnit and WeakPackageUnit
ppu.pas:
+ add flags uf_packagedeny and uf_packageweak
scandir.pas:
+ new procedure do_moduleflagswitch() which parses a ON/OFF/+/- argument and sets or clears a flag in the current module
+ new procedure dir_denypackageunit which handles DenyPackageUnit
* implement dir_weakpackageunit (and move to the correct location ;) )
* InitScannerDirectives: add dir_denypackageunit handler
........
Respect DenyPackageUnit flag.
pmodules.pas, proc_package:
* check all contained units that are not already part of a package for their uf_package_deny flag and report an error for each that has it set
........
Do not check whether all units are used as by definition all units of a package are considered as used.
pmodules.pas, proc_package:
- remove call to current_module.allunitsused
........
Check whether a unit has been implicitely imported in a package. A unit is considered as implicitely imported if it is not part of a required package nor part of the units listed in the contains section. This note is useful (Delphi even provides a dialog in that case) as a package with implicitely imported units /might/ become incompatible with other packages (e.g. if another package includes that unit uses that package and includes that unit explicitely; of course that is the same as if both package included it explicitely, but with the hint one knows where to look).
pmodules.pas, proc_package:
* while walking the loaded units also check whether any of them not contained in a package was part of the contained units which are the same as the current module's used units
........
Generate CRC for package files
pcp.pas, tpcpfile:
+ new field do_crc which controls CRC generation
+ override putdata() method to generate CRC when data is written
* resetfile: enable do_crc by default
........fppu.pas, tppumodule:
* loadfrompackage: mention if a unit is loaded from a package
........
fpkg.pas, tcontainedunit:
+ new fields offset and size for the PPU data stored inside the PCP
fpcp.pas, tpcppackage:
* readcontainedunits & addunit: correctly initialize offset and size to 0
........
Store the modified PPU files directly inside the PCP and thus get finally rid of the .ppl.ppu files.
entfile.pas:
+ new entry type ibpputable
pkgutil.pas:
* adjust RewritePPU to work on a stream as output instead of a filename
fpcp.pas, tpcppackage:
+ new method writepputable() which writes the offsets and sizes of all contained units (not part of CRC!)
+ new method writeppudata() which rewrites all contained PPUs directly into the PCP after the ibend entry (Note: the data is written 16 Byte aligned to ease viewing of the PCP and its contained PPUs in a hex editor)
+ new method readpputable() which reads the offsets and sizes of all contained units
+ new method getmodulestream() which returns a substream for a contained module
* loadpcp: also call readpputable()
* writepcp: first write an empty pputable, then finish writing all data that requires the put*/write* methods of the pcpfile, then use writeppudata() to write all PPUs and finally write the correct pputable at the original location
fppu.pas, tppumodule:
* loadfrompackage: don't read the PPU from a file if it is contained in a package, but using the new tpcppackage.getmodulestream() and tppumodule.openppustream() methods
pmodules.pas, proc_package:
* don't rewrite the PPUs here
pcp.pas:
* increase CurrentPCPVersion
........
Fix cycling
........
git-svn-id: trunk@33514 -
Don't try to export generic symbols.
pkgutil.pas:
* exportabstractrecordsymproc: do not export generic type symbols or their nested symbols
........
Ensure that the correct name is used for the PCP file.
proc_package:
* use current_module.modulename instead of module_name for the base filename of the PCP file
........
Add a possibility to track if a unit was loaded from a package.
fmodule.pas, tmodule:
+ new field "package" which is Nil if the unit is not (yet) part of a package or a reference to the package this unit was loaded from
fppu.pas, tppumodule:
* loadfrompackage: set the "package" field of the module to the package it's loaded from.
........
Ensure that units loaded from a package are not recompiled if the source files should happen to be available.
fppu.pas, tppumodule:
loadppu: set the state to ms_compiled instead of ms_load if the unit was loaded from a package (additionally close the PPU file as it's no longer needed)
........
Add support for reading/writing required packages from/to the PCP file
fpcp.pas, tpcppackage:
+ new methods writerequiredpackages and readrequiredpackages
* loadpcp: use readrequiredpackages
* savepcp: use writerequiredpackages
pcp.pas:
* increase PCP version
........
When compiling a package, handle only those units that are not yet part of a package.
pmodules.pas, proc_package:
* only export units that are part of the package
* only add units to the package if they are really part of the package
* don't rewrite the PPU if the unit is not part of the package
* don't link the unit's files if it is not part of the package
........
Add support for parsing required packages.
pkgutil.pas:
+ new function add_package to add a package to the list of available packages with the possibility to check for duplicates
* load_packages: also load all required packages
pmodules.pas, proc_package:
* create the tpcppackage instance earlier (and use the module name as read from the source file as package name)
* clear the list of packages in case the user passed any using -FPxxx
* parse the "requires" section like a list of units and add each full identifier as a package to load
* before parsing the "contains" section load all packages, so that all units can be correctly resolved
........
Correctly create import libraries for packages as well.
pkgutil.pas, createimportlibfromexternals:
* instead of processing units without the uf_in_library flag, only process those that don't have a package reference set (thus becoming part of the program/library or the package)
- remove unneeded "pkg" parameter
pmodules.pas:
+ proc_package: create the import library if the package requires other packages
* proc_program: adjust call to createimportlibfromexternals
........
Ensure that the reference to the System unit is correctly set up for packages. Among other things this is needed to compile a package with the -gl option (though debug information doesn't work yet).
pmodules.pas:
* convert AddUnit to a function and let it return the newly loaded module
* proc_package: when parsing the contained units ensure that we correctly set up the System unit reference if we are to contain the System unit
* proc_package: also set up the System unit reference once all units are loaded and this hasn't happened yet (because all contained units are already compiled)
........
git-svn-id: trunk@33502 -
To correctly generate the import library for a package we need to resolve the dangling external symbols of all units. For this each unit now stores which symbols it exported from another unit and it also stores all global and external assembler symbols it has (maybe this can be streamlined later on, but for now this works).
entfile.pas:
+ new entry for the imported unit symbols
fmodule.pas, tmodule:
+ new field unitimportsyms which holds all symbols imported by a unit from another unit
+ new method to add an imported symbol
* create, destroy & reset: correctly instantiate/free the two new lists
fppu.pas, tppumodule:
+ new field unitimportsymsderefs to hold the derefs during loading from/storing to PPU
+ new method buildderefunitimportsyms to generate the derefs for each imported symbol
+ new method derefunitimportsyms to resolve each imported symbol deref
+ new method readunitimportsyms to read the imported symbols from the PPU
+ new method writeunitimportsyms to write all imported symbols to the PPU
* load_implementation: read the imported symbols if their entry is encountered
* writeppu: generate the derefs for the imported symbols and write them to the PPU
* load_usedunits: resolve the imported symbols once all derefs are known
symtable.pas:
* addsymref: if the symbol is not from the current unit than mark it as imported
ppu.pas:
* increase PPU version
-- Diese und die folgenden Zeilen werden ignoriert --
M entfile.pas
M fmodule.pas
M fppu.pas
M ppu.pas
M symtable.pas
git-svn-id: trunk@33492 -
Merged revision(s) 28796, 28837-28845, 28847-28850, 28852, 32135 from branches/svenbarth/packages:
Provide possibility to pass packages and search paths for packages as parameters.
fpkg.pas:
+ new unit which contains the base types related to package files (most importantly "tpackage")
globals.pas:
+ new variable "packagesearchpath" which contains all paths in which package files should be looked for
+ new variable "packagelist" which contains a list of all packages that should be used in a program or library
* InitGlobals & DoneGlobals: initialize/finalize "packagesearchpath" accordingly ("packagelist" is handled in unit fpkg using a init/done-callback)
options.pas:
+ TOption: new fields "parapackagepath" and "parapackages" to keep track of package search paths and package files passed as parameters
* TOption.interpret_option: use '-Fp' for package search paths and '-FP' for package files
* read_arguments: apply the passed package search paths and packages to their respective containers
........
+ add a new unit which will contain basic functions related to handling packages
........
Move package related functions from pmodules to pkgutil.
pmodules.pas => pkgutil.pas:
* createimportlibfromexports
* varexport
* procexport
* insert_export
* RewritePPU
........
* adjust indentation
........
Extract the code to export the symbols of a unit to its own function in pkgutil so that less functions need to be exported.
pmodules.pas, proc_package:
* move code to export the symbols of a unit to new function export_unit
pkgutil.pas:
+ new function export_unit
- remove exports of procexport, varexport and insert_export
........
Some small fixes for package parsing.
pmodules.pas, proc_package:
* use orgpattern instead of pattern to build the module name (like is done in uses sections)
* ignore duplicates when generating exports
- no need to generate an import library for the package; that is done by the program/library that uses the package
........
+ new unit fpcp of which the class tpcppackage handles the reading and writing of package metadata from/to pcp files (equivalant to tppumodule).
........
+ add unit which contains representation of a PCP file (tpcpfile) like tppufile is for units.
........
Improve export generation.
pkgutil.pas:
+ new function exportprocsym to correctly export a procedure with all its aliases
+ new function exportabstractrecordsymproc to export the members of structured types
* insert_export: handle also namespacesym and propertsym (by ignoring them)
* insert_export: correctly export classes, record and objects
* insert_export: use new exportprocsym function to export a procsym
* insert_export: only export public variables of a static symtable
........
+ add entry constants for the name of the package and the package file names, both used by a PCP file
........
* use messages to get rid of most writelns related to package loading
........
Add additional entry types for PCP files
entfile.pas:
+ new entries ibstartrequireds and ibendrequireds to store the list of required packages
+ new entries ibstartcontained and ibendcontained to store the list of contained units
+ new entries ibstartppus and ibendppus to store the list of contained PPU files
........
Generate the PCP file once the package file and the used units were compiled correctly.
pmodules.pas:
* proc_package: generate the PCP file upon successful compilation
........
Add the possibility to load all packages supplied as parameters.
pkgutil.pas:
+ new function load_packages to load all packages supplied as parameters
pmodules.pas, proc_program:
* use load_packages to load all packages before any unit is loaded
........
Add code which tries to load a unit from a package first and only then as usual.
fppu.pas, tppumodule:
+ new method loadfrompackage which searches all available packages for the unit and loads it from there if found
* loadppu: first try to load the unit from a package if any are available
........
Don't link objects files of a unit that is provided by a package.
pmodules.pas, proc_program:
* if a unit has uf_in_library set we must not include it in the units we link against
........
git-svn-id: trunk@33452 -
+ new stream class TCRangeStream that represents a substream of another stream while being also extendable
........
Extend tentryfile so that it can be opened from a stream in addition to a file
entfile.pas, tentryfile:
+ new method openstream() to open a readable tentryfile based on a stream
+ new method createstream() to open a writeable tentryfile based on a stream
* adjust openfile() to use openstream()
* adjust createfile() to use createstream()
........
A few extensions for tentryfile needed for package files
entfile.pas, tentryfile:
+ new property position to retrieve/control the position of the underlying stream (works also with tempclose()/tempopen())
+ new method substream() to retrieve a stream that goes from the specified offset with the specified length (-1 create a stream that is extendable, aka for writing)
+ new property stream to get the underlying stream directly; be careful when using this!
........
Extend tppumodule so that it can be opened from a stream as well.
fppu.pas, tppumodule:
* rename openppu() to openppufile()
+ new method openppustream() to open a module based on a stream
+ put the common part of openppufile() and openppustream() into a new method openppu()
........
Fix compilation.
fppu.pas, tppumodule:
* openppu: add parameter ppufiletime for printing the time of the file (only if filetime is not -1)
* openppufile: pass the retrieve time of the PPU to openppu()
* openppustream: pass -1 to openppu()
........
git-svn-id: trunk@33109 -
Extract reading of the PPU/PCP version into tentryfile.
entfile.pas:
+ add new getversion method which uses the pointer returned by getheaderaddr to read the PPU/PCP version
ppu.pas:
- remove GetPPUVersion method
fppu.pas, pmodules.pas, utils/ppufiles.pp, utils/ppumove.pp, utils/ppuutils/ppudump.pp
* replace call to GetPPUVersion by call to getversion
........
git-svn-id: trunk@32980 -
Extract functionality that is shared between the metadata files for units (PPU) and for packages (PCP) into a parent class called tentryfile
+ add new unit entfile which contains the new tentryfile class and related types and constants
* ppu.pas:
- remove methods, fields, types and constants which were moved to entfile.pas
* replace the parts of tppuheader shared with tentryheader by a field of type tentryheader
fppu.pas, pmodules.pas, utils/ppumove.pp, utils/ppuutils/ppudump.pp:
+ add entfile to uses
* adjust access to common header fields
node.pas, symdef.pas, symsym.pas, symtable.pas, wpoinfo.pas, utils/ppufiles.pp:
+ add entfile to uses
........
git-svn-id: trunk@32976 -
the defs and syms (recursively) referred by inline routines and by the WPO
info
o defs and syms are no longer added immediately to the module's deflist/
symlist, even if they are created as "registered". Instead,
"doregister=true" simply means "add it to the symbol table at the
top of the symtable stack"
o normally only when a sym/def is deref'ed, it gets added to the module
symlist/deflist and defid/symid gets a (unique) value
o in cases where we use(d) the defid to construct unique names within the
current module, you now have to call call the tdef.new unique_id_str()
method. If the def was not yet registered, we will reserve room for it
in the deflist (to get a unique id), but the defid gets set to a
negative value computed from its position in the deflist. Should it
have to be written to the ppu file later on, the defid will be
modified to the actual position in the deflist. For both values,
new unique_id_str() will return the same result so that references
to this def before and after actual registrations are the same (needed
for the JVM backend, but also a good principle in general)
Overall: don't directly use symid/defid anymore to get unique identifiers,
but use tdef.new unique_id_str() instead (if necessary, a similar routine
for tsym can be added)
The result is the ppu file size gets reduced significantly after its big
increase as a result of the high level typed constant builder (which creates
a lot of defs). The result is even more efficient than before, as other
unneeded defs/syms from the localsymtables don't get saved/restored anymore
either.
git-svn-id: trunk@32153 -
o the maintenance effort will be less - previously we had to test 4
combinations:
tiny program with tiny rtl
tiny program with small rtl
small program with tiny rtl
small program with small rtl
I only tested both tiny and small programs with the small rtl, so I missed
a bug, which caused small programs built with the tiny rtl to always give
a "Nil pointer assignment" error. Now we only need to test two cases:
tiny program with tiny rtl
small program with small rtl
o I'm planning a bug fix for interrupt procedures in the tiny model, which
will make their prolog differ between small and tiny. Currently, they're
not used in the rtl, but that may change. And even if it doesn't,
interrupt procedures may also be used by user units.
git-svn-id: trunk@27516 -
The cause of the internal error was the following:
We have a generic in an unit ("A") which uses another unit ("B") in the implementation section and this other unit uses unit A in the interface section. Now the generic is specialized in the interface section of B. This leads to the problem that in unit A when it tries to load the globalsymtable of unit B that globalsymtable will be Nil, because parsing of the interface section is not yet finished. Thus the change in pgenutil.pas, specialization_init: if the unit is still "in_interface" the localsymtable needs to be used instead of the globalsymtable.
This doesn't necessarily lead to a compiling test though, as there is the following possibility:
Unit A contains a generic class/record (with methods) and uses unit B in the implementation section. This unit B also contains a generic class/record (with methods) and uses unit A in the implementation section. Both units contain a specialization of the other unit's generic outside of it's own generics (such that generate_specialization is fully triggered). Let's assume compilation starts with unit A and we reach the uses of unit B. Now compilation switches to unit B and completes as unit A is already registered and in compilation. The problem now is that the generic in unit A still contains unresolved forward declarations as the implementation section of A was not yet parsed which will lead to "forward declaration not solved" errors (Note: Delphi compiles this).
The solution to this is the following: if a generic is specialized from another unit which is not in state ms_compiled then the unit of the specialization needs to wait for the unit of the generic. So the specialization's unit adds itself into a list of waiting units of the generic's unit. Now inside "proc_unit" we need to check whether this module is waiting for other modules and if so avoid "finishing" the unit (which means generating the methods of the specialization, generating assembler code and ultimately freeing the scanner and PPU). Now when the generic's unit finishes we need to check whether other modules are waiting for it and finish them (of course it's a bit more complicated in reality, but that pretty much sums it up).
+ globstat.pas: Added an unit which handles the saving and restoring of the global state which was originally inside "parser.pas, compile" so that Don't Repeat Yourself (DRY) is respected.
* fmodule.pas, tmodule:
+ add fields to keep track of the units the module is waiting for and which modules are waiting for the module
+ add field for the saved global state (raw pointer to avoid circles)
+ add field for the state which is needed to finish the unit (raw pointer to avoid circles)
+ move the code which was used in "parser.pas, compile" after a module was successfully compiled to the new virtual method "end_of_parsing"
+ fppu.pas, tppumodule.end_of_parsing:
free the ppufile here
* pgenutil.pas:
+ add new procedure "maybe_add_waiting_unit" which adds the specialization's unit to the waiting list of the generic if that unit is not yet compiled
* generate_specialization: call the new function when we add a new (true) specialization
* specialization_init: instead of not adding implementation units at all check whether the unit is still parsing the interface section and add the localsymtable in that case
* pmodules.pas:
* change "proc_unit" to a function which returns "true" if the unit was already finished (no need to wait for other units)
+ move the code from "proc_unit" from "generate_specialization_procs" on to a new procedure "finish_unit" which
* this procedure is either called immediately in "proc_unit" if the unit does not need to wait for other units or from "finish_unit" itself if a unit that is waiting for the given unit does no longer wait for another module (special care is taken in proc_unit to avoid circles)
* parser.pas, compile:
* correctly handle the case if an unit is not finished
* use the new global state functionality from globstat.pas
* pay special attention when calling "set_current_module" (see comment at that call)
+ add tests from 22160
+ add test for above mentioned "diamond" case
git-svn-id: trunk@22452 -
* pscanner.pas, tscannerfile.replaytoken: remove the checks for "sources_avail" and always update the read file/line information
* fppu.pas, tppumodule.readsourcefiles: always load at least the filenames which were used when compiling the unit from the ppu file, so that file/line information will be correctly shown, but don't touch the "sources_avail" flag of the tppumodule
git-svn-id: trunk@21657 -
that deal with paths/filenames with TPathStr (= ansistring) to prevent
cutting off long paths (no change in speed when compiling the compiler,
1% extra memory usage)
git-svn-id: trunk@21120 -
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: branches/jvmbackend@20887 -
for the current unit and all types/routines declared in it. The
unit itself becomes a member of this namespace as well, so in
case it's called unit1, it will be x.y.z.unit1, and type tclass
declared in it will be x.y.z.tclass. Only used for the JVM
target currently
git-svn-id: branches/jvmbackend@18436 -
in Windows, Emx and OS2 targets.
This fixes test failures: test/library/tlib1b.pp and lib2b.pp
link unit TLinker.AddImportSymbol: Added symmangledname parameter.
ogbase unit TImportSymbol.Create: Add AMangledName parameter.
fmodule unit TModule.AddExternalImport: Add symmangledname parameter.
fppu unit: Also put mangled name string for imported symbol.
ppu unit: Increase PPUVersion
utils/ppudump.pp: Adapt to PPU change above.
systems/T_OS units: Use ImportSymbol.MangledName property to create
import libraries or .idata sections.
git-svn-id: trunk@17804 -
* TCmdStr changed into an ansistring
* command line parameter handling uses now ansistrings
* message handling parameters are now ansistrings
git-svn-id: trunk@17469 -
of a pre-compiled unit are available on tf_p_ext_support systems
(patch by Aleksa Todorovic, mantis #17907)
* fixed indentation/flow of this and a similar check elsewhere
git-svn-id: trunk@16328 -
dependent units, but the ppu that caused the current unit to be loaded
-> last comment of r14505 was wrong, and that change has been reverted
git-svn-id: trunk@14506 -
o keep track of a global defsgeneration counter that's increased every time
a unit has finished compiling its interface or implementation
o give each ppumodule the current defsgeneration number when its compiled
o only re-resolve a unit if its defsgeneration number is smaller than that
of the unit that wants it to be re-resolved
* fixed an error in the re-resolving logic added last time: re-resolve
units that depend on the current unit rather than those that also depend
on the parent unit
git-svn-id: trunk@14505 -
units have changed, because these can influence the code of the
current unit in case method signatures changed (mantis #13840)
+ manual test
* fixed some recompilation crashes related to WPO info
* clarified the unit_u_add_depend_to message
git-svn-id: trunk@14503 -
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 -
the code using {$pascalmainname x} + storing it in the ppu file
(and give a warning if it's overridden multiple times + test)
git-svn-id: trunk@10406 -
* fixed some (harmless) ptrint warnings
- removed some commented code in agppcmpw
* added one missing field in a typed constant in cp1251
git-svn-id: trunk@8081 -