Commit Graph

36136 Commits

Author SHA1 Message Date
svenbarth
bd19a16be9 Add support for Default() intrinsic. For now this is only (fully) supported
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 -
2012-03-25 16:02:27 +00:00
florian
a953b732d4 * update of project file
git-svn-id: trunk@20627 -
2012-03-25 14:23:57 +00:00
florian
f4af507321 * inline is only a hint to the compiler which might be ignored so throw only a hint and not a warning if subroutine cannot be inlined
git-svn-id: trunk@20626 -
2012-03-25 14:19:45 +00:00
Jonas Maebe
5a05542ddb * fixed dblib/fpmake.pp and fpindexer/fpmake.pp when they are included from
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 -
2012-03-25 14:09:04 +00:00
Jonas Maebe
c4c9661f84 * set "forcall" to true for the objc loadvmtaddrnodes generated as
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 -
2012-03-25 12:59:17 +00:00
Jonas Maebe
284210ad48 * hardcode offset of the ISA field in Objective-C (meta)classes to be
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 -
2012-03-25 12:55:18 +00:00
Jonas Maebe
2e3605e999 * fixed tobjectdef.is_related() checks in case formal class definitions are
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 -
2012-03-25 11:37:21 +00:00
joost
69ba57f4a7 * Added compilation of dblib, fixes compilation after r20618
git-svn-id: trunk@20621 -
2012-03-25 10:18:04 +00:00
florian
b01e6e1671 * remove duplicate types after r20603, resolves #21548
git-svn-id: trunk@20620 -
2012-03-25 09:34:28 +00:00
florian
ca90260855 + fix duplicate internal error, resolves #21545
git-svn-id: trunk@20619 -
2012-03-25 09:18:45 +00:00
michael
8799956817 * Fixed compilation of mssql
git-svn-id: trunk@20618 -
2012-03-25 09:18:39 +00:00
michael
241ea31e97 * Regenerated makefile with latest fpcmake
git-svn-id: trunk@20617 -
2012-03-25 09:17:06 +00:00
marco
05999225a3 * Patch for referenceinterface by C. Peterson to properly add to the freenotification list, Mantis #20808
git-svn-id: trunk@20616 -
2012-03-24 17:28:10 +00:00
joost
06378882e3 * Install the TPackage.InstallFiles only once
git-svn-id: trunk@20615 -
2012-03-24 16:44:55 +00:00
marco
14f9e3542d * use NULLHANDLE instead of NIL, since exact typing of handle type is unknown
(ptr or integer iow nil or 0)

git-svn-id: trunk@20614 -
2012-03-24 12:22:29 +00:00
marco
981ebb4778 * FB_API_NULLHANDLE since now handles can be 0 or nil.
git-svn-id: trunk@20613 -
2012-03-24 12:00:49 +00:00
joost
b1cda73a9a * Replaced fpcmake building by fpmake building
git-svn-id: trunk@20612 -
2012-03-24 10:15:21 +00:00
marco
25f29e1048 * Patch from Lacak2 for Mantis #20379 FirstLineAsSchema improvements.
git-svn-id: trunk@20611 -
2012-03-24 10:01:55 +00:00
marco
d1c796a041 * ISC_STATUS to ptrint and all handles to 32-bit. Mantis #19116 related (but
not fixing that?)

