Commit Graph

223 Commits

Author SHA1 Message Date
svenbarth
639a59df92 Added support for partial specialization. This should fix a few problems with generics, the tests for which will be added in the next days after I've verified them.
For partial specialization only the declaration is reparsed, but not method bodies.

The way generic parameters are passed around inside the compiler is changed: instead of creating new type symbols we keep a (name,def) pair so that the code in insert_generic_parameter_types can decide whether it needs to add a type symbol (for new undefined defs) or not (for real types and undefined defs that were passed on from the parent generic). This required the tfpobjectlist type of the genericlist variables/parameters to be changed to tfphashobjectlist.

For correctly parsing Delphi specializations as parameters in functions of records (or objects) the relationship between the def and its typesym must already be established during the parsing. For this the checks for forcing a "type is not completely defined" message needed to be adjusted to correctly handle nested types as well. This should as a sideeffect also allow the usage of nested constants, etc like was fixed for classes some months ago.

ToDo: 
  - if a generic is specialized with only fully defined types then we could generate the in the unit where it's used. This is not yet done.
  - currently we don't specialize generics that are currently parsed; maybe this could be improved in the future for better type compatibility checks
  - check whether the pausing of token recording for partial specializations works correct in context of hint modifiers

pgenutil.pas:
  * parse_generic_parameters: return a tfphashobjectlist instead of a tfpobjectlist (requires a few type adjustments in various other declarations)
  * maybe_insert_generic_rename_symbol, insert_generic_parameter_types: change genericlist from tfpobjectlist to tfphashobjectlist
  * parse_generic_specialization_types_internal: use is_generic instead of checking for df_generic
  * generate_specialization:
      + add a nested function to disable the requirement to check for method bodies
      * use the "simple" parameter parsing only for error recovery
      * instead of already creating a new type symbol for a parameter we use the found symbol's name and its def and maybe create it later on (therefor the type of tfpobjectlist was changed to tfphashobjectlist)
      * a partial specialization is specialized into the symtable of the def it is specialized in instead of one of the two global symtables
      * for now we handle partial specializations of generics we are currently parsing like before
      * don't continue recording generic tokens while we do a partial specialization
      * use the new unset_forwarddef function on the newly created defs
  * insert_generic_parameter_types: only create a new type symbol if the found type symbol does not yet have an owner (thus was freshly created for this generic declaration)

pdecobj.pas, object_dec:
  * change type of genericlist from tfpobjectlist to tfphashobjectlist
  * set the type sym for all object types that can be generic or inside a generic (needed for correctly parsing Delphi style generic declarations)

pdecsub.pas, parse_proc_head:
  * consume_generic_interface: always generate the specialization name as now all generics are "specialized" inside a generic
  * the assumption that the def index numbers are the same is no longer true as the genericdef might contain the defs of partial specializations which are not generated for full specializations

pdecvar.pas, read_record_fields:
  * we also need to check nested types whether they contain a not yet completely parsed record or object

ptype.pas:
  * read_named_type: 
      * change genericlist from tfpobjectlist to tfphashobjectlist
      * pass the typesymbol along to record_dec
  * resolve_forward_types: use is_generic instead of checking for df_generic
  * single_type: 
      * use is_generic instead of checking for df_generic
      * no need to check generic parameters
  * parse_record_members:
      + add parameter for the record's type symbol
      * setup the typesym <=> def relationship
  + record_dec: add parameter for the type symbol and pass it to parse_record_members
  * read_named_type, expr_type: use is_generic instead of checking for df_generic
  * array_dec & procvar_dec: change genericlist from tfpobjectlist to tfphashobjectlist

symdef.pas, tstoreddef:
  * improve the checks used in is_generic and is_specialization to really only work on true generics and true (and partial) specializations respectively
  * don't search the type parameters in the symtable, but store them in the PPU and load them from there
  - remove fillgenericparas method (including the calls in the descendants tarraydef, tprocvardef, tobjectdef and trecorddef)

defcmp.pas, compare_defs_ext:
  * handle partial specializations: specializations with only undefineddefs are compatible to generic defs

