Commit Graph

4665 Commits

Author SHA1 Message Date
svenbarth
dbc410de63 Allow the usage of a generic's name without type arguments inside of nested classes inside the generic. This fixes Mantis #19499, but also Mantis #18688.
* symtable.pas:
    + add function "get_generic_in_hierarchy_by_name" which returns a def with the name of the symbol in the given object/record hierarchy (useful only in non-Delphi modes)
    + add function "return_specialization_of_generic" which returns the specialization def of a given class inside the given object/record hierarchy
* pexpr.pas, factor, factor_read_id: instead of checking whether the names of the found symbol and the current_structdef are equal, check whether the generic appears in hierarchy of current_structdef
* ptype.pas:
    * id_type: check whether the found symbol is a generic dummy and we are currently parsing a generic then return the correct def of the generic instead of the dummy one
    * single_type: when using the generic type without type parameters the def must resolve to the specialized def when specializing the class instead of the generic def which the dummy symbol points to
    * read_named_type, expr_type: like in "single_type" we need to resolve the use of the parameterless type name to the correct specialization def instead of the generic def
* pdecobj.pas, object_dec: also set the typesym of the current_structdef as otherwise some assumptions about generics with the above mentioned changes aren't valid anymore (like the def the typesym is unset again afterwards)
+ add tests for both bug reports (the one for 19499 is slightly modified so that it does not contain any errors)

git-svn-id: trunk@21361 -
2012-05-22 12:19:11 +00:00
Jonas Maebe
1ec48299cf * allow default() on Objective-C classes and protocols: the compiler already
allows it, and they're plain pointer-based types -> nil is fine

git-svn-id: trunk@21360 -
2012-05-22 11:07:05 +00:00
Jonas Maebe
78bb3e323a * fixed source type information for values loaded in arrayconstructor after
r21069

