Commit Graph

33096 Commits

Author SHA1 Message Date
paul
742b0bb686 compiler: partly revert r16560 and disable (at least temporary) constructors in records
git-svn-id: branches/paul/extended_records@16568 -
2010-12-16 03:37:16 +00:00
paul
8c56269076 compiler: fix record constructor return type when parsing procedure declaration
git-svn-id: branches/paul/extended_records@16562 -
2010-12-13 07:04:56 +00:00
paul
726ea27bc0 compiler:
- add mode switch extendedrecords to allow/disallow extended records syntax, add this mode switch to delphi mode by default
  - disable/enable extended records parsing based on extendedreocrds mode switch

git-svn-id: branches/paul/extended_records@16561 -
2010-12-13 07:03:53 +00:00
paul
11d4eddf67 compiler: a trial to implement record constructor
- map self to constructor result
  - don't push vmt for records

At the moment generated assembler has errors although node tree is correct

git-svn-id: branches/paul/extended_records@16560 -
2010-12-13 06:39:29 +00:00
paul
582ab2dd32 compiler: disallow regular class methods in records and allow only static class methods. delphi do so and it is logical because records have no inheritance. + tests
git-svn-id: branches/paul/extended_records@16550 -
2010-12-11 10:21:09 +00:00
paul
17815ce7a2 compiler: implement properties in records:
- rename property_dec from pdecobj to struct_property_dec because pdecl also has property_dec and move it to interface to use by records + allow properties for records
  - use struct_property_dec in record parser
  - change structh type from objectdef to abstractrecorddef in read_property_dec to use by records
  - disallow stored and default modifiers for records because records are not used for streaming
  - fix misuse of search_sym_in_class for records in few places

git-svn-id: branches/paul/extended_records@16548 -
2010-12-11 08:42:26 +00:00
paul
69d3bb2ffc compiler: rename aclass->astruct in read_property_dec because records will have properties too
git-svn-id: branches/paul/extended_records@16547 -
2010-12-11 08:08:22 +00:00
paul
4c7e2679df tests: add a test which checks that records destructors are not allowed
git-svn-id: branches/paul/extended_records@16546 -
2010-12-11 07:58:14 +00:00
paul
52cd624a76 compiler: fix static fields creation and access for records
+ extend test to check class constructor/destructor for records and static fields access

git-svn-id: branches/paul/extended_records@16545 -
2010-12-11 07:48:13 +00:00
paul
7852295f26 compiler: start parsing of record constructors and destructors:
- disallow record destructor
  - raise internal error for constructor because it is not yet implemented
  - handle class constructors and destructors for records
  - move find_procdef_bytype to tabstractpointerdef

git-svn-id: branches/paul/extended_records@16544 -
2010-12-11 07:31:27 +00:00
paul
4e73e280f9 compiler: move constructor, destructor parsers to interface section to allow future use by records + change current_objectdef to current_structdef for the same reason, make constructor return type = record for records
git-svn-id: branches/paul/extended_records@16543 -
2010-12-11 07:29:08 +00:00
paul
289c9bd192 compiler: remove unneeded checks and typecasting caused by move of objectoptions into tabstractrecorddef
git-svn-id: branches/paul/extended_records@16542 -
2010-12-11 07:00:46 +00:00
paul
4f274b157c compiler: move objectoptions to tabstractrecorddef because it will be needed for records too
git-svn-id: branches/paul/extended_records@16541 -
2010-12-11 06:48:08 +00:00
paul
4640d096c4 compiler: redo searchsym_type:
- remove complex condition which was used previosly to decide whether objectsymtable or recordsymtable requires a search for type or not - they require a search because contains types (although not all object types)
  - don't search only for typesym but for other symbols too - for example UnitSym.TypeSym or ConstSym..ConstSym are also valid types. Skip the next symtypes during the search because they can't be used in type declaration: fieldvarsym, paravarsym, propertysym, procsym, labelsym

git-svn-id: branches/paul/extended_records@16531 -
2010-12-10 09:12:44 +00:00
paul
b317139006 compiler: fix compilation problems caused by tprocdef._class -> tprocdef.struct rename which was found by make fullcycle
git-svn-id: branches/paul/extended_records@16530 -
2010-12-10 06:50:58 +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
26cef34005 compiler:
- 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 -
2010-12-08 06:58:48 +00:00
paul
d7c8d9e620 compiler: allow access other record symbols than fields, first extended records tests
git-svn-id: branches/paul/extended_records@16516 -
2010-12-07 09:53:57 +00:00
paul
902a78eec1 compiler: add current_structdef: tabstractrecorddef and point current_objectdef to it
git-svn-id: branches/paul/extended_records@16515 -
2010-12-07 09:35:10 +00:00
paul
5d1c9ab6ba compiler: check visibility of record members, allow access to record consts and types:
- add searchsym_in_record function
  - change is_visible_for_object to accept tabstractrecorddef instead of tobjectdef arguments because records also have visibility sections now
  - change arguments in do_member_read, do_proc_call to tabstractrecorddef from tobjectdef to accept records
  - rename classh arguments to structh and change their type to tabstractrecorddef to show that they can accept records now too
  - move RttiName from tobjectdef to tabstractrecorddef