pdecl.pas, types_dec:
  * switch generictypelist from tfpobjectlist to tfphashobjectlist

ppu.pas:
  * increase PPU version

+ added tests that ensure that "not completely defined" checks for records (and objects) still work correctly

git-svn-id: trunk@27861 -
2014-06-05 20:05:05 +00:00
Jonas Maebe
338c064beb * moved x86-specific tpointerdef functionality to architecture-specific
descendants

git-svn-id: trunk@27397 -
2014-03-30 21:04:36 +00:00
svenbarth
c077adf499 Fix for Mantis #25132
defcmp.pas, objectdef_is_related:
  * use "equal_defs" instead of "=", as the former also handles equivalence of specializations

+ added test

git-svn-id: trunk@25848 -
2013-10-25 19:50:56 +00:00
svenbarth
798bb91e90 Extract tdef.is_related plus its overrides in tobjectdef, trecorddef and tstringdef into a new function def_is_related in unit defcmp.
defcmp.pas:
  + add new function "def_is_related" which combines the "is_related" overloads of "tobjectdef", "trecorddef" and "tstringdef" (it returns "false" for other def types which is what "tdef.is_related" did)
  * compare_defs_ext & compatible_childmethod_resultdef: change call from "x.is_related" to "def_is_related(x,...)"
symtype.pas, tdef:
  - remove "is_related" method
symdef.pas:
  - remove "is_related" in "tobjectdef", "trecorddef" and "tstringdef"
  * tobjectdef.needs_inittable: for checking whether a Corba interface somehow inherits from a IInterface don't use "is_related" anymore (we want to avoid the dependency after all), but mimic the necessary functionality of "def_is_related"
htypechk.pas, nadd.pas, ncal.pas, ncnv.pas, ngtcon.pas, nld.pas, optvirt.pas, pdecobj.pas, pdecvar.pas, pexpr.pas, pgenutil.pas:
  * change call from "x.is_related" to "def_is_related(x,...)"
symtable.pas
  + use unit defcmp
  * change call from "x.is_related" to "def_is_related(x,...)"
jvm/njvmcnv.pas, jvm/njvmflw.pas:
  * change call from "x.is_related" to "def_is_related(x,...)"

git-svn-id: trunk@25847 -
2013-10-25 19:44:27 +00:00
svenbarth
76f6de5cf1 Refactor tobjectdef.find_implemented_interface out into unit defcmp so that the recently introduced cycle between symdef and defcmp can be broken again.
defcmp.pas:
  + add function "find_implemented_interface"
  * change method call of "find_implemented_interface" into function call
symdef.pas:
  - tobjectdef: remove method "find_implemented_interface"
  - remove use of unit "defcmp"
pgenutil.pas:
  * change method call of "find_implemented_interface" into function call
  + add use of unit "defcmp"
ncgcnv.pas, ncnv.pas, pdecobj.pas, pdecsub.pas, pdecvar.pas:
  * change method call of "find_implemented_interface" into function call

git-svn-id: trunk@25844 -
2013-10-23 19:05:00 +00:00
Jonas Maebe
de56f909d5 * synchronized with trunk up to and including r25430
git-svn-id: branches/cpstrrtl@25431 -
2013-09-06 10:09:26 +00:00
Jonas Maebe
f539e9158a * small change to r24997: also use the {$modeswitch unicodestrings} state to
determine whether (wide)char->pchar will be preferred over (wide)char ->
    p(wide)char or not (always convert to pchar if mode switch is not active,
    otherwise always to pwidechar). Delphi-compatible + consistent with the
    behaviour added for constant strings in that revision + tests

git-svn-id: branches/cpstrrtl@25430 -
2013-09-06 08:02:59 +00:00
paul
17ef986b17 compiler: don't treat methods without self node (static class methods, class contructors, destructors, operators) as method pointers, fix comparison of procdef and procvardef to allow assignment of a static class method to a regular procedural variable (issue #24486)
git-svn-id: trunk@25284 -
2013-08-18 17:29:23 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
35b771e421 * previously, we preferred pchar->shortstring to pchar->ansistring in
case of {$h-}. Now this is no longer done because it caused
    pchar->ansistring and pchar->unicodestring to have the same
    overload preference, which regularly caused problems with the
    added unicodestring overloads in the RTL in the cpstrrtl branch.
  * fixed tw3328.pp (it was missing a {$mode delphi}), which failed
    before this patch but compiles new
  + extra variants of that test for the compiler changes