git-svn-id: trunk@21350 -
2012-05-20 20:34:14 +00:00
florian
21573f50c5 * allow LOC_CONSTANT to be used as vmt pointers in the cg, resolves #21914
git-svn-id: trunk@21349 -
2012-05-20 19:02:36 +00:00
pierre
02f8739bca Fix win32 compilation
git-svn-id: trunk@21346 -
2012-05-20 17:03:01 +00:00
Jonas Maebe
eb7e192226 * support pointer constants as initialisation values for procvar typed
constants in Delphi mode on non-treetypedconstbuilder platforms
    (mantis #21267)

git-svn-id: trunk@21344 -
2012-05-20 14:51:15 +00:00
marco
90adaeb652 * routine to transform result of fpsystem to old "shell" convention added.
git-svn-id: trunk@21341 -
2012-05-20 11:29:22 +00:00
florian
1294ea4357 * patches by Max Nazhalov to solve some issues with currency formatting, resolves #18704 and #22063
git-svn-id: trunk@21339 -
2012-05-19 14:54:46 +00:00
florian
6c8eed21c4 + implement auto inlining (-Ooautoinline)
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used

git-svn-id: trunk@21335 -
2012-05-19 13:30:02 +00:00
marco
7ae1db2e01 * replaced deprecated shell by fpsystem.
git-svn-id: trunk@21327 -
2012-05-19 09:00:37 +00:00
svenbarth
fb3777b9a0 + add test for Mantis #19511 which seems to be fixed already...
git-svn-id: trunk@21315 -
2012-05-17 08:59:50 +00:00
paul
4312aa4e08 compiler: allow compiler to find real class definition during class members parse to handle references to self constants + test
git-svn-id: trunk@21290 -
2012-05-14 04:50:49 +00:00
paul
62a91ef626 compiler: don't search symbol in other symtables than in found nested class, fix wrong test + add another one
git-svn-id: trunk@21275 -
2012-05-12 08:21:50 +00:00
paul
62b59235ca compiler: fix accessing typed constants inside class declaration (bug #21941)
git-svn-id: trunk@21273 -
2012-05-12 01:09:56 +00:00
svenbarth
810bd7ddab + symtable.pas, tspecializesymtable.create: SymList and DefList do not need to own the symbols and defs as they are moved to another symtable before the specialize symtable is destroyed (avoids the need to call "extract" on those lists)
* pgenutil.pas, generate_specialization: Correctly change the ownership of extracted symbols and defs by calling ChangeOwner on the symbol/def which does all the magic of changing the owner and adding it to the corresponding list of the given symtable. This fixes Mantis #21550
* Adjusted tw21550.pp so that it enforces the generation of debug information which (as this was the option which caused the above mentioned bug to show)

git-svn-id: trunk@21270 -
2012-05-10 06:27:32 +00:00
svenbarth
4fc7515591 * pdecsub.pas, parse_proc_dec: always parse operator overload heads as block type bt_body so that operators like ">", "=>" or "<>" are resolved to the correct tokens ("<>" would be a sequence of "_LSHARPBRACKET _RSHARPBRACKET" instead of _NE otherwise). Fixes Mantis #21127
git-svn-id: trunk@21266 -
2012-05-09 12:32:34 +00:00
svenbarth
5b1b194b47 * pdecvar.pas, read_record_fields: don't generate BSS-data for generic static fields (doesn't fix any specific bug, but we don't need space reserved for the field)
* pgenutil.pas, generate_specialization: fix a stupid "don't iterate upwards if deleting/extracting" mistake (twice!); this fixes Mantis #21550 and Mantis #21654 (tests added)

git-svn-id: trunk@21251 -
2012-05-08 07:31:37 +00:00
Jonas Maebe
f8c815b3db * print expected output when an error occurs, rather than two times the
actual output

git-svn-id: trunk@21250 -
2012-05-07 12:55:57 +00:00
Jonas Maebe
50d2fa7134 * after changing a modeswitch, only change related module/localswitches that
depend on the modeswitch that was just changed (so that e.g. changing
    the nested procvars setting has no effect on the state of $h+/$h-)
    (mantis #21951)

git-svn-id: trunk@21247 -
2012-05-06 14:56:49 +00:00
florian
69ce5fa66b * patch by Max Nazhalov to improve real2str performance, resolves #21825
git-svn-id: trunk@21236 -
2012-05-05 18:29:32 +00:00
paul
923e939170 tests: use known to compiler codepage since it crashes in other case
git-svn-id: trunk@21206 -
2012-05-03 07:03:19 +00:00
paul
098227a9a0 tests: mark test as should fail
git-svn-id: trunk@21205 -
2012-05-03 06:47:42 +00:00
paul
a70eb8ae0e test: fix typo
git-svn-id: trunk@21202 -
2012-05-03 06:10:17 +00:00
paul
9127442c97 tests: fix test for systems with WideString=UnicodeString
git-svn-id: trunk@21201 -
2012-05-03 03:32:36 +00:00
paul
5217b7011b tests: add test to check overload precedence for ShortString type passed to other string types
git-svn-id: trunk@21192 -
2012-05-02 08:45:54 +00:00
paul
548cdece84 tests: add test to check overload precedence for AnsiString type passed to other string types
git-svn-id: trunk@21191 -
2012-05-02 02:52:10 +00:00
paul
50ddd16619 tests: add string constant overload precedence tests when default string type is UnicodeString
git-svn-id: trunk@21190 -
2012-05-02 02:34:12 +00:00
Jonas Maebe
5e6aaccca9 * removed spaces from empty line at start to prevent (unpatched) dbdigest
from crashing

git-svn-id: trunk@21150 -
2012-04-30 20:13:09 +00:00
Jonas Maebe
9e0bc92b88 * prevent crash in dotest in case a test file contains a line at the start
with only whitespace on it (such as webtbf/tw21873.pp)

git-svn-id: trunk@21119 -
2012-04-29 17:36:11 +00:00
Jonas Maebe
4ac396bd74 * and now the actual test object files...
git-svn-id: trunk@21108 -
2012-04-28 22:28:26 +00:00
Jonas Maebe
562b968b16 * now that copy() expressions are only translated into calls during the
first pass, we have to manually set the varstate of its parameters during
    the typecheck pass (mantis #21878)

git-svn-id: trunk@21106 -
2012-04-28 21:33:29 +00:00
sergei
c08ab0f745 * Re-raising exceptions must be allowed only in 'except' block itself, not in 'try' block of a nested try..except statement. Mantis #21873.
git-svn-id: trunk@21100 -
2012-04-28 15:59:34 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
paul
a26bc50ca6 compiler: change ShortString->(Some)String and AnsiString->(Some)String overload precedence both for variables and string constants, change unicode constant type from widestring to unicodestring (Delphi compatibility)
new ShortString->(Some)String precedence: ShortString, UTF8String, AnsiString, AnsiString(CodePage) and RawByteString, UnicodeString, WideString and other string types
new AnsiString->(Some)String precedence: RawByteString, UTF8String, AnsiString, AnsiString(CodePage), UnicodeString, WideString, ShortString and other string types

The new logic makes UTF8String more preferrable than other AnsiString types, AnsiString more preferrable than other  AnsiStrings(codepage) and also makes UnicodeString more preferrable than WideString.

git-svn-id: trunk@21057 -
2012-04-26 02:33:57 +00:00
Jonas Maebe
9d1063f94c * adjustments/fixes for AIX/ppc64
git-svn-id: trunk@21053 -
2012-04-25 20:28:32 +00:00
pierre
1b3fd997fc + Regenerate all Makefiles's after adding x86_64 netbsd target
git-svn-id: trunk@21031 -
2012-04-24 23:15:18 +00:00
marco
743e58ed0f * test for bzip2 from Mantis #21261
git-svn-id: trunk@20977 -
2012-04-22 10:12:45 +00:00
paul
d5bc501d89 tests: fix test for new variant overload preferences
git-svn-id: trunk@20927 -
2012-04-19 08:31:05 +00:00
paul
e05121ff0d tests: modified test to be more informative
git-svn-id: trunk@20908 -
2012-04-18 09:19:38 +00:00
paul
b80e7c8fba compiler: change candidates search preference for variant arguments based on testing delphi XE + fixing tests
before the change order was (from better to worse): shortstring, ansistring, widestring, unicodestring
now the order is (from better to worse): widestring, unicodestring, ansistring, shortstring

git-svn-id: trunk@20907 -
2012-04-18 09:13:24 +00:00
Tomas Hajny
0afee490e2 + FileNameCasePreserving added - see #18066 in Mantis
git-svn-id: trunk@20897 -
2012-04-15 21:29:14 +00:00
Jonas Maebe
25f9c15290 * force -vw switch, because if it's not active then -Sew won't do anything
git-svn-id: trunk@20889 -
2012-04-15 16:09:29 +00:00
Jonas Maebe
9c311fa6bb + test object files for AIX/PowerPC
git-svn-id: trunk@20888 -
2012-04-15 16:06:46 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
florian
4c472a1569 * due to different result handling of integers and interfaces, GetInterfaceProp cannot use GetOrdProp, resolves #21684
git-svn-id: trunk@20857 -
2012-04-12 21:50:03 +00:00
Jonas Maebe
2174c6debc * fixed location of "end." in case "supported" is not defined
git-svn-id: trunk@20845 -
2012-04-11 18:06:53 +00:00
Jonas Maebe
347afa80fe * adapted so it also succeeds with the lnfogdb unit (gdb reports slightly
different line numbers: the line following the label, instead of the one
    preceding the label)

git-svn-id: trunk@20844 -
2012-04-11 18:06:48 +00:00
Jonas Maebe
07a65fed6b * adapted tests for aix (assembler code, -CN switch, library name suffix)
git-svn-id: trunk@20843 -
2012-04-11 18:06:43 +00:00
Jonas Maebe
64be3440d7 * fixed skiptarget directive
git-svn-id: trunk@20830 -
2012-04-11 18:05:40 +00:00
Jonas Maebe
131ed0c5a4 * use SharedSuffix for dynlib extension
git-svn-id: trunk@20823 -
2012-04-11 18:05:06 +00:00