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 -
symconst.pas: added new enum tsymtableoption with set tsymtableoptions; currently it contains only sto_has_classhelper, but refactoring tstoredsymtable.b_needs_init_final is on the todo list
ppu.pas: added a new entry type that will hold the symtable options (91)
symbase.pas: added a new field "tableoptions" to TSymtable which will hold the flags of the symtable (only saved by tstoredsymtable)
symdef.pas: when a tobjectdef is created as a odt_classhelper or odt_objccategory the flag sto_has_classhelper is added to its owning global- or staticsymtable
symtable.pas:
* load and write the symtable's options as a small set to an entry before the definition entries
* tabstractlocalsymtable needed to annoy me by not calling "inherited writeppu" which does the same as tabstractsymtable did before
* search_last_objectpascal_classhelper: check whether the static- or globalsymtable contains a class helper at all; if not then just continue with the next
utils/ppudump.pas:
* added reading of symtableoptions entry (as readsymtableoptions) based on the reading of tsym options
* added the reading of symtableoptions before every read of the contents of a TSymtable (definitions, symbols)
git-svn-id: branches/svenbarth/classhelpers@16845 -
* Create implicit access methods, which hold type information for property parameters and allow parsing/typechecking occur the same way as for regular (non-dispinterface) properties.
+ Introduce separate proctypeoptions for property access methods. They are translated into correct dispatch call types and used to distinguish property access from regular method calls.
* Bump PPU version because new information has been introduced.
- Code specific to dispinterface properties in expression parser is no longer necessary, removed.
* Allow access to default property with [] for dispinterfaces.
+ Extended the test with basic correctness checks for property dispatching.
git-svn-id: trunk@16810 -
- compiler/symdef.pas: add "helperparent" which contains the class helper the current class helper "inherits" from (its real parent is the extended class); it's saved to ppu as well
- compiler/ppu.pas: increase ppu version
- compiler/pdecobj.pas:
* parse the "parent" of a class helper before parsing the extended class (the real parent)
* also disallow to inherit from class helpers for normal class (and to extend class helpers for class helpers)
* disallow the declarations of fields
* disallow the use of destructors
* don't parse abstract/sealed for class helpers
- compiler/ptyp.pas: _FOR is now parsed inside pdecobj.pas
- compiler/msg*:
* extended some messages for class helpers
* added some class helper related messages (perhaps the one or other will vanish again...)
git-svn-id: branches/svenbarth/classhelpers@16792 -
- add tarraysymtable to store generic type symbols
- process generic and specialize declarations similar to generic records and classes
- fix insert_generic_parameter_types to use def passed in argument instead of current_structdef because generic array type can't be assigned to the current_structdef variable
- increase ppu version because of arraydef changes
- tests
git-svn-id: trunk@16681 -
- move objname, objrealname fields from tobjectdef to tabstractrecorddef,
- load and save them from/to ppu file,
- use tabstarctrecorddef in some more places where previously code worked for tobjectdef
- change push_nested_hierarchy, pop_nested_hierarchy to handle records too
git-svn-id: branches/paul/extended_records@16519 -
+ support for nested procedural variables:
o activate using {$modeswitch nestedprocvars} (compatible with all
regular syntax modes, enabled by default for MacPas mode)
o activating this mode switch changes the way the frame pointer is
passed to nested routines into the same way that Delphi uses (always
passed via the stack, and if necessary removed from the stack by
the caller) -- Todo: possibly also allow using this parameter
passing convention without enabling nested procvars, maybe even
by default in Delphi mode, see mantis #9432
o both global and nested routines can be passed to/assigned to a
nested procvar (and called via them). Note that converting global
*procvars* to nested procvars is intentionally not supported, so
that this functionality can also be implemented via compile-time
generated trampolines if necessary (e.g. for LLVM or CIL backends
as long as they don't support the aforementioned parameter passing
convention)
o a nested procvar can both be declared using a Mac/ISO Pascal style
"inline" type declaration as a parameter type, or as a stand-alone
type (in the latter case, add "is nested" at the end in analogy to
"of object" for method pointers -- note that using variables of
such a type is dangerous, because if you call them once the enclosing
stack frame no longer exists on the stack, the results are
undefined; this is however allowed for Metaware Pascal compatibility)
git-svn-id: trunk@15694 -
x86-64 platforms (except for win64, which uses another ABI and which
already complied to it) + test
* fixed returning records containing 1 single or double field on darwin/i386,
these have to be returned via ST0 instead of as a regular record
* added support for LOC_FPUREGISTER and LOC_MMREGISTER in several places
where they can now occur due to the previous two changes
* made a few internalerrors unique
git-svn-id: trunk@15368 -
- add own symbol table for enumeration to store enumeration elements
- reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed
- implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables
- implement {$SCOPEDENUM ON/OFF} local switch
+ tests
git-svn-id: trunk@15051 -
passing any value to that parameter which has the same size as the
parameter (it basically acts as if there is an explicit type conversion
to the parameter type around the value at the caller side). If a procvar
has an univ parameter, all procvars whose corresponding parameter
has the same size as that univ parameter are similarly compatible.
This transparent compatibility can however cause crashes in case of
of the procvars when one of the types is passed on the stack and the
other isn't (because then the called routine will a) load the parameter
from a wrong location and b) pop the wrong amount off of the stack at
then end). Therefore FPC will warn in most cases where this can happen.
(mantis #15777)
git-svn-id: trunk@15010 -
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 -
* constant widestrings must be allocated and copied at program start up through an api call else they couldn't be passed between progam/dlls
git-svn-id: trunk@14432 -
+ basic support for Objective-Pascal: objcclass, objcprotocol,
objcselector on all Darwin platforms (ppc32/64, i386, x86_64, ARM),
see http://wiki.freepascal.org/FPC_PasCocoa and
http://wiki.freepascal.org/FPC_PasCocoa/Differences for some dialect
details. Use {$modeswitch objectivec1} to activate
+ Cocoa, iPhone/UIKit and WebKit interfaces for use with the new
syntax mode
git-svn-id: trunk@14068 -
rtl: add enumerators to the basic classes
tests: add enumerators test which compiles and work both by fpc and dcc
compiler:
+ start for-in loop implementation: implement for-in loop for types (enumerations and ranges), strings, arrays and sets. todo: perform type checking, optimize array and string loops - use temp for expression, implement for-in loop for classes
test:
+ add a simple test for the 'for-in' loop
compiler: fix string for-in loop. now it uses a temp variable to store string expression result
complier: fix for-in array loop. use a temp variable for the loop expression only if loop is not an open array loop
complier: continue enumerator implementation:
+ add operator enumerator which give an ability to add enumerator for an existent type (for example to override builtin string enumerator)
+ add class enumerator support via delphi compatible GetEnumerator method + enumerator class/object template (function MoveNext: Boolean; property Current)
+ tests
compiler: fix for-in loop for arrays. delphi does not copy arrays to a temp variable and it is possible to change array during loop. + test
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: enumerator directive support:
+ allow to mark methods and properties by 'enumerator MoveNext' and 'enumerator Current' modifiers. Parser checks return types and duplicates.
+ prefer *marked* by enumerator directive methods and properties than GetEnumerator and Current builtin symbols
+ increase ppu version
+ test
rtl: add IEnumerator and IEnumerable interfaces declarations
tests: for-in loop tests:
+ add small comment at the top of test program
compiler: allow 'enumerator MoveNext' for the interface function declaration + test
compiler: move all for-in loop helpers to the nflw unit
compiler: don't allow the compiler to choose the non-valid enumerator operator for the for-in loop
git-svn-id: trunk@14008 -
- compiler: allow message after the *deprecated* keyword
- compiler: raise an internal error if deprecated message is trying to set to a non clear string pointer
git-svn-id: trunk@13997 -
-- 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 -
to objc_msgSend* into the callnode. This allows reusing the current
call node rather than having to create a new one, and is in particular
necessary because even though the objc_msgSend* functions are declared
as varargs, you're supposed to typecast them to the function type
describing the method before calling them (so they should *not* use
varargs calling conventions!)
* for the above, a field called fobjcforcedprocname has been added to the
callnode, which can be set to a string that will be used as the (mangled)
name of the function to call instead of the mangled name of the procsym
-> fixes calling obj-c methods with floating point arguments on ppc
git-svn-id: branches/objc@13783 -
* don't allocate tobjectdef.implementedinterfaces for corba interfaces
since the compiler doesn't support multiple inheritance for them
* extended/corrected related tobjc22 test
* increased ppu version, because implementedinterfaces is now
present in different cases
git-svn-id: branches/objc@13738 -