Commit Graph

533 Commits

Author SHA1 Message Date
Jonas Maebe
f67919e9f5 + odt_javaclass, odt_interfacejava objectdef types
+ it_interfacejava type (not explicitly selectable via -SI nor
    {$interfaces xxx}, but default for jvm target)
  * disable it_interfacecom/corba for jvm target
  + init_settings for jvm that select it_interfacejava as default interface
    type
  + default_class_type constant (in symconst) that is odt_javaclass for the jvm
    target and odt_class for other targets (used to determine the meaning of
    "type x = class" declarations)

git-svn-id: branches/jvmbackend@18286 -
2011-08-20 07:21:46 +00:00
Jonas Maebe
d7c1967351 * fixed switched around lists for read-only/read-write typed consts
git-svn-id: trunk@18068 -
2011-08-02 20:32:48 +00:00
svenbarth
de1e6b1c3d Implement support for nested non-generic types inside generic types. This is mostly for records, classes and objects ("structures") as those didn't work at all, but the others (arrays, procvars) weren't done cleanly either.
pobjdec.pas (object_dec) / ptype.pas (record_dec, array_dec, procvar_dec):
- enable "parse_generic" if a nested type is parsed and we're already inside a generic (this prevents code to be generated for the nested type's methods)
- set the "df_specialization" flag so that the code for generating the methods (and thus resolving the forwards declarations) is called for this symbol

pexpr.pas:
add "post_comp_expr_gendef" which basically calls "handle_factor_typenode" and "postfixoperators" as those aren't exported from the unit themselves

ptype.pas, read_named_type.expr_type:
- use "post_comp_expr_gendef" to parse the use of nested types (e.g. "var t: TTest<T>.TTestSub")

psub.pas, specialize_objectdefs:
implement the generation of the method bodies for nested structures (resolves the forward declarations)

pdecl.pas, types_dec:
when we encounter a nested structure inside a specialization of a structure, we need to find the corresponding generic definition so that the generic can be correctly parsed later on.

git-svn-id: branches/svenbarth/generics@18002 -
2011-07-16 14:12:25 +00:00
svenbarth
8f0583ffb2 Switching from overloaded type symbol to unique symbol per generic.
Reasons for the "unique symbol" approach:
- no special search operations for cross unit search needed (which is supported by Delphi) => less performance impact
- no special care needed to really find the correct generic => less increase of parser complexity

Currently all generic tests except tgeneric29.pp compile and inline specializations work as well.

The changes in detail:
* pdecl.pas/types_dec:
- The variables used to hold the final name of the symbol are now prefixed with "gen". In case of non-generics the prefixed ones are equal to the non-prefixed ones (e.g. orgtypename=genorgtypename). In case of a generic symbol the "gen"-variants contain the type parameter count suffix (e.g. '$1' in case of 'TTest<T>') as well.
- The unmodified pattern is used to insert and detect a dummy symbol with that name, so that type declarations and - more important - inline specializations can find that symbol.
- In non-Delphi modes this symbol is also used to detect whether we have a type redefinition which is not allowed currently; its typedef points to the generic def.
- In mode Delphi the def of that dummy symbol (which contains an undefineddef) is modified when a corresponding non-generic type is parsed, so that it contains the def of the real type.

* pdecsub.pas/parse_proc_head
- consume_generic_type_parameter now only parses the type parameters and picks the generic with the correct amount of parameters. The verification of the order and names of the parameters needs to be added again.
- it also does not use "def" anymore, but it sets "srsym"
- in parse_proc_head the symbol (srsym) is only searched if the symbol isn't assigned already; in case of a generic in mode FPC it will find the dummy symbol that points to the generic def

* pexpr.pas
- in factor_read_id there are three cases to handle:
 + the symbol is not assigned => error
 + a possible generic symbol (either an undefined def or the non-generic variant) => no error and no hints
 + a non-generic symbol => hints
 Point 1 is handled correctly, point 2 and 3 aren't currently and also they might be needed to be moved somewhere else
- sub_expr:
 + a node can be a tloadvmtaddrnode as well if the non-generic variant of a generic symbol is a class
 + we can only check afterwards whether the specialization was successful

* pgenutil.pas/generate_specialization
using the count of the parsed types the correct symbol can be found easily

git-svn-id: branches/svenbarth/generics@17535 -
2011-05-23 19:12:50 +00:00
svenbarth
b1959e5e89 Moved "parse_generic_parameters" and "insert_generic_parameter_types" from "pdecl.pas" to "pgenutil.pas"
git-svn-id: branches/svenbarth/generics@17404 -
2011-05-04 10:40:07 +00:00
svenbarth
80100734c5 *type symbol overloads are only allowed in mode Delphi
*a check for overloads with the same count of arguments is not yet in place
*in non-Delphi modes overloads need to be checked for non-generics as well, e.g. "TTest<T>" is already defined and now a "TTest" is declared
*when a generic is encountered and the symbol does not yet exist, a new symbol with an undefineddef is added and the generic def is added as an overload; if the symbol already exists, the generic is just added
*if a non-generic is parsed and the symbol is already defined (but the typedef is still an undefineddef) then the typedef is updated
*the symtable tree (up to the unit symtable (global or local)) gets the "sto_has_generic" flag which will be used when searching generics with the same name, but different parameter counts in different units

State of generics:
broken, because the generic defs are not yet searched/found

git-svn-id: branches/svenbarth/generics@17393 -
2011-05-02 19:44:14 +00:00
svenbarth
d0705a1779 Rebase to revision 17236
git-svn-id: branches/svenbarth/classhelpers@17241 -
2011-04-03 17:24:35 +00:00
Jonas Maebe
ac283bb237 * when checking whether the current class definition finalises an existing
forward-declared class, only search the current symtable rather than the
    entire symtable stack (to prevent finding types in e.g. nested types)

git-svn-id: trunk@17128 -
2011-03-13 13:34:49 +00:00
svenbarth
5218666328 * ncgrtti.pas: RTTI generation for helpers is handled like that for classes
* pdecl.pas: prohibit generic helper declarations
* pdecobj.pas: helpers extending generic types are not allowed (theoretically one could experiment with allowing this for Delphi style generics...)
* symtable.pas:
- is_visible_for_object: helpers can access (strict) protected fields of extended types
- searchsym_in_helper: use the correct contextclass and the correct search function
- search_default_property: search for default properties in helpers first
* symsym.pas: added a global variable that allows to track whether we are parsing inside a special system function
* pexpr.pas:
- statement_syssym: track the current syssym
- factor.factor_read_id: helper types are allowed inside "sizeof", "bitsizeof" and "typeinfo"

git-svn-id: branches/svenbarth/classhelpers@17097 -
2011-03-09 15:42:38 +00:00
svenbarth
963a4d7b23 Commit of a completely restructured helper implementation. Instead of changing objectdefs with odt_classhelper to odt_class, they'll have the odt_helper type assigned to and this will be kept. This also implies that the parent of a helper is its true parent while the extended type is set to a field in tobjectdef (extendeddef).
This change became necessary of the following reasons:
- Records don't support inheritance, thus for "record helpers" some creativity would have been necessary to implement them; with the new implementation this is more easily
- the new approach allows for easy checks regarding virtual methods and their overrides which would have been more complicated in the old variant
- if someone feels the need the types of helpers (object, interface) can be added rather easily
- unnecessary things like VMT generation can be disabled now