git-svn-id: trunk@25164 -
2013-07-24 09:39:34 +00:00
Jonas Maebe
eb93429cf0 * prefer "constant string" -> pwidechar for {$modeswitch unicodestrings}
* prefer "constant char" -> pchar to "constant char" -> pwidechar, and
    "constant widechar" -> pwidechar to "constant widechar" -> pchar

git-svn-id: branches/cpstrrtl@24997 -
2013-06-27 21:38:02 +00:00
nickysn
6431ebe7f3 * treat the nil node as equal to near, far and all the special x86 pointer types
git-svn-id: trunk@24851 -
2013-06-09 19:04:03 +00:00
svenbarth
956b26bc97 Completely reworked implementation of generic constraints, by moving the generic constraint data from the symbols to the definitions (I originally thought that this would simplyfy things, but the more correct approach is to add it to the defs).
symsym.pas:
    - remove "tgenericconstraintdata" and any using/loading/writing of it in "ttypesym"
    - remove "tgenericconstraintflag"
symdef.pas:
    + add "tgenericconstraintdata"
    + load and write "genconstraintdata" in "tstoreddef"
symconst.pas:
    + add "tgenericconstraintflag" so it can be used in "ppudump" as well
defcmp.pas, compare_defs_ext:
    * as we allow global operator overloads we can't really determine whether two defs are compatible, because a valid operator for the specialization types might just happen to be in scope of the generic; so for now constraints are only strictly checked when declaring a specialization
pgenutil.pas:
    * adjust "parse_generic_parameters" and "check_generic_constraints" to the new location of the constraint data
ppudump.pp:
    * corrrectly parse defs which contain generic constraints

git-svn-id: trunk@24628 -
2013-05-29 08:19:02 +00:00
svenbarth
cc5a108cca Allocate the list for generic parameters in tstoreddef only on demand as most defs won't contain generic parameters anyway (avoids a little bit of runtime and memory overhead per def).
symdef.pas, tstoreddef:
  + comment that the list is allocated on demand (and thus should be checked for Nil)
  + fillgenericparas: create the list when adding at least one generic parameter symbol
  - create & ppuload: don't create list instance anymore
  + is_generic & is_specialization: check whether the list is assigned
defcmp.pas, compare_defs_ext:
  + check whether "genericparas" list is assigned
pgenutil.pas:
  + check_generic_constraints: check whether "genericparas" is assigned
  + insert_generic_parameter_types: create list before adding generic parameters

