* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
* repurpose the AArch64/Darwin target for AArch64/macOS
o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler
git-svn-id: trunk@45758 -
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.
git-svn-id: trunk@42356 -
Allows compilation of compiler using -dDEBUG_NODE_XML
which will generate a NAME-node-dump.xml file for each
unit, program or library compiled,
containing a XML description of the nodes handled during
compilation of the unit, program or library.
git-svn-id: trunk@42271 -
initialisation/finalisation routines
o this ensures the procdef's mangled name and its first symbol match,
which is required for Darwin when generating debug information and
using ".set" directives to define alias symbols, because a symbol
defined via ".set" cannot be used in a data relocations (and the DWARF
debug generator uses the default mangled name, which used to correspond
to the alias symbol due to the "insert" instead of "append")
git-svn-id: trunk@42094 -
program/library also with -Clflto, all units compiled with that option
will be linked using their bitcode files and LTO
o compiling with -CLflto will compile all units twice: once for normal
(static or smart) linking, and once for LTO. So the result can be
used both with and without LTO.
git-svn-id: branches/debug_eh@41910 -
on pdecsub (node units should not depend on parser units):
o maybe_add_public_default_java_constructor()
o handle_calling_convention()
o create_finalizer_procdef() (replaced with create_outline_procdef())
o insert_record_hidden_paras()
o handle_calling_convention()
o proc_add_definition()
o build_parentfpstruct()
o maybe_guarantee_record_typesym()
o get_first_proc_str()
* factored out the creation of a procinfo for a nested procdef based on a
subnodetree of the current procdef into tprocinfo.create_for_outlining()
git-svn-id: trunk@40773 -
* ppu version update
* -Sf might be used only during system unit compilation
* loadsystemunit factored out so the system unit can be loaded earlier than other units to get features set
git-svn-id: trunk@37708 -
at the end of compiling a unit, also remove it from its owning procsym
in case the procsym does get written to the ppu (possible because you
can have extra overloads in the implementation) (mantis #25283)
o also fixes webtbf/tw4103 on the platforms where this still failed
(on the platforms where it worked, it worked by accedent since the
compiler was accessing memory of a freed procdef)
git-svn-id: trunk@35309 -
Use new cs_checkpointer_called moduleswitches set element.
Use new uf_checkpointer_called PPU flag (reusing obsolete uf_local_browser flag value)
Emit warning if compiled library/program has any code using checkpointer.
* ppu.pas: New constant: uf_checkpointer_called
* globtype.pas: New constant: cs_checkpointer_called
* fppu.pas: Set uf_checkpointer_called flag if cs_checkpointer_called is set in current_settings.module_switches
* i8086/n8086mem.pas: Include cs_checkpointer_called in current_settings.moduleswitches
* ncgmem.pas: Likewise.
* msg/errore.msg: Add new message saying that -gc and -Ur options are incompatible
Add description to -gc option, saying it is experimental.
Add warning at link time for program/library if checkpointer is used in any unit or main code.
* options.pas: if -gc and -Ur options are used, never enable checkpointer code,
instead output a warning that release is incompatible with -gc option.
* pmodules.pas: proc_program: Check all modules for uf_checkpointer_called flag,
emit a warning if checkpointer is used.
* utils/ppuutils/ppudump.pp: Add code for uf_codepointer_called option.
git-svn-id: trunk@34567 -
tasmdata.DefineAsmSymbol() and all routines that call it
o will be used to automatically generate AB_INDIRECT sybols when
necessary
git-svn-id: trunk@34164 -
list, so that the assembler directives generated for Darwin are emitted
correctly for LLVM
o extracted the library init code generation from hlcgobj to pmodules so
we don't add things to another list than what's passed to
gen_proc_symbol_end(), and so it's done where we generate the init
routine for libraries (rather then checking for every routine whether
it's the init routine for a library)
o removed the llvm-specific gen_proc_symbol_end() because the regular one
now does the same
git-svn-id: trunk@34134 -
fmodule.pas, tmodule:
+ new list pendingspecializations which keeps track of all pending specializations of the current module
psub.pas:
* move generate_specialization_procs and related routines to pgenutil
+ new procedure read_proc_body to read a routine's body, cause generate_specialization_procs needs it (unlike the already existing overload in the implementation section, this one can only handle bodies of non-nested routines)
pgenutil.pas:
* generate_specialization_phase2: add the newly specialized generic to the current module's pending specializations
* generate_specialization_procs: reworked so that it uses the new pendingspecializations field instead of walking the global and local symboltable of the current unit
pmodules.pas:
+ add pgenutil to uses due to the moved generate_specialization_procs
+ added test
git-svn-id: trunk@33826 -
Report a warning if a unit is used from an indirectly used package. We are doing this only for the units used in contained units though as in the "contains" section there can't be such units anyway (and just checking all loaded units would lead to false positives).
pkgutil.pas:
+ new procedure check_for_indirect_package_usages() which walks a TLinkedList of used units and warns on every unit that is from an indirectly imported package
pmodules.pas, proc_package:
* when checking all loaded units whether they are from a package or not also check for indirect package usages using the new procedure
........
pkgutil.pas, exportprocsym:
* use a temporary variable for the procdef
* restructure the if-expression a bit to make it better readable
........
pmodules.pas, finish_unit:
* also release the generated proc symbol if the init function isn't needed
........
pkgutil.pas, add_package_libs:
* fix exit condition (on Linux it probably worked by accident :/ )
........
git-svn-id: trunk@33518 -
Keep track whether a package was added directly through a requires section (or the command line) or indirectly.
fpkg.pas, tpackageentry:
+ new field "direct"
pkgutil.pas:
+ add_package: new parameter "direct" which sets the "direct" field of the new package entry
options.pas:
* TOption.interpret_option & read_arguments: adjust call to add_package()
pmodules.pas:
* proc_package: adjust call to add_package()
........
Also load all packages that are required by packages, but that are not part of the directly used packages.
pkgutil.pas, load_packages:
* check the list of required packages for packages that are not yet part of the package list and add these as indirect packages
* establish the links to loaded packages in the required packages once all packages were loaded
........
fpcp.pas, tpcppackage:
+ new method add_required_package() to add a required package while ignoring duplicates
........
pmodules.pas, proc_package:
* add all packages of loaded units as required packages
........
git-svn-id: trunk@33517 -
cclasses.pas, TCmdStrList:
* if doubles are not allowed then do case sensitive checks instead of insensitive ones
........
Correctly handle export/import generation depending on whether we're compiling for a system that needs indirect imports or not.
systems.pas:
* replace systems_package_need_exports with systems_indirect_var_imports
pmodules.pas, proc_package:
- remove check for systems_package_need_exports
pkgutil.pas:
* insert_export, export_unit: export the direct or the indirect variable symbol depending on systems_indirect_var_imports
........
ncgrtti.pas, TRTTIWriter.write_extra_rttisyms:
* enumdef_rtti_string2ordindex & enumdef_rtti_ord2stringindex: put the indirect suffix at the end of the symbol
........
pkgutil.pas, add_package_libs:
* check for systems_indirect_var_imports instead of systems_package_needs_exports
........
expunix.pas, texportlibunix:
* generatelib: check all procdefs whether they have the alias and not only the first one
........
pkgutil.pas:
* insert_export: directly report the symbol type instead of its ordinal to ease finding of problems
........
pkgutil.pas, export_procsym:
* restructure if for better readability
+ also check the procdef for po_has_public_name
........
Ensure that all implicitely imported units are indeed part of the package.
pmodules.pas, proc_package:
* instead of checking the units loaded by the current module we need to check *all* units that are loaded for the package
........
Fix inclusion of PPUs that don't have a corresponding object file.
pkgutil.pas, RewritePPU:
* don't abort if a unit does have the flag uf_no_link set
* only abort if both uf_static_link and uf_no_link are not set
........
Generate an error if a unit listed as in "contains" is part of a directly or indirectly required package.
pmodules.pas, proc_package:
* walk all units and check whether it had been loaded from a package, but is also part of the units of the current module; if so then generate an error
........
git-svn-id: trunk@33516 -
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 -
pmodules.pas, proc_package:
* generate the dummy entry symbol only on Windows systems (ToDo for other systems that might need it)
........
options.pas:
* TOption.interpret_option & read_arguments: use add_package() from pkgutils instead of addpackage() from fpkg
fpkg.pas:
- remove no longer needed addpackage()
........
pkgutil.pas:
+ new procedure add_package_libs() to add all packages as libraries that are also linked against
pmodules.pas:
* proc_package & proc_program: add all package libraries to the linker before creating the final binary
........
pkgutil.pas, add_package:
* package names are case insensitive so add them in uppercase to correctly detect duplicates
........
Keep track of how many units are used from each required/requested package and only link those from which any units are used.
fpkg.pas, tpackageentry:
+ new field usedunits to count how many units of the package are used
pkgutil.pas:
+ new procedure add_package_unit_ref() to increase the amount of used units for the given package
pmodules.pas:
* proc_package & proc_program: check which units of all loaded ones are provided by other packages
........
git-svn-id: trunk@33510 -