git-svn-id: trunk@20610 -
2012-03-24 09:31:05 +00:00
joost
ff6c64ae70 * Do not build unused units
git-svn-id: trunk@20609 -
2012-03-23 22:18:27 +00:00
florian
99b0421193 + patch by Seth Grover to support line number macro returning a numerical number, resolves #21372
git-svn-id: trunk@20608 -
2012-03-23 20:35:42 +00:00
florian
0f9b8c8936 * don't throw an error if a non-generic is tried to be specialized, resolves #21238
git-svn-id: trunk@20607 -
2012-03-23 20:32:40 +00:00
florian
a7fe7b5d06 * patch by cobines to improve speed of TFPList.Move, resolves #21436
git-svn-id: trunk@20606 -
2012-03-23 20:16:03 +00:00
florian
0a118768c0 * updated copyright message to 2012
git-svn-id: trunk@20605 -
2012-03-23 18:38:05 +00:00
marco
3610aaa01a * int32 is longint in default mode, not integer.
git-svn-id: trunk@20604 -
2012-03-23 17:51:34 +00:00
marco
d7d461f6d3 * Adding Delphi (2010 or XE) equivalents to our ctypes unit. Mantis #21537
git-svn-id: trunk@20603 -
2012-03-23 17:49:59 +00:00
pierre
6fd24693d6 * Explicitly disable range/overlfow checks when test is not about this
git-svn-id: trunk@20602 -
2012-03-23 16:35:04 +00:00
pierre
f8dcacd69b *Explicitly disable range check to trigger the hint that is tested and no range check generated warning
git-svn-id: trunk@20601 -
2012-03-23 15:16:29 +00:00
pierre
5b10c0c403 Avoid random values and range/overflow checks
git-svn-id: trunk@20600 -
2012-03-23 15:15:21 +00:00
pierre
bcf9a2deb3 * Use $Q- which is the correct way to disable overflow checking
git-svn-id: trunk@20599 -
2012-03-23 15:09:03 +00:00
pierre
3abfc11ade Add explicit -CO- command line option in tests needing it
git-svn-id: trunk@20598 -
2012-03-23 14:45:34 +00:00
pierre
a2d6cba691 Add explicit O- option in tests needing it
git-svn-id: trunk@20597 -
2012-03-23 14:38:39 +00:00
sergei
3d1b4b1b63 * Added a typecast to avoid range error in 64-bit debug builds
git-svn-id: trunk@20596 -
2012-03-23 13:48:34 +00:00
marco
86bf5f36ba * Call inherited in destructors.
git-svn-id: trunk@20590 -
2012-03-23 12:56:13 +00:00
michael
44871bbbbd * Patch to reorder datetime testing values, so out-of-range comes last
git-svn-id: trunk@20585 -
2012-03-23 09:05:01 +00:00
joost
79c3ea3f87 * Added fpmake.pp file for fppkg-util
git-svn-id: trunk@20584 -
2012-03-22 21:10:28 +00:00
florian
4cf4c65502 * write the file location (if available), if a unit is not found, resolves #21514
git-svn-id: trunk@20583 -
2012-03-22 21:04:16 +00:00
joost
ae5c440864 * Added ability to generate target-dependencies
git-svn-id: trunk@20579 -
2012-03-22 16:40:58 +00:00
michael
0d545c68de * Call getOwner only once in several TPersistent methods (Patch from Luiz Americo, bug #21531)
git-svn-id: trunk@20574 -
2012-03-22 14:49:43 +00:00
joost
1bf8ef2428 * Also allow a single package dependency
git-svn-id: trunk@20573 -
2012-03-22 14:03:06 +00:00
michael
386fb374ce * Applied tests pach from bug #17303
git-svn-id: trunk@20572 -
2012-03-22 13:45:54 +00:00
joost
df59758326 * Added new tool to generate fpmake.pp files from JSON-based configuration files
git-svn-id: trunk@20571 -
2012-03-22 13:42:30 +00:00
michael
d1b209025f * Applied patch from Luiz Amerigo to have Delphi compatible behaviour when freeing a stringlist (bug 21529)
git-svn-id: trunk@20570 -
2012-03-22 12:10:06 +00:00
sergei
d12456c55d * Fixed syntax error which I managed to commit in r20558 (Mantis #21524)
git-svn-id: trunk@20569 -
2012-03-22 09:52:28 +00:00
pierre
ff5d25174a * Fix wide string shared library loading by adding 'lib' prefix if needed
git-svn-id: trunk@20568 -
2012-03-22 09:02:07 +00:00
sergei
c7259969ce + fcl-xml, implemented TDOMNode.BaseURI property.
* Moved element loading procedure from xmlread.pp to dom.pp, speeds things up a bit.

git-svn-id: trunk@20558 -
2012-03-21 22:19:27 +00:00
pierre
813ebf08e3 * Avoid having current_debuginfo pointing to freed memory
git-svn-id: trunk@20549 -
2012-03-21 10:17:43 +00:00
marco
040e67772a * Tests for Mysql 5.5, from Lacak2. Mantis #21511
git-svn-id: trunk@20546 -
2012-03-20 21:14:36 +00:00
marco
ecb34fb8da * Patches from Ludo Brands for typelib
- Mantis #21516 fix range check error
  - Mantis #21513 Specific workaround for potentially bugged Office10/MSacc.OLB

git-svn-id: trunk@20544 -
2012-03-20 18:53:38 +00:00
joost
0e0a5dee4f * TTemplateParser: Do not require a space between the tag name and the
ParamStartDelimiter. 
 * Allow parameters without any name, for example: {uppercase[-this-]}
 * Added simple tests for TTemplateParser

git-svn-id: trunk@20543 -
2012-03-20 16:13:14 +00:00