details:
- msg*: 
* moved some messages from parser to type
* adjusted a message ("class helper" => "helper")
- symdef.pas:
* renamed "helperparent" to "extendeddef" and changed its type from "tobjectdef" to "tabstractrecorddef", so records can be extended as well (somewhen in the near future)
* removed "finish_class_helper" method as it isn't necessary (luckily I haven't yet adjusted the ObjC variant)
* changed name of "is_objectpascal_classhelper" to "is_objectpascal_helper" to reflect that this function applies to all helper types
* tobjectdef.create: ImplementedInterfaces isn't created for odt_helper anymore
* tobjectdef.alignment: for helpers it's the same as for classes although this shouldn't be used anywhere...
* tobjectdef.vmtmethodoffset: set to 0 for helpers to be sure...
* tobjectdef.needs_inittable: not needed for helpers (no fields allowed)
* is_objectpascal_helper: only needs check for "odt_helper" object type
- symconst.pas:
* changed odt_classhelper to more general odt_helper
* added new type "thelpertype" which is used to check that "(record|class) helper" corresponds with the given extended type (as Delphi XE checks this as well this strict solution can be kept for modes Delphi and ObjFPC)
- symtable.pas:
* extended "searchsym_in_class" with the possibility to disable the search for helper methods (needed for inherited) => this implies changing all occurences of "searchsym_in_class" with a "true" except some special locations
* renamed "search_objectpascal_classhelper" to "search_objectpascal_helper"
* searchsym_in_class: 
** when an extended method is defined with "overload" it can be that a same named method of the extended class might be called (sadly this means that this search was unnecessary...)
** contextclassh is the def of the helper in the case of an inherited call inside the helper's implementation
** when methods inside a helper are searched, it must be searched in the extended type first
- ptype.pas:
* single_type is used to parse the parent of a helper as well, so allow a helper if the stoParseClassParent is given (needs check in pdecobj.pas/parse_class_parents for normal classes)
* read_named_type: currently the only case when something <> ht_none is passed to the modified parse_objdec (see below) is when the combination "class helper" is encountered ("record helper" will be another one)
- pinline.pas: adjustment for extended "searchsym_in_class"
- pexpr.pas:
* adjustments regarding "searchsym_in_class" and "is_objectpascal_helper"
* factor/factor_read_id: moved the check for "TSomeClassType.SomeMethod" outside of the "is_class" check
* factor: 
** in case of an inherited we need to search inside the extended type first (Note: this needs to be extended to find methods in the helper parent if no method is found in the extended type)
** we also need to disable the search for helper methods when searching for an inherited method (Note: it might be better to introduce a enum to decide whether a helper method should search before or after the methods of the extended type or even never)
- pdecsub.pas:
* insert_self_and_vmt_para: in a helper the type of Self is of the extended type
* pd_abstract, pd_final: more nice error message
* pd_override, pd_message, pd_reintroduce: adjusted checks because now "is_class" is no longer true for helpers
* proc_direcdata: allowed "abstract" for helpers (only to produce a more nice error message)
* parse_proc_direc: adjustment because of "is_objectpascal_helper"
- pdecobj.pas:
* adjustments regarding "is_objectpascal_helper"
* adjusted object_dec to take the type of the helper (class, record) as a parameter to be able to check whether the correct extended type was given
* struct_property_dec: properties are allowed in helpers
* parse_object_options: nothing to be parsed for helpers (at least I hope so ^^)
* parse_parent_classes: 
** the parent of a helper is now parsed as a normal parent, the extended type is parsed in an extra procedure
** check for "sealed" no longer needed
** added check that the parsed parent of a helper is indeed a helper
** allow to parse the closing ")" of the helper's parent
* parse_extended_class:
** new procedure that parses the type which is extended
** it checks that the extended type is a class for "class helper" and a record for "record helper"
** it checks that a helper extends the same class or a subclass for class helpers
** it checks that a helper extends the same record for record helpers
* parse_object_members:
** "type", "const", "var" is allowed in helpers
** don't exclude flags regarding virtual methods, they are needed for the checks in mode Delphi (this implies that VMT loading must be disabled for helpers)
* object_dec:
** don't change "odt_helper" to "odt_class", but still include the "oo_is_classhelper" flag
** allow the parsing of object options (there are none)
** parse the extended type for helpers
- pdecl.pas
* adjustment because of extension of object_dec
* types_dec: remove the call to finish_classhelper
- objcdef.pas
* objcaddencodedtype, objcdochecktype: add references to helpers as implicit pointers although that should not be used in any way...
- nld.pas
* tloadnode.pass_typecheck: self is a reference to the extended type
- nflw.pas
* create_for_in_loop: adjustment because of changed procedure and inheritance type
- ncgrtti.pas
* TRTTIWriter.write_rtti_data: disable for helpers for now (I need to check what Delphi does here)
- ncgld.pas
* tcgloadnode.pass_generate_code: virtual methods of helpers are treated as normal methods
- ncgcal.pas
* tcgcallnode.pass_generate_code: virtual methods of helpers are treated as normal methods
- ncal.pas
* tcallnode.pass_typecheck: adjust for extension of tcallcandidates constructor
- htypechk.pas
* tcallcandidates declaration: extend some methods to (dis)allow the search for helper methods (needed for inherited)
* tcallcandidates.collect_overloads_in_struct: 
** search first in helpers for methods and stop if none carries the "overload" flag
** move the addition of the procsyms to an extra nested procedure because it's used for helper methods and normal struct methods

git-svn-id: branches/svenbarth/classhelpers@16947 -
2011-02-20 11:41:55 +00:00
svenbarth
07eebff55c Rebase to revision 16827
adjusted nflw.pas to compile again

git-svn-id: branches/svenbarth/classhelpers@16831 -
2011-01-28 22:15:34 +00:00
paul
86482658a8 compiler: fix tgeneric11 test:
- add stoAllowSpecialization to TSingleTypeOption enum to differentiate between any new type definition and only generic specialization
  - allow only specializations for class parents (not any other type definition)
  - allow specialization for method arguments and return types (maybe this must be allowed only in delphi mode but in this case tgeneric11 must fail)

