Commit Graph

33195 Commits

Author SHA1 Message Date
svenbarth
18ed600cbe Added 36 tests (tchlp*.pp) and some units (uchlp*).
git-svn-id: branches/svenbarth/classhelpers@16730 -
2011-01-07 21:56:35 +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
svenbarth
05af7e7c0e Started branch for class helpers
git-svn-id: branches/svenbarth/classhelpers@16638 -
2010-12-25 11:50:25 +00:00
paul
c0c7e40b65 compiler: allow Inc, Dec, Explicit operators for other fpc modes
git-svn-id: trunk@16637 -
2010-12-25 11:31:07 +00:00
paul
66b128efb3 compiler: map delphi Implicit operator to := operator of FPC, add Explicit operator for delphi only (for now) which works when explicit type conversion happens + extend test
git-svn-id: trunk@16636 -
2010-12-25 11:08:02 +00:00
sergei
2ff5f7a000 * For object fullrtti, add a parent 'field' regardless of whether its type needs inittable.
git-svn-id: trunk@16635 -
2010-12-24 16:20:44 +00:00
Jonas Maebe
814658847e * fixed comments for some comments, they were offset by one line (patch by
Dmitry Boyarintsev, mantis #17486)

git-svn-id: trunk@16634 -
2010-12-24 15:58:41 +00:00
Jonas Maebe
780e75bfac o patch by Jeppe Johansen to fix mantis #17472:
* generate add.w instead of add for thumb-2 in case one of the registers
      is > r8
    * add register interferences for the "add" instruction so the register
      allocator can detect invalid instruction forms (even for assembler code)
    * fixed error in thumb2.inc detected by the previous change

git-svn-id: trunk@16633 -
2010-12-24 15:54:39 +00:00
sergei
8cbef5627e Fixed rtti/finalization of objects that have ancestors and fields of managed types:
* Link rtti to ancestor by writing rtti of ancestor as a field of type tkObject and offset zero. This is a cheat from formal point of view (as it replaces inheritance with aggregation), but is fine for the intended purpose of representing memory layout. Now RTL can handle entire instance of descendant object, and such objects can be statically allocated without leaks.
* Bypass finalization in inherited object destructors, as the instance is now entirely finalized in outermost destructor.
+ test

git-svn-id: trunk@16632 -
2010-12-24 14:46:29 +00:00
paul
cdca5f42b7 compiler: extend internal error 200305061 check for records
git-svn-id: trunk@16630 -
2010-12-24 09:27:34 +00:00
paul
4531e1231b compiler: implement Inc, Dec class operators
- extend tok2node array to store inline function number for the case when nodetype = inlinen, add Inc, Dec operators to array
 - implement inline function support in isunaryoverloaded
 - check for operator overload if Inc, Dec is not used for standard types
 - extend test to check Inc,Dec operators

git-svn-id: trunk@16629 -
2010-12-24 09:26:52 +00:00
paul
d62ad56b74 tests: forgot to add { %fail} directive
git-svn-id: trunk@16628 -
2010-12-24 07:36:01 +00:00
paul
8c8c1fc151 compiler:
- parse operator return type the same way as we parse function return type - which pushing structures into the symtable and allowing self references, 
  - this change allows class operators to have return type = structure where they are defined
  - extend test to check LogicalNot operator which can be finally compiled now

git-svn-id: trunk@16627 -
2010-12-24 07:22:48 +00:00
paul
3c6fde4acc compiler: rename parser_e_constructors_always_objects message to parser_e_only_methods_allowed and extended the meaning it has, don't allow class constructors to be declared outside the class/record + test
git-svn-id: trunk@16626 -
2010-12-24 06:41:41 +00:00
paul
714c4164ad tests: add also test for +,-,or,xor,and operators
git-svn-id: trunk@16625 -
2010-12-24 06:05:17 +00:00
paul
b811f1be15 compiler: implement delphi style class operators:
- add delphi operator tokens into token enum
  - move optoken search from parse_proc_dec to parse_proc_head and add delphi operator name search
  - map delphi operators to existent fpc operators and skip some delphi operators for now
  - implement store operators in record symtable and search in it

git-svn-id: trunk@16624 -
2010-12-24 05:43:36 +00:00
paul
525f4fea43 compiler: prepare collect_overloads_in_struct to work with operators, replace tprocsym argument in proc_add to tsymtable because tprocsym is only used to get the symtable
git-svn-id: trunk@16623 -
2010-12-24 03:17:43 +00:00
paul
d97cf8ed9d compiler: implement IN operator which was known by compiler but was not supported. + test
git-svn-id: trunk@16622 -
2010-12-24 02:25:22 +00:00
marco
9c4675def5 * cleaning out use of old endianess routines (these are centralized in system since 2.0.x days)
git-svn-id: trunk@16621 -
2010-12-23 20:38:56 +00:00
Jonas Maebe
067536f8da * pass large "const" record parameters by reference for non-cdecl/cppdecl
(mantis #17442)

git-svn-id: trunk@16620 -
2010-12-23 16:11:06 +00:00
Jonas Maebe
d10f46ec59 * skip instructions containing a reference with a segment prefix (fixes
mantis #18113)

git-svn-id: trunk@16619 -
2010-12-23 15:24:29 +00:00
Jonas Maebe
c8115921f1 * fixed comment typo
git-svn-id: trunk@16618 -
2010-12-23 15:14:30 +00:00
paul
22ddd23d03 compiler: fix error in overloaded_names array. "In" operator has "is" name and vice versa. Add token in comment for each overloaded_names entry to prevent similar errors in future.
git-svn-id: trunk@16617 -
2010-12-23 06:44:47 +00:00
marco
b6a8fb8a5b * fix for 10758, additional terminal type checked (udev)
git-svn-id: trunk@16616 -
2010-12-22 21:20:51 +00:00
marco
49c76bdbfd * bug #8004. disable ok button if length(texttosearch)=0 in find dialog
git-svn-id: trunk@16615 -
2010-12-22 21:12:27 +00:00
marco
1b107bb4a5 * switch IDE to external linker on win32/64 for now (mingw linking compat)
git-svn-id: trunk@16614 -
2010-12-22 19:27:09 +00:00
marco
eed9b88f20 * Modified hint for search/replace again to show what will be done. bug #0010715
git-svn-id: trunk@16613 -
2010-12-22 18:39:13 +00:00
sergei
cd1f8e14f4 * TRTTIWriter improvements:
* Emit typename for Variants (Delphi compatible)
  * For objects, write record-style RTTI instead of class-style. Objects cannot have published symbols, so class-style RTTI for them is always empty, thus typeinfo() was returning a useless stub. The new behavior is closer to Delphi, but still different (Delphi typeinfo() returns pointer to what is initrtti in FPC, while we return fullrtti).

git-svn-id: trunk@16612 -
2010-12-22 14:45:40 +00:00
sergei
b50cf9a42a * TRTTIWriter.fields_write_rtti_data: refactoring. Since TAsmList allows random access, a separate loop iteration to count fields is redundant. Simply count the actually written fields, then insert result before field data.
git-svn-id: trunk@16611 -
2010-12-22 12:42:16 +00:00
Jonas Maebe
ce93333bda * fixed end of LaTeX environment after r16574 (mantis #18286)
git-svn-id: trunk@16610 -
2010-12-22 09:29:03 +00:00
paul
bf3c098c18 compiler: check that records methods have implementation too. previously check worked only for some object types
git-svn-id: trunk@16609 -
2010-12-22 03:40:04 +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
sergei
b3aa9ac813 * Refactored TRTTIWriter by separating some commonly used code into procedures. Improves readability and reduces amount of typing; functionality stays unchanged.
git-svn-id: trunk@16607 -
2010-12-21 22:33:48 +00:00
marco
6f1f310ee9 * fix | separator char. Bug 6262D
git-svn-id: trunk@16606 -
2010-12-21 19:30:12 +00:00
marco
de5ca33983 * fix one of two issues in mantis 6326, double click on watch entry invokes edit watch
git-svn-id: trunk@16604 -
2010-12-21 08:15:31 +00:00
paul
8c0c614d5a compiler: allow <> operator overload. search for "<>" operator first for "<>" expressions and if not found then use "=" operator + test
git-svn-id: trunk@16603 -
2010-12-21 04:44:37 +00:00
marco
cd4425aa58 * patch from Lacak2, use dbconst for errormessage, mantis #0018161
git-svn-id: trunk@16602 -
2010-12-20 15:51:39 +00:00
Tomas Hajny
934ab56c0a + most of OS/2 threading support implemented; not debugged yet though
git-svn-id: trunk@16601 -
2010-12-19 22:05:05 +00:00
marco
5f3a312d1b * paleobug solved, paste from windows now wraps lines to 200 char. Solves #4943
git-svn-id: trunk@16600 -
2010-12-19 21:59:21 +00:00
michael
9e0b67a2cb * Support for multiple directories.
git-svn-id: trunk@16599 -
2010-12-19 20:40:37 +00:00
Jonas Maebe
cec5843f95 * renamed objcdef.addencodedtype to objcaddencodedtype for consistency
reasons, and to prevent name clashes

git-svn-id: trunk@16598 -
2010-12-19 19:37:47 +00:00
Tomas Hajny
9b79fb3ac9 * avoid range error for sem_indefinite_wait - fix for web bug #18263 (EMX target)
git-svn-id: trunk@16595 -
2010-12-19 15:38:54 +00:00
Tomas Hajny
87c53a6e29 * Sem_Indefinite_Wait constant changed to avoid range check errors - fix for web bug #18263
git-svn-id: trunk@16594 -
2010-12-19 15:34:33 +00:00
sergei
331a72c8d6 * ncnv.pas, insert_varargstypeconv(): Do not cast a string literal to AnsiString if it has been already casted to Wide/UnicodeString, resolves #18266.
git-svn-id: trunk@16593 -
2010-12-19 15:08:42 +00:00
marco
cf49795f9e * fix for mantis 15820, override getnamepath as suggested by Paul.
git-svn-id: trunk@16592 -
2010-12-19 13:22:46 +00:00
marco
fce3a5ca30 * patch from Darius that makes lower verbosity output more FPC language independant using -vq. Mantis #18051
git-svn-id: trunk@16591 -
2010-12-19 13:17:27 +00:00
paul
0f15d89f0a compiler: formatting
git-svn-id: trunk@16590 -
2010-12-19 12:45:20 +00:00
sergei
49e3c30bd1 * Changed the test so it uses typecasting instead of calling the conversion helpers from VarUtils.
git-svn-id: trunk@16589 -
2010-12-18 18:43: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
marco
c57c039362 * Update syntaxhighlight settings on desktop load. Partial fix for 5813.
git-svn-id: trunk@16587 -
2010-12-18 18:03:31 +00:00