git-svn-id: branches/paul/extended_records@16514 -
2010-12-07 08:58:29 +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
9a6ae5ef6d create a branch for extended records implementation
git-svn-id: branches/paul/extended_records@16512 -
2010-12-06 06:28:29 +00:00
Jonas Maebe
f8369032da * same fixes as in r16255 for x86_64 (fixes webtbs/tw17714 on Darwin/x86_64)
git-svn-id: trunk@16508 -
2010-12-05 16:45:31 +00:00
paul
3e5f6e7a60 compiler: reduce the overhead made in previous revision
git-svn-id: trunk@16507 -
2010-12-05 14:32:05 +00:00
marco
1c0e482d7d * patch for regex. Fixes exception in rcclear, some casing issues and matching of \w. Also a fix for currentpos in the old version. Mantis 15466
git-svn-id: trunk@16506 -
2010-12-05 11:10:06 +00:00
paul
af39178e06 compiler: redo type search in parent classes. previous trial breaks objective pascal implementation
git-svn-id: trunk@16505 -
2010-12-05 10:59:11 +00:00
marco
69c89d4579 * more tcustomvariant conversion helpers from Lacak2. Mantis 16853
git-svn-id: trunk@16504 -
2010-12-04 20:21:03 +00:00
marco
b1f1c026f8 * enabled cnetdb for Linux, added a demo
git-svn-id: trunk@16503 -
2010-12-04 17:18:05 +00:00
sergei
b8aec6e4aa + Support for UnicodeString in variant conversions, based on patch from Ivan Shikhalev, resolves #18083.
git-svn-id: trunk@16502 -
2010-12-04 03:53:28 +00:00
marco
a1ebbdcee1 * compiles again ( .logger.info references changes to application.log())
git-svn-id: trunk@16501 -
2010-12-03 22:18:05 +00:00
michael
413dcde4aa * Made used SQLLite library name configurable
git-svn-id: trunk@16500 -
2010-12-03 08:59:20 +00:00
michael
627bc7f73b * Forgot to commit constants used in sqldb logging
git-svn-id: trunk@16499 -
2010-12-03 08:37:03 +00:00
michael
0ca7ca5517 * Logging facilities implemented
git-svn-id: trunk@16498 -
2010-12-02 17:35:42 +00:00
florian
34dc727f0b + test for last commit
git-svn-id: trunk@16497 -
2010-12-02 17:32:48 +00:00
florian
9dc584efbf * patch by Aleksa Todorovic to solve another issue with nested generics, resolves #17193
git-svn-id: trunk@16496 -
2010-12-02 17:32:19 +00:00
florian
07e3232fef o patch for OpenCL package by Denis Golovan, resolves #18119
+ A constant for querying OpenCL version is added.
  + A small function for converting errors code into error texts is added.

git-svn-id: trunk@16495 -
2010-12-02 17:15:21 +00:00
paul
8b209be7e9 compiler: put static variables into unit level and not into parent class/object/record (fixes bug #0018131)
git-svn-id: trunk@16494 -
2010-12-02 05:56:13 +00:00
paul
ab4a5c74c1 compiler: allow TFoo.TBar types for object methods (bug #0018123)
git-svn-id: trunk@16493 -
2010-12-02 03:53:02 +00:00
paul
515c99cc01 compiler: cleanup
git-svn-id: trunk@16492 -
2010-12-02 03:06:01 +00:00
paul
2155dadf5e compiler: push to the stack not only nested hierarchy but also class hierarchy for each nested entry both in method declaration and for method body, also push child hierarchy while parsing object members because in other case parent types are invisible for descendants (fixes mantis #0018124, mantis #0018127 and more) + extended test
git-svn-id: trunk@16491 -
2010-12-02 03:04:23 +00:00
paul
37179a6558 compiler: cleanup
git-svn-id: trunk@16490 -
2010-12-01 08:19:32 +00:00
paul
668cd1f3c0 compiler: change check for current in try_consume_unitsym - don't use current_unit in check because specialize code does not replace this variable (fixes bug #0015591)
git-svn-id: trunk@16489 -
2010-12-01 08:18:51 +00:00
paul
d9a43f7858 compiler: cleanup
git-svn-id: trunk@16488 -
2010-12-01 07:40:09 +00:00
paul
ba75daa50d compiler: change find_module_from_symtable to support not only unit symtables but also other symtables with valid moduleid (fixes bug #0016090)
git-svn-id: trunk@16487 -
2010-12-01 04:33:47 +00:00
marco
c9c1179b00 * Initial variantop and compare handlers. Patch from Laaca, bug #16853
git-svn-id: trunk@16486 -
2010-11-30 20:49:46 +00:00
joost
191e83cb7e * Patch from Darius Blaszijk to support version numbers with less then three digits, bug #17833
git-svn-id: trunk@16484 -
2010-11-30 13:51:01 +00:00
Jonas Maebe
4ed666afab * reverted r8795 that saved/set/restored the fpu exception mask before
every glut call, since the gl unit (on which the glut unit depends)
    already globally disables all fpu exceptions now (mantis #18107)

git-svn-id: trunk@16483 -
2010-11-30 12:28:03 +00:00
marco
9534c5bd8b * Delphi XE (2010?) compatible alias for defaultformatsettings.
* deprecated separate globals (Delphi XE). Causes some deprecated
      warnings in dati.inc that still have to be fixed.

git-svn-id: trunk@16482 -
2010-11-30 09:49:19 +00:00
paul
26032c3574 test: add { %norun } directive to tw12249
git-svn-id: trunk@16481 -
2010-11-30 08:14:31 +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