git-svn-id: trunk@24627 -
2013-05-29 07:50:49 +00:00
nickysn
b0f7786782 + added support for special versions of near data pointers associated with a x86 segment register. They are supported on all x86 platforms: i8086, i386 and x86_64
git-svn-id: trunk@24453 -
2013-05-05 17:22:37 +00:00
Jonas Maebe
1244cdff70 * don't treat bitpacked arrays of subranges of char that can be represented
using less than 8 bits per element the same as regular char arrays as far
    as automatic type conversions are concerned (they have to be explicitly
    packed/unpacked) (mantis #24013)

git-svn-id: trunk@23739 -
2013-03-09 10:37:30 +00:00
svenbarth
9ef4a35a7b Fix the fix for Mantis #21538. The check never really worked up to now...
defcmp.pas, compare_defs_ext:
  use "equal_defs" instead of a reference comparison to check whether the type defs are equal
pgenutil.pas, insert_generic_parameter_types:
  * add to each (specialized) generic parameter the "sp_generic_para" flag so that it will be added to the "genericparas" list upon ppu loading
  * add the generic parameter to the genericparas list as well, so that the comparison in "compare_defs_ext" is triggered at all... (up to now the list was always empty -.-)
ppu.pas:
  * increase PPU version

git-svn-id: trunk@23149 -
2012-12-15 21:43:52 +00:00
Jonas Maebe
c7255f153e * sets with the same base/range can still have a different size (and hence
not be equal) due to different packset settings -> still need conversion
    (mantis #23204)

git-svn-id: trunk@23054 -
2012-11-24 12:32:57 +00:00
svenbarth
2414c55ca0 Fix for Mantis #21538.
* defcmp.pas, compare_defs_ext: 
  use the new genericparas list to check whether two specializations of the same generic can be considered equal
+ added test

git-svn-id: trunk@22454 -
2012-09-25 10:25:30 +00:00
Jonas Maebe
85765364ee * properly compare parameter lists involving pointers to or classrefdefs of
forward defined types by maing sure that we always compare typesyms in
    that case instead of the forwarddefs (mantis #22705)

git-svn-id: trunk@22215 -
2012-08-23 20:58:22 +00:00
Jonas Maebe
4d31fbc31d * also allow conversion of niln to forward-defined pointerdef
(mantis #22593)

git-svn-id: trunk@22026 -
2012-08-07 11:23:00 +00:00
Jonas Maebe
a63a603cc1 * allow conversion from niln to not-yet-fully-resolved classrefdefs
(mantis #22593)

git-svn-id: trunk@22025 -
2012-08-07 09:56:08 +00:00
Jonas Maebe
63ab1bae3e * don't allow ordinal->ptr-based-objectdef conversions on managed platforms,
even in Delphi mode (mantis #22401)

git-svn-id: trunk@21840 -
2012-07-10 09:24:13 +00:00
Jonas Maebe
50659b7e7f * give an error if a routine definition defines default values for
parameters that do not appear in forward/interface definitions
    (mantis #19434)
  * added test for #17136 already works

git-svn-id: trunk@21524 -
2012-06-07 22:36:39 +00:00
Jonas Maebe
ffe68ca284 * do not search overloaded assignment/conversion operators for internal
type conversions (those should always re-interpret the raw bits),
    except for variants (because those are sometimes generated internally)
    -- done so that -gt code at the node tree level can insert explicit
    typecasts to integer types without triggering overloaded explicit
    typecast operators such as in tests/test/terecs14

git-svn-id: trunk@21381 -
2012-05-24 15:34:27 +00:00
Jonas Maebe
99e70e7128 * do not allow implicit conversions from currency to orddef even if currency
is implemented via int64 (prevents e.g. calling abs(int64) for
    abs(currency) on non-x86)

git-svn-id: trunk@21097 -
2012-04-28 14:27:17 +00:00
paul
1a724f3e11 compiler:
- prefer UnicodeString, WideString, PWideChar, PAnsiChar, AnsiString, ShortString when passing a string constant if default string is UnicodeString,
  - change default string type to UnicodeString for MODE DelphiUnicode

git-svn-id: trunk@21094 -
2012-04-28 08:19:10 +00:00
paul
c7e057a835 compiler: use is_wide_or_unicode_string() istead of using is_widestring() or is_unicodestring()
git-svn-id: trunk@21086 -
2012-04-28 03:32:06 +00:00
Jonas Maebe
564445da8c * re-enabled enum -> dispinterface typecasts after r21069, bug noticed by
Paul

git-svn-id: trunk@21076 -
2012-04-27 09:30:25 +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
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
paul
2499b5514f compiler: change overload search for char constants (for delphi compatibility):
- for AnsiChar prefer ShortString, AnsiString, UnicodeString, WideString, ... (LongString?)
  - for WideChar prefer UnicodeString, WideString, AnsiString, ShortString, ... (LongString?)
  - remove old code from htypechk which made AnsiChar const = AnsiString,ShortString and WideChar const = WideString,UnicodeString - it is no longer needed since defcmp performs the required comparisons
  + test

git-svn-id: trunk@20348 -
2012-02-14 06:52:33 +00:00
svenbarth
2a872978dc Fix Mantis #21179
* defcmp.pas:
        + Extend compare_def_ext by the possiblity to specify whether strict or
          loose comparison of undefined defs should be applied.
          * in strict mode undefined defs are incompatible to all other defs
            except other undefined defs
          * in loose mode undefined defs are equal to anything (this is how
            FPC behaved up to now)
        + Enable the strict mode in compare_paras so that overloads with
          generic type parameters are possible
* ptype.pas, single_type:
        If the generic dummy of the currently parsed generic is encountered in
        non-Delphi modes then we need to return the current genericdef. This
        condition needs to be checked using the ObjName of the def, because
        the link from the type symbol to the current def is not yet 
        established 
+ added test for bug report

git-svn-id: trunk@20345 -
2012-02-13 21:17:54 +00:00
paul
3b153c223a compiler:
- treat the defs equal when convert from rawbytstring to any ansistring type (delphi compatible)
  - set result of ansistring copy() function to the type of first argument for ansistring arguments and to ansistring for pchar and char array arguments (delphi compatible)
  + test

git-svn-id: trunk@20285 -
2012-02-09 08:22:38 +00:00
Jonas Maebe
0d5b2b84a8 + Android/JVM target, including a translation of the Android r14 SDK
(= Android 4.0) java headers: java.*, javax.*, org.*, junit.*, android.*).
    The RTL can also be used to target earlier versions of the Android
    platform, but you manually have to take care of not using APIs that
    weren't available yet. Adding separate units for separate platform
    versions would only partly solve the problem, because some of the
    classes used inside the system unit have also changed across
    versions.

    Use -Tandroid while compiling to select the Android OS as target
    platform.

git-svn-id: branches/jvmbackend@19830 -
2011-12-12 02:34:34 +00:00
paul
c6ca9e5091 compiler:
- add helper function getansistringcodepage which returns explicitly set codepage or 0 in other case
  - add helper function getansistringdef which return a def with explicitly set codepage or cansistringtype in other case
  - change tstoreddef.createnai constructor to allow set codepage in constructor
  - don't convert string constants to rawbytestring. if string constant already has a codepage - preserve it or convert to ansistring codepage (delphi compatible)
  - don't perform string conversion from ansistring to strings with explicitly set codepage (by directive or by compiler switch) and vice versa (delphi compatible)
  + test which covers most of the cases

git-svn-id: trunk@19510 -
2011-10-19 02:45:52 +00:00
paul
a99ffb3097 compiler: apply patches from Inoussa and Jonas:
defcmp: Address code paged' string type comparison taking care of the code page
  ncnv: Remove un-needed code page comparison to CP_UTF8, some fixes regarding shortstrings and wide char/string 
  ncon: For the case of tstringconstnode.changestringtype (ncon.pas) where the code page are of CP_NONE or 0 no translation is done as :
    * CP_NONE is compatible to all
    * For 0 the raw bytes are just copied.
 My changes:
  - change ascii2unicode to allow pass source codepage, 
  - convert in both cases when source or destination is UTF8

git-svn-id: trunk@19457 -
2011-10-11 01:21:07 +00:00
paul
e0fecf5332 compiler: revert r19358. As stated by Florian, compiler should be able to compile with the latest RTL.
git-svn-id: trunk@19360 -
2011-10-04 10:12:49 +00:00
paul
ee2e0a0c1d compiler: remove CP_xxx constants since they are present in the system unit now
git-svn-id: trunk@19358 -
2011-10-04 06:03:03 +00:00
paul
a769ef0ad2 compiler: don't return te_eual when we convert from RawByteString to another codepage
git-svn-id: trunk@19283 -
2011-09-29 12:03:11 +00:00
paul
00396da30c compiler: cleanup
git-svn-id: trunk@19208 -
2011-09-24 17:41:13 +00:00
paul
005795495d merge r17552 from cpstrnew branch by inoussa:
*In normal procedure "var" and "out" RawByteString parameters does not accept other string types. Procedures with
"compilerproc" directive or the newly added "rtlproc" directive accept that. Please note that it is up to the
procedure coder to ensure the correctness of the code page in that case. The new directive is needed to handle 
the RTL procedures/functions that are not marked as "compilerproc" such as "UniqueString", "Insert" and "Delete".

*Correct "fpc_ansistr_concat" to handle code page correctly.

*Default "ansitring" type is now created with code page set to "0" instead of "65535". Before that change it was 
impossible to distinguish a "RawByteString" with the default "ansistring". At runtime "ansistring" variable'code
page is set to DefaultSystemCodePage

*UniqueString flavor of "SetLength" has been updated to release memory when shrinked to at least 50%, like ansitring
does.

git-svn-id: trunk@19118 -
2011-09-17 13:52:09 +00:00
paul
723f3424d4 merge r17484 from cpstrnew branch by michael:
* Patch from Inoussa:
* defcmp.pas
    ** ansistring to/from RawByteString are evaluated "te_equal"
    ** ansistring to UTF8string is evaluated (te_convert_l1,tc_string_2_string)

* ncnv.pas
    ** "ttypeconvnode.typecheck_char_to_string" : WideChar to AnsiString/ShortString
        is possible if the source code page is not utf8
    ** "ttypeconvnode.typecheck_char_to_char" : WideChar to AnsiChar
        is possible if the source code page is not utf8

* ncon.pas
    ** "tstringconstnode.changestringtype" : Unicode to utf8string bug fix(set the encoding),
       constants in the source code with code page set utf8 should be converted back to utf8

* nopt.pas
    ** "genmultistringadd" : fpc_<stringname>_concat_multi have a new parameter "cp"
        to indicate the "DestS" code page if the variable content is nil. This is required
        in order not to loose the declared code page.

* pinline.pas
    ** "inline_setlength" : a new parameter "cp" to indicate the code page if the variable content
       is nil. This is required in order not to loose the declared code page.
* ptconst.pas
    ** "parse_arraydef" : for string const to array of ansichar/widechar conversion check for wide string and
        convert if it is required. For char const to array of ansichar/widechar conversion check for wide char and
        convert if it is required.

git-svn-id: trunk@19113 -
2011-09-17 13:30:09 +00:00
paul
8f3f583199 merge r14140 from cpstrnew branch by paul:
prefer exact string const matches

git-svn-id: trunk@19096 -
2011-09-17 11:48:18 +00:00
paul
ae0d732c8f merge r13485 from cpstrnew branch by florian:
* fixed compilation of system unit after last changes

git-svn-id: trunk@19083 -
2011-09-17 11:01:42 +00:00
paul
8a4634a7b1 merge r13481 from cpstrnew branch by florian
+ support parsing of strings with code page specification
+ added encoding and elementsize field to ansi- and unicodestring records
+ some basic rtl support routines for encoding aware strings
+ DefaultSystemCodePage
+ DefaultUnicodeCodePage
+ ppu writing/loading of code page aware strings

git-svn-id: trunk@19080 -
2011-09-17 10:37:36 +00:00
paul
a95512f0ec merge cpstrnew branch r13480 by florian:
* merged old cpstr branch

git-svn-id: trunk@19079 -
2011-09-17 10:03:59 +00:00
Jonas Maebe
7fe0485a4e * always allow typecasts between enums and pointers/classes on the JVM target
and treat them like tc_equal rather than tc_int_2_int, because enums /are/
    class instances there

git-svn-id: branches/jvmbackend@18811 -
2011-08-23 15:25:47 +00:00
Jonas Maebe
28c20cfc5e * the default string type for the JVM target is no longer automatically
unicodestring = java.lang.String. The reason this was the default in
    the past is that this was the first string type that was implemented,
    and without it being the default most code involving string operations
    would fail. Now the default strings types are the same as for other
    targets
  + new {$modeswitch unicodestrings} directive, that when activated
    *together* with {$h+},
   1) changes char into an alias for widechar
   2) changes string into an alias for unicodestring
   3) changes the preferred string evaluation type (in case of uncertainty)
      to unicodestring
    {$modeswitch unicodestrings} with {$h-} does not change anything at all
    regarding the string type (it still changes the char type)
  + new uuchar unit that redefines char as widechar, and which is automatically
    included by the compiler if {$modeswitch unicodestrings} is enabled

git-svn-id: branches/jvmbackend@18781 -
2011-08-20 08:35:47 +00:00