in code and not in constants. In the case of primitive types constant nodes
are used while complex types like arrays, records and objects use a local
variable which is initialized to zero once at the entry of the method (the
variable is reused if Default() is used for the same type multiple times in
the same method). For this a new compilerproc was added which uses FillChar
to initialize the given memory area to zero.
This fixes Mantis #9420.
+ psystem.pas: Added Default symbol to system unit
+ htypechk.pas: Added function "is_valid_for_default" which checks recursively
whether the given type can be used with Default at all.
Forbidden types are files, helpers, ObjC and C++ types. This
check is used for records, arrays and objects only if the mode
is a non-Delphi one, as Delphi ignores these types on lower
levels.
+ msg/errore.msg: Added error message for unsupported types for Default()
+ symconst.pas: Added a new enum value vo_is_default_var which is used for the
local variables utilized by Default() so their initalization
and finalization can be avoided.
+ pexpr.pas: Add handling of Default() intrinsic to "statement_syssym"
+ ninl.pas: Extended tinlinenode by a method which returns the correct node for
a Default() and used that method in handle_typecheck.
* ncgutil.pas: Check for new flag "vo_is_default_var" when initializing and
finalizing local variables.
* ppu.pas: increase PPU version
+ psub.pas:
* Added a new routine which zeros defaultvars of a symtable.
* Use this routine inside "initializevars".
* Also use this routine to initialize the staticsymtable of the unit/program.
* Adjusted ppudump, because of the new enum value.
+ Added implementation of fpc_zeromem to system unit.
+ Added tests for Default()
git-svn-id: trunk@20629 -
the top-level fpmake.pp
* replaced commands to regenerate fpmake*.inc in top level fpmake.pp with
ones that don't depend on GNU awk, and which automatically recognize
nested fpmake files that contain their own add_XXX procedure and hence
must not get a wrapper
* regenerated fpmake*.inc so that fpindexer and opengles are now also
built, and dblib/fpmake.pp does not get a wrapper
git-svn-id: trunk@20625 -
self parameter for invoking inherited method calls (if you are in a
category method or a method of a child class, the extended or parent
class must have already been loaded by the run time, so we can
directly load the ISA pointer rather than detouring via the "class"
method)
git-svn-id: trunk@20624 -
0, just like gcc/clang. This results in more efficient code on
non-fragile ABI platforms and removes a dependency of the name
of the isa field in header translations
git-svn-id: trunk@20623 -
involved and the classes are not exactly equal (but one is a child of the
other): we have to look up the real class definition first in those cases
git-svn-id: trunk@20622 -
ParamStartDelimiter.
* Allow parameters without any name, for example: {uppercase[-this-]}
* Added simple tests for TTemplateParser
git-svn-id: trunk@20543 -