git-svn-id: trunk@16738 -
2011-01-08 16:14:22 +00:00
svenbarth
a9b64c80ad Rebase to revision 16728
git-svn-id: branches/svenbarth/classhelpers@16732 -
2011-01-07 23:06:09 +00:00
svenbarth
aed9f0a5f7 Added first version of class helper support (not fully working and not fully featured)
- tokens: added support for "helper" token
- symconst.tobjecttyp: added a new entry "odt_classhelper"
- symdef: added two functions to check whether a "tdef" instance is a class helper in general ("is_classhelper") or an Object Pascal class helper in particular ("is_objectpascal_classhelper")
- symdef.tobjectdef: added a new method "finish_classhelper" which calls "create_class_helper_for_procdef" for every method (maybe this can be used for Objective-C categories as well)
- symdef.tobjectdef.create: "ImplementedInterfaces" must be created for class helpers as well
- symtable.searchsym_in_class: class helper methods must be searched for Object Pascal classes as well (this is currently wrong, as those must be searched before the class symbols, but for a first test it's sufficient)
- ptype.read_named_type: "helper for" currently indicates a class helper ("for" should be checked inside "object_dec" though, as after "helper" there might be a parent class helper)
- pdecobj.parse_parent_classes: parse the name of the extended class and disable sealed check for those
- pdecobj.object_dec: "odt_classhelper" are changed to "odt_class" and "oo_is_classhelper" is added to the object options
- pdecl.types_dec: create class helper symbols by using "finish_classhelper"

git-svn-id: branches/svenbarth/classhelpers@16729 -
2011-01-07 21:38:56 +00:00
paul
e0e01899e5 compiler: move parse_generic_parameters to the interface of pdecl unit, move insert_generic_parameter_types to pdecl unit to access them from pdecsub (preparations for generic methods implementation)
git-svn-id: trunk@16724 -
2011-01-06 17:53:46 +00:00
paul
2599cc63bd compiler: implement generic procedural types
- store type parameter in parasymtable, push it to the symtablestack before parsing arguments and return type
  - move procedure/function declaration parsing to procvar_dec subroutine
  - don't skip parasymtable while searching types because they store type parameters now
  - add TParaSymTable.ReadOnly field to prevent adding defs into symtable. Add defs to the parent symtable in this case (we are adding this symtable to stack to read type parameters only, add defs should go to parent in this case as it was before)

git-svn-id: trunk@16719 -
2011-01-06 11:53:51 +00:00
paul
4cfcc7ae7b compiler: implement delphi generic syntax for delphi mode
git-svn-id: trunk@16705 -
2011-01-04 11:06:29 +00:00
Jonas Maebe
360d102ea4 * fixed some comments after r16684
git-svn-id: trunk@16685 -
2011-01-02 15:31:41 +00:00
Jonas Maebe
3ca3276400 * changed syntax of external objcclasses (see wiki/FPC_PasCocoa). Another
change is that it is now also allowed to specify an external name for
    formal external class definitions, but if they are later mixed with
    regular class definitions the external names have to match.
   o because the "external" status of methods is now set while parsing the
     class rather than afterwards, some procdir compatibility checks had to
     be inlined because they only have to be performed for 
  * also adapted the syntax for external cppclasses in the same way
  * fixed return type of NSObject.retainCount and NSObject.hash
    (NSUInteger instead of cint)
  * moved "patches" directory from cocoaint/src to cocoaint/utils/cocoa-skel
    so they are used by the conversion script when re-parsing the headers
  * updated Objective-C header parser script to
   o use the new external class syntax
   o not write inheritance information for root classes (NSObject, NSProxy)
   o use internal translation tables for some conflicting method names that
    are named specially in objcbase.pp
   and updated parsed headers
  * fixed rtl/inc/objcbase.pp and tests to conform to the new external class
    syntax

git-svn-id: trunk@16684 -
2011-01-02 14:50:46 +00:00
paul
55a0fefb1f compiler: implement generic array type:
- 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 -
2011-01-02 13:16:17 +00:00
Jonas Maebe
2222f2c44b * renamed is_class_or_interface_or_dispinterface_or_objc() into
is_implicit_pointer_object_type() to better indicate the purpose of
    that routine, and to avoid having to change its name every time
    a new object type with this property is added

git-svn-id: trunk@16664 -
2010-12-30 15:19:54 +00:00
paul
92d6503704 compiler: rename _EQUAL token to _EQ to prevent problems with adding delphi operator names which contains "EQUAL" name, also rename _UNEQUAL to _NE for consistency
git-svn-id: trunk@16608 -
2010-12-22 02:01:40 +00:00
paul
f3af6a83f7 compiler: put static symbol for typed consts declared in classes/records/objects into unit symtable to fix problems with linking and add absolute symbol into record symtable pointed to that static symbol (fixes test test/terecs3.pp on unixes)
git-svn-id: trunk@16588 -
2010-12-18 18:22:31 +00:00
paul
54b5172286 compiler: fix compiler crash (bug #0018222)
- don't use source pointeddef for copied tpointerdef,tclassrefdef if pointteddef is a forward def because in this case when forward def will be resolved copied def will point to garbage
  - put copied def into list of defs awaiting resolve if it was copied from forward def
  + test

git-svn-id: trunk@16575 -
2010-12-17 07:50:47 +00:00
paul
56bf42de57 compiler: implement record methods and class methods:
- rename tprocdef._class to tprocdef.struct and change the type from tobjectdef to tabstractrecorddef because methods can belong not to classes only now but to records too
  - replace in many places use of current_objectdef to current_structdef with typcast where is needed
  - add an argument to comp_expr, expr, factor, sub_expr to notify that we are searching type only symbol to solve the problem with records,objects,classes which contains fields with the same name as previosly declared type (like:
  HWND = type Handle;
  rec = record 
    hWnd: HWND;
  end;)
  - disable check in factor_read_id which was made for object that only static fields can be accessed as TObjectType.FieldName outside the object because it makes SizeOf(TObjectType.FieldName) imposible and since the same method was extended to handle records it also breaks a52 package compilation
  - rename tcallcandidates.collect_overloads_in_class to tcallcandidates.collect_overloads_in_struct and addapt the code to handle overloads in records too
  - fix searchsym_type to search also in object ancestors if we found an object symtable
  - add pd_record, pd_notrecord flags to mark procedure modifies which can or can't be used with records. Disallow the next modifiers for records: abstract, dynamic, export, external, far, far16, final, forward, internconst, internproc, interrupt, message, near, override, public, reintroduce, virtual, weakexternal,
Allow the next modifiers for records: static

git-svn-id: branches/paul/extended_records@16526 -
2010-12-09 02:24:46 +00:00
paul
8e36256bc9 compiler: add support for visibility blocks in records and type, const declarations:
- add parse_record_members function to parse record blocks based on parse_object_members code
  - disable published section in records
  - rename in_class argument in some functions to in_structure because the same code can work for records now which are not classes

git-svn-id: branches/paul/extended_records@16513 -
2010-12-07 07:40:34 +00:00
paul
433f18e60c compiler: resolve only current typeblock forward declarations when the type block is finished (fixes bug #0018086)
git-svn-id: trunk@16480 -
2010-11-30 00:02:06 +00:00
florian
d30952b408 * patch by Aleksa Todorovic which adds the ability to reference current generic class. Each reference to current generic class is "translated" to appropriate specialization of that generic class. There are two tests as part of the patch to test that it works. The patch, also, rejects declaring generic inside another generic. 0010479 is easy to implement with this patch applied, resolves #11777
git-svn-id: trunk@16423 -
2010-11-24 21:57:41 +00:00
florian
d25b6f44f0 * avoid hint about uninitialized variable for compiler generated label jump buffer in macpas mode, resolves #17842
git-svn-id: trunk@16311 -
2010-11-06 20:21:06 +00:00
florian
38b90c987b + enable non local goto in macpas mode, test/tmacnonlocalgoto.pp does not fail anymore
git-svn-id: trunk@16265 -
2010-10-30 15:23:11 +00:00
pierre
41e388ace8 * Revert rev 16108
git-svn-id: trunk@16111 -
2010-10-08 13:39:11 +00:00
pierre
1d2581b6d9 labels need to be non-local for PIC code using GOT
git-svn-id: trunk@16108 -
2010-10-08 13:16:04 +00:00
florian
24fea58b92 + initial implementation of iso style gotos in iso mode
* made setjmp/longjmp accessible to the compiler by compiler proc, they are used by the iso goto code

git-svn-id: trunk@15711 -
2010-08-05 19:20:46 +00:00
Jonas Maebe
62d677eb92 + support for formally declared objcclasses ("type x=objcclass;external;")
+ tests

git-svn-id: trunk@15476 -
2010-06-25 15:08:37 +00:00
Jonas Maebe
4847103436 * don't try to generate mangled names for methods of categories
for which the parent class hasn't been resolved yet (causes
    a crash)

git-svn-id: trunk@15429 -
2010-06-13 15:43:40 +00:00
paul
c879230f08 compiler: fix parsing and handling of typed constants declared inside classes/objects + tests
git-svn-id: trunk@15094 -
2010-03-30 07:09:44 +00:00
paul
166f8a63a2 compiler: implement class constants + tests
git-svn-id: trunk@14609 -
2010-01-11 08:43:10 +00:00
paul
91ed1c6e6f compiler: types in classes:
- fix type visibility (was always public)
  - fix parsing of class sections after the type declaration
  - allow nested classes declarations
  + tests

git-svn-id: trunk@14607 -
2010-01-11 06:22:57 +00:00
paul
3ed4c58502 compiler:
- implement class properties: properties which can access only static fields and static class methods
  - tests
  - fix a possibility to call an instance method from the class method

git-svn-id: trunk@14585 -
2010-01-09 18:37:54 +00:00
Jonas Maebe
f8754d8fab + Objective-C category support (old and new ABI, both external and
implemented in Pascal). See
    http://wiki.freepascal.org/FPC_PasCocoa#Category_declaration for syntax
    details

git-svn-id: trunk@14196 -
2009-11-16 00:12:08 +00:00
Jonas Maebe
60a9ef963d * finished basic support for calling methods from external C++ classes
(slightly modified patch by Sven Barth, mantis #15082)

git-svn-id: trunk@14185 -
2009-11-15 14:55:40 +00:00
Jonas Maebe
559e284bd0 * merged r13762-14047 from trunk
git-svn-id: branches/objc@14048 -
2009-11-04 15:50:26 +00:00
paul
e784ec1079 merge revisions 13898-13899:
- 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 -
2009-11-01 14:06:30 +00:00
Jonas Maebe
046b652c28 * don't show notes about "unused" private fields of external obj-c class
declarations (since even though they're not used in the Pascal code,
    they probably are in the Objective-C code that actually implements them)

git-svn-id: branches/objc@13764 -
2009-09-27 15:28:49 +00:00
Jonas Maebe
ab3294dce2 * fixed handling of "type x = y" for objcclass/objcprotocol
* don't allow "type x = type y" for objcclass/objcprotocol for now
    (would require generating new rtti for the new name)

git-svn-id: branches/objc@13641 -
2009-09-03 19:42:37 +00:00
Jonas Maebe
970fc43aa5 * fixed support for forward-declared objcprotocols
+ test (also for warning about missing constructor)

git-svn-id: branches/objc@13633 -
2009-09-01 13:55:14 +00:00
Jonas Maebe
5a2ccfff52 --WARNING: start build process with FPC 2.2.4; won't work when
starting with a previous 2.3.1 or compiler built from the objc branch
  + added basic objcprotocol support (only for external protocols
    currently)
     o use in type declaration: "type xp = objcprotocol ... end;"
     o when defining a root class that implements it:
       "type yc = objcclass(xp) ... end" (note: no support yet
       for something like "objcclass(id,xp)" or so)
     o when defining a non-root class that implements a protocol:
       "type zc = objcclass(nsobject,xp) ... end"
     o includes support for "required" and "optional" sections
     o no support yet for the objcprotocol(<protocol>) expression
       that enables getting a class instance representing the
       protocol (e.g., for use with "conformsToProtocol:")
     o message names have to specified in protocol declarations,
       but if an objcclass implements a protocol, the message names do
       not have to be repeated (but if they are, they have to match;
       the same goes when overriding inherited methods)
  + allow specifying the external name of Objective-C classes and
    protocols, since classes and protocols can have the same name
    (and you cannot use the same Pascal identifier in such caseq)
  + added NSObject protocol, and make the NSObject class use it
  + added missing NSObject class methods that have the same name
    as instance methods (added "class" name prefix to avoid clashes)
  * fixed several cases where the compiler did not treat Objective-C
    classes/protocols the same as Object Pascal classes/interfaces
    (a.o., forward declarations, alignment, regvars, several type
     conversions, ...)
  * allow "override" directive in objcclass declarations, and print
    a hint if it's forgotten in an external declaration (because it
    doesn't really matter there, and may make automated header
    conversion harder than necessary) and an error if will be used in
    a non-external declaration (because it is not possible to start
    a new vmt entry-tree in Objective-C, you can only override parent
    methods)
  * reject objcclasses/protocols as parameters to typeof()
  * don't try to test VMT validity of objcclasses/protocols

git-svn-id: branches/objc@13375 -
2009-07-09 20:48:28 +00:00
Jonas Maebe
b1b9894ae3 * initial Objective-C 1.0 support:
o support for declaring external Objective-C classes (see
      rtl/inc/objcbase.pas), including derived classes
    o support for converting methods of objcclasses into selectors
      (see tests/test/tobjc1.pp)
    o support for loading from/storing to fields of objcclasses
    o support for calling Objective-C methods using regular
      Object Pascal syntax (see tests/test/tobjc1.pp)
    o some things that are known to be not yet working:
      o automatic conversion from ID to objcclasses and back
      o declaring and implementing new objcclasses/methods in Pascal code
      o debug information (objcclasses are currently plain pointers
        as far as the debugger knows)

git-svn-id: branches/objc@13162 -
2009-05-17 13:42:50 +00:00
peter
af437d5beb * refactor the forward type declaration handling, remove
global typecanbeforward and move 'class of ..' parsing
    to ptype

git-svn-id: trunk@12045 -
2008-11-09 22:07:36 +00:00
Jonas Maebe
597622d313 * moved the forwardchecksyms back to symbase (but the main functionality
remains in symtable) to simplify (and fix) its memory management

git-svn-id: trunk@11772 -
2008-09-13 19:59:21 +00:00
Jonas Maebe
0b815a6fff - removed global "resolving_forward" variable (was no longer used)
* moved forward type checking from pdecl/symbase to symtable/symsym

git-svn-id: trunk@11763 -
2008-09-13 12:28:55 +00:00
florian
b178b08ba7 Merged revisions 11665-11738 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/unicodestring

........
  r11665 | florian | 2008-08-30 13:30:17 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * continued to work on unicodestring type support
........
  r11666 | florian | 2008-08-30 19:02:26 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * expectloc for wide/ansi/unicode strings is LOC_CONSTANT or LOC_REGISTER now
........
  r11667 | florian | 2008-08-30 20:42:37 +0200 (Sat, 30 Aug 2008) | 1 line
  
  * more unicodestring stuff fixed, test results on win32 are already good
........
  r11670 | florian | 2008-08-30 23:21:48 +0200 (Sat, 30 Aug 2008) | 2 lines
  
  * first fixes for unix bootstrapping
........
  r11683 | ivost | 2008-09-01 12:46:39 +0200 (Mon, 01 Sep 2008) | 2 lines
  
      * fixed 64bit bug in iconvenc.pas
........
  r11689 | florian | 2008-09-01 23:12:34 +0200 (Mon, 01 Sep 2008) | 1 line
  
  * fixed several errors when building on unix
........
  r11694 | florian | 2008-09-03 20:32:43 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * fixed unix compilation
........
  r11695 | florian | 2008-09-03 21:01:04 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * bootstrapping fix
........
  r11696 | florian | 2008-09-03 21:07:18 +0200 (Wed, 03 Sep 2008) | 1 line
  
  * more bootstrapping fixed
........
  r11698 | florian | 2008-09-03 22:47:54 +0200 (Wed, 03 Sep 2008) | 1 line
  
  + two missing compiler procs exported
........
  r11701 | florian | 2008-09-04 16:42:34 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + lazarus project for the linux rtl
........
  r11702 | florian | 2008-09-04 16:43:27 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  + set unicode string procedures
........
  r11707 | florian | 2008-09-04 23:23:02 +0200 (Thu, 04 Sep 2008) | 2 lines
  
  * fixed several type casting stuff
........
  r11712 | florian | 2008-09-05 22:46:03 +0200 (Fri, 05 Sep 2008) | 1 line
  
  * fixed unicodestring compilation on windows after recent unix changes
........
  r11713 | florian | 2008-09-05 23:35:12 +0200 (Fri, 05 Sep 2008) | 1 line
  
  + UnicodeString support for Variants
........
  r11715 | florian | 2008-09-06 20:59:54 +0200 (Sat, 06 Sep 2008) | 1 line
  
  * patch by Martin Schreiber for UnicodeString streaming
........
  r11716 | florian | 2008-09-06 22:22:55 +0200 (Sat, 06 Sep 2008) | 2 lines
  
  * fixed test
........
  r11717 | florian | 2008-09-07 10:25:51 +0200 (Sun, 07 Sep 2008) | 1 line
  
  * fixed typo when converting tunicodestring to punicodechar
........
  r11718 | florian | 2008-09-07 11:29:52 +0200 (Sun, 07 Sep 2008) | 3 lines
  
  * fixed writing of UnicodeString properties
  * moved some helper routines to unicode headers
........
  r11734 | florian | 2008-09-09 22:38:55 +0200 (Tue, 09 Sep 2008) | 1 line
  
  * fixed bootstrapping
........
  r11735 | florian | 2008-09-10 11:25:28 +0200 (Wed, 10 Sep 2008) | 2 lines
  
  * first fixes for persisten unicodestrings
........
  r11736 | florian | 2008-09-10 14:31:00 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  Initialized merge tracking via "svnmerge" with revisions "1-11663" from 
  http://svn.freepascal.org/svn/fpc/trunk
........
  r11737 | florian | 2008-09-10 21:06:57 +0200 (Wed, 10 Sep 2008) | 3 lines
  
  * fixed unicodestring <-> variant handling
  * fixed unicodestring property reading
........

git-svn-id: trunk@11739 -
2008-09-10 20:14:31 +00:00
Jonas Maebe
156acf3817 * fixed version of r11719 (faster parsing of units with lots of declarations
in many different type blocks)

git-svn-id: trunk@11722 -
2008-09-07 13:51:04 +00:00
Jonas Maebe
f35051f76e - reverted r11719, there are still some problems with it
git-svn-id: trunk@11720 -
2008-09-07 12:45:08 +00:00
Jonas Maebe
632abdace8 * keep the syms that need to be checked for forward definitions in a
separate list, so that procsyms, constsym, varsyms etc are not checked
    and so that every sym is checked only once (rather than at the end
    of every type block). This makes parsing units with lots of declarations
    much faster (e.g., compiling MacOSAll is now 2 to 3 times faster)

git-svn-id: trunk@11719 -
2008-09-07 12:24:57 +00:00
peter
6c586e4eca * store specializations in globalsymtable for units, use localsymtable
for programs. this allows speciailizations to be done in the interface
    part of the unit
  * support tobject.typemember.typemember nesting for generics
  * fix generic parameter checking when a typemember was created with the
    type of a parameter
  * known issue is nested specializations don't work yet because the token
    replay can't handled nested replays yet

git-svn-id: trunk@11404 -
2008-07-18 23:30:44 +00:00
florian
ed9c7ceaea * support deprecated for types
git-svn-id: trunk@11341 -
2008-07-07 17:59:48 +00:00
Almindor
62205d0346 * fix memory leaks in create_dwarf and types_dec procedures thanks to Giulio Bernardi's detailed report
git-svn-id: trunk@11236 -
2008-06-16 18:30:38 +00:00
Jonas Maebe
28bab3fb4f - removed some unused variables
* 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 -
2007-07-17 13:57:15 +00:00
Jonas Maebe
20a35f9701 * fixed public/export support for initialised variables/typed
constants (mantis #9113)

git-svn-id: trunk@7772 -
2007-06-22 17:10:15 +00:00
daniel
9adb202a92 * Rework the constexprint to allow operations from low(int64) to high(qword).
+ Some initial work on a formaldef which also carries the typinfo of a parameter.

git-svn-id: trunk@7639 -
2007-06-13 07:41:18 +00:00
florian
7d3d64e2ec * fixed #8156
git-svn-id: trunk@6101 -
2007-01-21 16:15:19 +00:00
pierre
31e650f98d fix another memory leak
git-svn-id: trunk@6068 -
2007-01-19 05:43:40 +00:00
florian
11aa2b483e * kicked ignore_equal, usage was wrong anyways
git-svn-id: trunk@5763 -
2006-12-31 00:48:52 +00:00
florian
28c5578976 * don't generate vmt for a generic
git-svn-id: trunk@5428 -
2006-11-19 22:07:28 +00:00
peter
9ae8e9fa21 * refactor tclassheader in tvmtbuilder and tvmtwriter
* fix rtti generation
  * rtti is now written at the end of a module when all info is available,
    this prevents some duplicate rtti entries cause by inheritance

git-svn-id: trunk@5363 -
2006-11-13 22:03:17 +00:00
peter
0557ddc342 * removed typed const, it is now handled by staticvarsym
* globalvarsym renamed to staticvarsym
  * fixed invalid regvar use in init when the finalize also uses the var

git-svn-id: trunk@5290 -
2006-11-08 21:04:22 +00:00
peter
99309202bc * don't try to generate rtti if the type has an error
git-svn-id: trunk@5271 -
2006-11-07 08:52:53 +00:00
peter
84a96d66de * move rtti and vmt table generation into write_persistent_type_info
* call write_persistent_type_info also for typed consts in interface

git-svn-id: trunk@5239 -
2006-11-05 12:40:13 +00:00
peter
3cae449fda * moved rtti to ncgrtti
git-svn-id: trunk@5219 -
2006-11-04 10:43:27 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
florian
4c76107b98 * limited generics to records, classes, objects and interfaces
git-svn-id: trunk@5171 -
2006-11-02 09:48:17 +00:00
florian
bce905b106 * give correct error locations for errors when specializing templates
* removed more germanisms
* better dumping of tokenbuf in ppudump

git-svn-id: trunk@5101 -
2006-10-30 23:28:06 +00:00
florian
ef7bd58c54 * germanism removed (aktfilepos -> current_filepos)
git-svn-id: trunk@5099 -
2006-10-30 22:37:31 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
peter
71af18855e * remove sym from ttype, we can now reference any def in any unit directly
git-svn-id: trunk@5063 -
2006-10-29 16:32:07 +00:00
florian
ca6f992504 * enabled type and var keywords in objects for generics
git-svn-id: trunk@5062 -
2006-10-29 14:20:21 +00:00
florian
91434bd791 * fixed several dispinterface parsing related stuff
git-svn-id: trunk@3373 -
2006-04-29 21:39:21 +00:00
peter
e0a62c1bf2 Merged revisions 3009 via svnmerge from
svn+ssh://peter@www.freepascal.org/FPC/svn/fpc/branches/linker/compiler

r3009 (peter)
  * support public name for typed consts

git-svn-id: trunk@3043 -
2006-03-26 18:54:19 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines

  * pass ObjectWriter to ObjectOuput

........
r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines

  * refactor asmdata

........
r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines

  * add cfi to asmdata
  * move asmlist, asmcfi, asmdata to own unit

........

git-svn-id: trunk@2932 -
2006-03-16 08:52:22 +00:00
peter
38c0ae73da Merged revisions 2775,2788-2789 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2775 | peter | 2006-03-05 22:43:30 +0100 (Sun, 05 Mar 2006) | 2 lines

  * merge ppu changes to keep ppus the same

........
r2788 | peter | 2006-03-06 12:59:14 +0100 (Mon, 06 Mar 2006) | 2 lines

  * Add TFPList and TFPObjectList

........
r2789 | peter | 2006-03-06 13:01:37 +0100 (Mon, 06 Mar 2006) | 2 lines

  * fix powerpc

........

git-svn-id: trunk@2790 -
2006-03-06 12:04:44 +00:00
peter
785550d7e3 Merged revisions 2669,2673,2677,2683,2696,2699-2702,2704,2708,2712-2715,2718,2722-2723,2728-2730,2740,2769 via svnmerge from
svn+ssh://peter@www.freepascal.org/FPC/svn/fpc/branches/linker/compiler

........
r2669 | peter | 2006-02-23 09:31:21 +0100 (Thu, 23 Feb 2006) | 2 lines

  * add compiler dir

........
r2673 | peter | 2006-02-23 17:08:56 +0100 (Thu, 23 Feb 2006) | 2 lines

  * enabled more code

........
r2677 | peter | 2006-02-24 17:46:29 +0100 (Fri, 24 Feb 2006) | 2 lines

  * pe stub and headers

........
r2683 | peter | 2006-02-25 23:13:24 +0100 (Sat, 25 Feb 2006) | 2 lines

  * section options cleanup

........
r2696 | peter | 2006-02-26 20:27:41 +0100 (Sun, 26 Feb 2006) | 2 lines

  * fixed typecasts

........
r2699 | peter | 2006-02-26 23:04:32 +0100 (Sun, 26 Feb 2006) | 2 lines

  * simple linking works

........
r2700 | peter | 2006-02-27 09:44:50 +0100 (Mon, 27 Feb 2006) | 2 lines

  * internal linker script

........
r2701 | peter | 2006-02-27 12:05:12 +0100 (Mon, 27 Feb 2006) | 2 lines

  * make elf working again

........
r2702 | peter | 2006-02-27 14:04:43 +0100 (Mon, 27 Feb 2006) | 3 lines

  * disable dwarf for smartlinking with .a
  * fix section start in new .a file

........
r2704 | peter | 2006-02-27 18:30:43 +0100 (Mon, 27 Feb 2006) | 2 lines

  * stab section fixes

........
r2708 | peter | 2006-02-28 19:29:17 +0100 (Tue, 28 Feb 2006) | 2 lines

  * basic work to merge stabs sections

........
r2712 | peter | 2006-02-28 23:17:48 +0100 (Tue, 28 Feb 2006) | 2 lines

  * unload tmodules before linking

........
r2713 | peter | 2006-02-28 23:18:51 +0100 (Tue, 28 Feb 2006) | 2 lines

  * fixed stabs linking

........
r2714 | peter | 2006-02-28 23:19:19 +0100 (Tue, 28 Feb 2006) | 2 lines

  * show code and data size

........
r2715 | peter | 2006-02-28 23:25:35 +0100 (Tue, 28 Feb 2006) | 2 lines

  * unload .stabs from objdata after it is merged

........
r2718 | peter | 2006-03-01 12:24:38 +0100 (Wed, 01 Mar 2006) | 3 lines

  * memsize/datasize cleanup
  * check for exports/resources when adding module to linker

........
r2722 | peter | 2006-03-03 09:12:20 +0100 (Fri, 03 Mar 2006) | 2 lines

  * new TObjSymbol splitted from TAsmSymbol

........
r2723 | peter | 2006-03-03 14:08:55 +0100 (Fri, 03 Mar 2006) | 2 lines

  * coff fixes after recent objsymbol changes

........
r2728 | peter | 2006-03-03 22:43:04 +0100 (Fri, 03 Mar 2006) | 2 lines

  * fixed coff writer

........
r2729 | peter | 2006-03-04 01:10:32 +0100 (Sat, 04 Mar 2006) | 2 lines

  * fix read-only opening

........
r2730 | peter | 2006-03-04 01:11:16 +0100 (Sat, 04 Mar 2006) | 2 lines

  * Read edata from DLLs, basic work

........
r2740 | peter | 2006-03-04 21:13:43 +0100 (Sat, 04 Mar 2006) | 3 lines

  * deletedef added
  * don't remove defs from index when we are already clearing everything

........
r2769 | peter | 2006-03-05 21:42:33 +0100 (Sun, 05 Mar 2006) | 4 lines

  * moved TObj classes to ogbase
  * ObjSection.SymbolRefs and SymbolDefines list
  * DLL importing

........

git-svn-id: trunk@2771 -
2006-03-05 21:10:37 +00:00
peter
092431bdd9 * fixed typecasts
git-svn-id: trunk@2697 -
2006-02-26 19:28:19 +00:00
peter
b1c66a106e * more dup id fixes
git-svn-id: trunk@2465 -
2006-02-07 07:58:37 +00:00
peter
a59690b147 * make generic basics working again
git-svn-id: trunk@2458 -
2006-02-06 09:21:08 +00:00
peter
232555904e * symtablestack cleanup and rewrite
git-svn-id: trunk@2448 -
2006-02-05 22:24:18 +00:00
peter
95879fe8a7 * basic support for generic classes
git-svn-id: trunk@2020 -
2005-12-21 10:11:15 +00:00
peter
89297d2c39 * move all stabs ($ifdef gdb) code to dbgstabs
git-svn-id: trunk@1255 -
2005-10-02 11:17:05 +00:00
peter
a3ab2053c9 * support multiple asmlabel types, renamed getlabel to
getjumplabel and added type para to getlabel for specific types
  * moved lineinfo generation from assemble and aggas to dbgstabs

git-svn-id: trunk@1120 -
2005-09-18 21:16:10 +00:00
peter
375a5add80 * rename al_debug to al_typestabs
* first write al_typestabs before other sections

git-svn-id: trunk@1054 -
2005-09-06 06:32:26 +00:00
peter
05a628447f * put typedconsts in own asmlist to prevent mixing
array and string data
  * added al_rodata
  * renamed tasmlist enum names to include al_ prefix

git-svn-id: trunk@899 -
2005-08-17 08:42:52 +00:00
Jonas Maebe
0bfe43e7cd * fixed support for anonymous class/object definitions in macpas mode
git-svn-id: trunk@753 -
2005-07-26 10:11:39 +00:00
daniel
22e89e1a42 * Proof of concept: Support threadvars using segment registers.
git-svn-id: trunk@740 -
2005-07-24 21:06:23 +00:00
peter
9cda65c4b0 * support for widestrings in tconstsym
* fix widestring writing for stringconstn

git-svn-id: trunk@646 -
2005-07-18 12:54:15 +00:00
peter
3700aa1b80 * only write vmt of objects defined in static/global symtable
to prevent IE in make_mangledname

git-svn-id: trunk@542 -
2005-06-30 13:48:56 +00:00
florian
7cd67ea3f0 * node optimizer branch merged
* gotonode and gotolabel refactored
  * -Nu added to enable for loop unrolling

git-svn-id: trunk@446 -
2005-06-19 17:42:10 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
e820bc93f2 * interface wrapper generation moved to cgobj
* generate interface wrappers after the module is parsed
2005-01-24 22:08:32 +00:00
peter
04c97cc129 * load jmp_buf_size from system unit 2005-01-20 16:38:45 +00:00
peter
87d2861f89 * fixes for win32 mangledname 2004-11-16 20:32:40 +00:00
peter
e740a66636 * tparaitem removed, use tparavarsym instead
* parameter order is now calculated from paranr value in tparavarsym
2004-11-15 23:35:30 +00:00
peter
6458bd0ce1 * tvarsym splitted 2004-11-08 22:09:58 +00:00
mazen
581b52422c - remove $IFDEF DELPHI and related code
- remove $IFDEF FPCPROCVAR and related code
2004-10-15 09:14:16 +00:00
peter
6096fe0789 * use realname in error msg 2004-09-13 20:33:17 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
peter
e46cdcea48 * constants ordinals now always have a type assigned
* integer constants have the smallest type, unsigned prefered over
    signed
2004-03-23 22:34:49 +00:00
florian
c65e094bba + implemented cdecl'd varargs on arm
+ -dCMEM supported by the compiler
  * label/goto asmsymbol type with -dextdebug fixed
2004-03-20 20:55:36 +00:00
peter
abbd54f334 * stabs updates to write stabs for def for all implictly used
units
2004-03-08 22:07:46 +00:00
daniel
4e89e4be76 * Message system uses open arrays internally
* Bugfix for string handling in array constructor node
  * Micro code reductions in pdecl.pas
2004-02-20 19:49:21 +00:00
daniel
7e3ad7e796 * No longer treat threadvar is normakl var if threading off 2004-02-17 19:37:16 +00:00
daniel
2835ed1b55 * Enable threadvars for all modes 2004-02-17 17:38:11 +00:00
peter
ee569d7817 * make extcycle is working again 2004-02-12 15:54:03 +00:00
peter
7b04fdec2e * fix compilation without GDB 2004-02-11 19:59:06 +00:00
daniel
c22f863764 * Fix stabs generation problem reported by Jonas 2004-01-31 22:48:31 +00:00
daniel
862e121a0a * Last steps before removal of aasmtai dependency in symsym can be
accomplished.
2004-01-31 18:40:15 +00:00
peter
1367e342db * reg allocations for imaginary register are now inserted just
before reg allocation
  * tregister changed to enum to allow compile time check
  * fixed several tregister-tsuperregister errors
2003-12-15 21:25:48 +00:00
marco
9b3b94883b * always generate RTTI patch from peter 2003-12-12 12:09:40 +00:00
peter
5090185909 * global property support for fpc modes 2003-12-10 16:37:01 +00:00
peter
9610911036 * don't give redefinition warning for forward classes 2003-11-12 15:48:48 +00:00
peter
6edadf3df5 * more proc directive for procvar fixes 2003-10-03 14:45:09 +00:00
peter
2bec6b14fc * procvar directive parsing fixes 2003-10-02 21:13:09 +00:00
peter
8af51ea6d3 * locals and paras are allocated in the code generation
* tvarsym.localloc contains the location of para/local when
    generating code for the current procedure
2003-09-23 17:56:05 +00:00
peter
b7d99ec934 * paraloc splitted in callerparaloc,calleeparaloc
* sparc calling convention updates
2003-07-02 22:18:04 +00:00
peter
60978ba89c * aktprocdef renamed to current_procdef
* procinfo renamed to current_procinfo
  * procinfo will now be stored in current_module so it can be
    cleaned up properly
  * gen_main_procsym changed to create_main_proc and release_main_proc
    to also generate a tprocinfo structure
  * fixed unit implicit initfinal
2003-04-27 11:21:32 +00:00
peter
7f14891d66 * aktprocdef cleanup, aktprocdef is now always nil when parsing
a new procdef declaration
  * aktprocsym removed
  * lexlevel removed, use symtable.symtablelevel instead
  * implicit init/final code uses the normal genentry/genexit
  * funcret state checking updated for new funcret handling
2003-04-27 07:29:50 +00:00
peter
d7d14b0eca * reset symbol for unique types 2003-04-01 16:17:15 +00:00
florian
07110d20f9 + added proper support of type = type <type>; for simple types 2003-01-05 15:54:15 +00:00
peter
bbf8bddbb4 * unit loading changed to first register units and load them
afterwards. This is needed to support uses xxx in yyy correctly
  * unit dependency check fixed
2002-12-29 14:57:50 +00:00
carl
6227991d96 - remove lower in hint 2002-12-05 19:27:40 +00:00
carl
6a52e7a9e5 - removed the invalid if <> checking (Delphi is strange on this)
+ implemented abstract warning on instance creation of class with
    abstract methods.
 * some error message cleanups
2002-11-25 18:43:31 +00:00
carl
60d17dbc01 * some small speed optimizations
+ added several new warnings/hints
2002-11-23 22:50:04 +00:00
carl
64655be168 * memory optimization (3-4%) : cleanup of tai fields,
cleanup of tdef and tsym fields.
  * make it work for m68k
2002-11-17 16:31:55 +00:00
peter
edbd98176b * made tasmsymbol.refs private (merged) 2002-11-15 16:29:30 +00:00
peter
41f6e26675 * removed df_unique flag. It breaks code. For a good type=type <id>
a def copy is required
2002-10-20 15:34:16 +00:00
peter
d27f79ae28 + tobjectdef.members_need_inittable that is used to generate only the
inittable when it is really used. This saves a lot of useless calls
    to fpc_finalize when destroying classes
2002-10-19 15:09:24 +00:00
peter
08c058037f * only allow threadvar when threading switch is defined 2002-10-14 19:45:02 +00:00
florian
1665fc6a60 + proper support of type <id> = type <another id>; 2002-10-06 12:25:04 +00:00
peter
a28f75ed03 * sym.insert_in_data removed
* symtable.insertvardata/insertconstdata added
  * removed insert_in_data call from symtable.insert, it needs to be
    called separatly. This allows to deref the address calculation
  * procedures now calculate the parast addresses after the procedure
    directives are parsed. This fixes the cdecl parast problem
  * push_addr_param has an extra argument that specifies if cdecl is used
    or not
2002-08-25 19:25:18 +00:00
carl
9da171faf2 + stab register indexes for powerpc (moved from gdb to cpubase)
+ tprocessor enumeration moved to cpuinfo
  + linker in target_info is now a class
  * many many updates for m68k (will soon start to compile)
  - removed some ifdef or correct them for correct cpu
2002-08-12 15:08:39 +00:00
peter
425bb45ddc * renamed current_library to objectlibrary 2002-08-11 14:32:25 +00:00
peter
ac71268ce6 * saving of asmsymbols in ppu supported
* asmsymbollist global is removed and moved into a new class
    tasmlibrarydata that will hold the info of a .a file which
    corresponds with a single module. Added librarydata to tmodule
    to keep the library info stored for the module. In the future the
    objectfiles will also be stored to the tasmlibrarydata class
  * all getlabel/newasmsymbol and friends are moved to the new class
2002-08-11 13:24:10 +00:00
florian
e7a6cd18dd * more fixes for the ppc
+ wrappers for the tcnvnode.first_* stuff introduced
2002-07-29 21:23:42 +00:00
peter
4285e99853 * internal linker
* reorganized aasm layer
2002-07-01 18:46:20 +00:00
Jonas Maebe
7a66a12e63 * fix from Florian for init/final info of forward classes 2002-06-12 13:20:29 +00:00
peter
06ebac4e27 * readded missing revisions 2002-05-18 13:34:04 +00:00
carl
21b3a10f02 + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ try to fix temp allocation (still in ifdef)
+ generic constructor calls
+ start of tassembler / tmodulebase class cleanup
2002-05-16 19:46:34 +00:00
peter
2992e1819c * removed old logs and updated copyright year 2002-05-14 19:34:38 +00:00
peter
4dcd96747e * moved entry and exitcode to ncgutil and cgobj
* foreach gets extra argument for passing local data to the
    iterator function
  * -CR checks also class typecasts at runtime by changing them
    into as
  * fixed compiler to cycle with the -CR option
  * fixed stabs with elf writer, finally the global variables can
    be watched
  * removed a lot of routines from cga unit and replaced them by
    calls to cgobj
  * u32bit-s32bit updates for and,or,xor nodes. When one element is
    u32bit then the other is typecasted also to u32bit without giving
    a rangecheck warning/error.
  * fixed pascal calling method with reversing also the high tree in
    the parast, detected by tcalcst3 test
2002-05-12 16:53:04 +00:00
peter
70ff711f73 * mangledname rewrite, tprocdef.mangledname is now created dynamicly
in most cases and not written to the ppu
  * add mangeledname_prefix() routine to generate the prefix of
    manglednames depending on the current procedure, object and module
  * removed static procprefix since the mangledname is now build only
    on demand from tprocdef.mangledname
2002-04-19 15:46:01 +00:00
peter
4b2aa039e6 * allow oridinal labels again 2002-03-04 17:54:59 +00:00
florian
b60666ae1f + parasym to tparaitem added 2001-12-06 17:57:33 +00:00
peter
e37dbf904d * calling convention rewrite 2001-10-25 21:22:32 +00:00
marco
82465bc078 * Don't parse proc directives after type renaming of procvars 2001-10-24 10:26:53 +00:00
peter
7781fca6bd * read only typed const support, switch $J- 2001-10-20 20:30:20 +00:00
peter
17d6dded66 * interface 2 guid support
* guid constants support
2001-10-20 19:28:37 +00:00
peter
e417ee0e7f * fixed generation of rtti for virtualmethods 2001-10-20 17:20:13 +00:00
michael
387ad2c42e * realname updated for some hints
* realname used for consts,labels
2001-09-19 11:06:03 +00:00
peter
915b5cd7a9 * split constsym.value in valueord,valueordptr,valueptr. The valueordptr
is used for holding target platform pointer values. As those can be
    bigger than the source platform.
2001-09-02 21:18:28 +00:00
peter
f88f6eb571 * rtti/init table updates
* rttisym for reusable global rtti/init info
  * support published for interfaces
2001-08-30 20:13:52 +00:00
peter
f86ce17588 + hint directive parsing support 2001-06-03 21:57:35 +00:00
florian
05cfc07952 * some more support for widechars commited especially
regarding type casting and constants
2001-05-08 21:06:30 +00:00
peter
a7cf57524e * symtable change to classes
* range check generation and errors fixed, make cycle DEBUG=1 works
  * memory leaks fixed
2001-04-13 01:22:06 +00:00
peter
b193bf7df3 * remove unnecessary calls to firstpass 2001-04-04 22:43:50 +00:00
florian
64d7d5682e * applied several fixes to get the DD8 Delphi Unit compiled
e.g. "forward"-interfaces are working now
2001-04-04 21:30:42 +00:00
peter
4e2655cdc5 * resulttype rewrite 2001-04-02 21:20:29 +00:00
peter
d8abf76f6b * getsym redesign, removed the globals srsym,srsymtable 2001-03-11 22:58:49 +00:00
peter
32b9cdb7cf + new tlinkedlist class (merge of old tstringqueue,tcontainer and
tlinkedlist objects)
2000-12-25 00:07:25 +00:00
Jonas Maebe
c91a23c27d * new constant handling: from now on, hex constants >$7fffffff are
parsed as unsigned constants (otherwise, $80000000 got sign extended
    and became $ffffffff80000000), all constants in the longint range
    become longints, all constants >$7fffffff and <=cardinal($ffffffff)
    are cardinals and the rest are int64's.
  * added lots of longint typecast to prevent range check errors in the
    compiler and rtl
  * type casts of symbolic ordinal constants are now preserved
  * fixed bug where the original resulttype wasn't restored correctly
    after doing a 64bit rangecheck
2000-12-07 17:19:42 +00:00
florian
b9796f6a7f * unused units removed from uses clause
* some changes for widestrings
2000-11-29 00:30:30 +00:00
peter
e0a874dc4f * some realname updates for messages 2000-11-12 22:17:46 +00:00
peter
f39e236aa2 * allow far directive for pointer type declarations 2000-11-11 16:19:11 +00:00
florian
51527ba1c9 + merged Attila's changes for interfaces, not tested yet 2000-11-04 14:25:19 +00:00
peter
451723647e * symtable splitted, no real code changes 2000-10-31 22:02:46 +00:00
peter
e171f341a0 * moehrendorf oct 2000 rewrite 2000-10-14 10:14:45 +00:00
peter
5218af7926 * delphi compile fixes 2000-09-24 21:19:48 +00:00
peter
a71e44ac49 * use defines.inc 2000-09-24 15:06:10 +00:00
florian
6159f4535f + first implementation of Netware Module support, thanks to
Armin Diehl (diehl@nordrhein.de) for providing the patches
2000-09-11 17:00:22 +00:00
peter
bec1c5cdf9 * store strings with case in ppu, when an internal symbol is created
a '$' is prefixed so it's not automatic uppercased
2000-08-27 20:19:38 +00:00
peter
4c94659743 * moved some util functions from globals,cobjects to cutils
* splitted files into finput,fmodule
2000-08-27 16:11:48 +00:00
peter
8bd87aafd6 * don't allow forward class in separate type blocks for delphi (merged) 2000-08-20 15:01:17 +00:00
pierre
a39590e684 * fix go32v2 cycle problem 2000-08-17 09:17:19 +00:00
peter
7eaac1706d * splitted namedobjectitem.next into indexnext and listnext so it
can be used in both lists
  * don't allow "word = word" type definitions (merged)
2000-08-16 18:33:53 +00:00
peter
25c495dd5a * put defaultpara values in parast and changed the name to
'def<Parameter name>'
2000-08-13 13:11:28 +00:00
peter
8352fb6d7d * support absolute refering to funcret (merged) 2000-08-13 08:42:59 +00:00
peter
227e983397 * first things for default parameters 2000-08-02 19:49:58 +00:00
peter
c5da6c53fd * merged fixes 2000-07-30 17:04:43 +00:00
michael
2949824a69 + Patch to 1.1 2000-07-14 05:11:48 +00:00
michael
665c1f6410 + patched to 1.1.0 with former 1.09patch from peter 2000-07-13 12:08:24 +00:00
michael
650fbb86aa + removed logs 2000-07-13 11:32:24 +00:00
michael
e7aca136a1 + Initial import 2000-07-13 06:29:38 +00:00
pierre
74f131b173 * fix for bug #1023 2000-07-03 13:26:48 +00:00
pierre
36f461db33 * align all variants to same start address 2000-06-23 21:34:09 +00:00
peter
de1083a9ed * reset current_object_option when reading other symtables than
object declarations
2000-06-23 20:14:39 +00:00
peter
d55672bd95 * C record packing fixed to also check first entry of the record
if bigger than the recordalignment itself
  * variant record alignment uses alignment per variant and saves the
    highest alignment value
2000-06-18 18:11:32 +00:00
peter
69109b8234 * support procvar directive without ; before the directives 2000-06-11 06:59:36 +00:00
peter
14d248a322 * checking for dup id with para of methods fixed for delphi mode 2000-06-09 21:34:40 +00:00