Commit Graph

557 Commits

Author SHA1 Message Date
Jonas Maebe
67c2c7c166 * renamed cchartype to cansichartype
git-svn-id: branches/jvmbackend@18779 -
2011-08-20 08:35:24 +00:00
Jonas Maebe
851cb65021 * activate code to remove unnecessary widenings to 64 bit in case
cpu64bitaddr is not defined rather than if cpu64bitalu is not
    defined, because whether or not operations should be 64 bit by
    default depends on cpu64bitaddr, and even if a cpu can perform
    64 bit alu operations, 32 bit ones are likely faster

git-svn-id: branches/jvmbackend@18748 -
2011-08-20 08:32:26 +00:00
Jonas Maebe
d48fa1d7e2 * for all managed VM targets, reject ord->ptr typecasts (except for 0),
typeof(), typeinfo(), seg(), ofs(), settextbuf(), slice(), resourcestring,
    new(), dispose()

git-svn-id: branches/jvmbackend@18747 -
2011-08-20 08:32:21 +00:00
Jonas Maebe
979f55e1db + support for procedural variables for the JVM target
o every porocedural variable type is represented by a class with one
     public "invoke" method whose signature matches the signature of the
     procvar
   o internally, dispatching happens via java.lang.reflect.Method.invoke().
     WARNING: while this allows calling private/protected or other methods
     that are normally not accessible from another context, a security
     manger can override this. If such a security manager is installed,
     most procvars will cause security exceptions
   o such dispatching also requires that all arguments are wrapped, but
     that's done in the compiler-generated body of the invoke method,
     so that procvars can also be called conveniently from Java code
   o typecasting between a procedure of object and tmethod is supported,
     as well as Delphi-style replacing of only the method pointer via
     @procvar1=@procvar2.
   o nested procvars are not yet supported, but most of the basic
     infrastructure for them is already present
  * all units/programs now get an internal __FPC_JVM_Module_Class_Alias$
    type when compiled for the JVM target, which is an "external" class
    that maps to the unit name. This is required to look up the
    JLRMethod instances for regular functions/procedures
  + new tabstractprocdef.copyas() method that allows to create a procvar
    from a procdef and vice versa

git-svn-id: branches/jvmbackend@18690 -
2011-08-20 08:24:58 +00:00
Jonas Maebe
569228447d * converted all enum handling for the JVM target so that it uses the
JDK class-style enums rather than plain ordinals like in Pascal
   o for Pascal code, nothing changes, except that for the JVM target
     you can always typecast any enum into a class instance (to interface
     with the JDK)
   o to Java programs, FPC enums look exactly like Java enum types

git-svn-id: branches/jvmbackend@18620 -
2011-08-20 08:15:54 +00:00
Jonas Maebe
223057f1a7 + support for is/as and Java interfaces
git-svn-id: branches/jvmbackend@18578 -
2011-08-20 08:12:09 +00:00
Jonas Maebe
0706cb5eb6 + support for pointers to types that are implicit pointer types in the JVM
(non-dynamic arrays, records, shortstrings)
  - removed the ability to typecast such types directly into related class
    types, you have to use the @-operator first now to get a pointer to
    the type
   o updated the RTL and internal compiler code to properly use this
     new convention
   o allowed removing several special cases from
     tjvmtypeconvnode.target_specific_general_typeconv(), and that
     method can probably be removed completely over time
  * no longer give compile time errors for pointer-related typecasts that
    will fail at run time, because the checking was too complex and could
    be worked around via actual pointer typecasts anyway
  * removed some unnecessary checkcast operations (for shortstring/
    shortstringclass)

git-svn-id: branches/jvmbackend@18574 -
2011-08-20 08:11:49 +00:00
Jonas Maebe
6857dde33e + shortstring support for the JVM target (including accessing character 0 as
the "length byte")

git-svn-id: branches/jvmbackend@18570 -
2011-08-20 08:11:28 +00:00
Jonas Maebe
446d91eaab + ansistring support. Items of note:
o support for ansistring constants. It's done via a detour because the
      JVM only supports UTF-16 string constants (no array of byte or anything
      like that): store every ansicharacter in the lower 8 bits of an
      UTF-16 constant string, and at run time copy the characters to an
      ansistring. The alternative is to generate code that stores every
      character separately to an array.
    o the base ansistring support is implemented in a class called
      AnsistringClass, and an ansistring is simply an instance of this
      class under the hood
    o the compiler currently does generate nil pointers as empty
      ansistrings unlike for unicodestrings, where we always
      explicitly generate an empty string. The reason is that
      unicodestrings are the same as JLString and hence common
      for Java interoperation, while ansistrings are unlikely to
      be used in interaction with external Java code

  * fixed indentation

git-svn-id: branches/jvmbackend@18562 -
2011-08-20 08:10:39 +00:00
Jonas Maebe
aa1f299a17 + added hook for "individual value to open array of one element"-conversion,
so it can be intercepted by the JVM backend (it has to create an actual
    array)
  + JVM support for the elem_2_open_array hook

git-svn-id: branches/jvmbackend@18561 -
2011-08-20 08:10:31 +00:00
Jonas Maebe
60f8254d63 * don't internalerror when converting to an open array and passing as
var/out parameter (these conversions are replaced by another
    construct on non-JVM targets, so didn't cause a problem there)

git-svn-id: branches/jvmbackend@18555 -
2011-08-20 08:10:00 +00:00
Jonas Maebe
10a7532968 * differentiate between typecasts on the assignment side or not, because we
cannot insert typecasting checks on the assignment side, only on the
    values that are being assigned
   o since valid_for_assignment() is called in tassignmentnode.typecheckpass()
     after typecheckpassing left and right, moved the conversion of the
     typecheck nodes into JVM-specific constructs from typecheckpass to
     pass_1, so that they can use the information whether they are on
     the assignment side or not
  * forbid casting a child type to a parent type on the assignment side on
    managed platforms, because that circumvents the type checking

git-svn-id: branches/jvmbackend@18515 -
2011-08-20 08:06:20 +00:00
Jonas Maebe
c75246706d + stubbed ansistring support (using ansistrings compiles, but does not
generate working code)

git-svn-id: branches/jvmbackend@18499 -
2011-08-20 08:04:57 +00:00
Jonas Maebe
be92f47cc7 * don't simply replace the resultdef of typeconverted nodes if the new
and old def have a different deftype (see added comment why)

git-svn-id: branches/jvmbackend@18492 -
2011-08-20 08:04:21 +00:00
Jonas Maebe
d79160a6af * correctly handle explicit typecasts between records and jlobject/
fpcbaserecordtype for the JVM target (intercept in ncnv via new
    target_specific_general_typeconv helper, handle in as/is code)
  * not only check for related types in htypechk in case they are
    objdefs, but always do so (records are related to jlobject/fpcbaserecord
    on the JVM target)

git-svn-id: branches/jvmbackend@18458 -
2011-08-20 08:01:29 +00:00
Jonas Maebe
b4ffcaf88e * redirect the ttypeconvnode.typecheck* methods just like the firstpass
and code generation pass methods so they can be overridden

git-svn-id: branches/jvmbackend@18423 -
2011-08-20 07:58:25 +00:00
Jonas Maebe
fde622e050 * generate a loadvmtaddrnode wrapper around Java objectdef typenode arguments
to tasnode (like for regular Object Pascal classes)
  * don't collect WPO information for Java classes in tloadvmtaddrnode.pass_1()
    (devirtualization can't work for Java, since classes can always be loaded
     at run time, except for final/sealed classes -- but that's not yet
     implemented)
  + JVM is-node support, unified JVM type checking codegen for is- and as-nodes

git-svn-id: branches/jvmbackend@18383 -
2011-08-20 07:54:57 +00:00
Jonas Maebe
8643ab7905 + hooks for target-specific handling of explicit type conversions and
as-nodes (required for JVM target: bit pattern reinterpretations
    have to be handled via conversion because of type safety reasons,
    and as-nodes will also have to be able to handled class<->dynarray
    checks/conversions)

git-svn-id: branches/jvmbackend@18375 -
2011-08-20 07:53:56 +00:00
Jonas Maebe
48695a7705 * when removing unnecessary 64 bit widenings, modify both the resultdef
and the totypedef of typeconvnodes because the totypedef is used for
    equality comparisons in the node cse

git-svn-id: trunk@18171 -
2011-08-11 16:05:11 +00:00
florian
d35d1ed357 + initial support for pascal booleans with sizes 2, 4 and 8
git-svn-id: branches/pasboolxx@17836 -
2011-06-26 15:02:37 +00:00
marco
90c47c5c86 * fix for renaming of type_interface_noguid (or so) to type_E_interface...
by Florian in r17722

git-svn-id: trunk@17731 -
2011-06-12 13:45:38 +00:00
tom_at_work
1f023f4b36 * Use new qword_to_float32/64 compilerproc functions in first_int_to_real
git-svn-id: trunk@17624 -
2011-06-01 13:27:45 +00:00
paul
901a9a974e compiler: don't create set constants from arrays with high bound > 255 if elements of array are lower than 255
git-svn-id: trunk@17372 -
2011-04-26 00:17:14 +00:00
florian
58fcf9dc52 * probably mark an overloaded := operator used as type conversion as used, resolves #18909
git-svn-id: trunk@17320 -
2011-04-14 21:11:27 +00:00
Jonas Maebe
eab29db98a * merged tasnode.pass_typecheck() and tisnode.pass_typecheck() into a single
tasisnode.pass_typecheck() since they were almost identical (only the
    resultdef of the nodes is different)

git-svn-id: trunk@16846 -
2011-01-30 10:37:21 +00:00
Jonas Maebe
d76ddcabe6 * don't give an internalerror when trying to explicitly apply an invalid
typecast to an array-of-const (mantis #18267)

git-svn-id: trunk@16749 -
2011-01-11 15:47:56 +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
florian
eb3644140a * patches from Aleksa Todorovic for #15480 to improve error reporting, does not resolve #15480
git-svn-id: trunk@16287 -
2010-11-01 20:24:01 +00:00
Jonas Maebe
14b95b3b9b * always force range checking for the upper and lower bounds of for-loops if
they are constants (instead of only on 32 bit systems), and always use the
    actual upper/lower bound of the loop variable instead of hardcoding the
    bounds of longint (mantis #17646)

git-svn-id: trunk@16213 -
2010-10-24 14:55:48 +00:00
Jonas Maebe
769eb3f604 * moved the initialisation of the nodetree and tai class reference constants
from the unit initialisation sections to the variable declaration sections
    to prevent the base units from overriding derived classes (based on patch
    by Hans-Peter Dietrich, mantis #17516)

git-svn-id: trunk@16118 -
2010-10-09 18:52:22 +00:00
Jonas Maebe
94d976bc87 * when simplifying ordinal expressions during inlining, keep the resultdef
that was set during the typecheck pass because typeconversion nodes
    may have been optimised away previously and sometimes the resultdef is
    important (e.g. for the value of callparanodes) (mantis #17458)

git-svn-id: trunk@16101 -
2010-10-07 15:08:52 +00:00
Jonas Maebe
d1206c6279 * also set the persistent typedef of simplified ordconstn type conversions
(related to mantis #17458)

git-svn-id: trunk@16071 -
2010-09-30 20:45:31 +00:00
Jonas Maebe
57bd6d2685 + merged nestedprocvars branch
+ support for nested procedural variables:
    o activate using {$modeswitch nestedprocvars} (compatible with all
      regular syntax modes, enabled by default for MacPas mode)
    o activating this mode switch changes the way the frame pointer is
      passed to nested routines into the same way that Delphi uses (always
      passed via the stack, and if necessary removed from the stack by
      the caller) -- Todo: possibly also allow using this parameter
      passing convention without enabling nested procvars, maybe even
      by default in Delphi mode, see mantis #9432
    o both global and nested routines can be passed to/assigned to a
      nested procvar (and called via them). Note that converting global
      *procvars* to nested procvars is intentionally not supported, so
      that this functionality can also be implemented via compile-time
      generated trampolines if necessary (e.g. for LLVM or CIL backends
      as long as they don't support the aforementioned parameter passing
      convention)
    o a nested procvar can both be declared using a Mac/ISO Pascal style
      "inline" type declaration as a parameter type, or as a stand-alone
      type (in the latter case, add "is nested" at the end in analogy to
      "of object" for method pointers -- note that using variables of
      such a type is dangerous, because if you call them once the enclosing
      stack frame no longer exists on the stack, the results are
      undefined; this is however allowed for Metaware Pascal compatibility)

git-svn-id: trunk@15694 -
2010-08-02 22:20:36 +00:00
ivost
17260e1119 * reimplemented IS operator, it supports now
object is interface
	object is corbaintf
	interface is interface
	interface is class
	object is class

git-svn-id: trunk@15434 -
2010-06-13 22:04:35 +00:00
Jonas Maebe
40705a085f * renamed is_refcounted_type() into is_managed_type(), because it also
returns true for variants and those aren't refcounted
  * also allow tempnodes for pointers to managed types to be put in
    registers (not sure why it was disabled, and there are no
    testsuite regressions by enabling it)

git-svn-id: trunk@15319 -
2010-05-22 20:51:50 +00:00
florian
d0e9a7ead9 + description of tasnode.call (by Jonas Maebe)
git-svn-id: trunk@15198 -
2010-04-28 21:35:19 +00:00
ivost
dc785f6f68 * implemented intf as object. When doing IInterface as TObject the compiler calls fpc_intf_as_class to query for the IImplementorGetter interface and then invokes GetObject to get the
objects reference.
* by default the TInterfacedObject is supporting now IImplementorGetter

git-svn-id: trunk@15080 -
2010-03-28 00:17:20 +00:00
Jonas Maebe
0cfc6e1cac + support for "univ" in macpas mode: a parameter modifier that allows
passing any value to that parameter which has the same size as the
    parameter (it basically acts as if there is an explicit type conversion
    to the parameter type around the value at the caller side). If a procvar
    has an univ parameter, all procvars whose corresponding parameter
    has the same size as that univ parameter are similarly compatible.

    This transparent compatibility can however cause crashes in case of
    of the procvars when one of the types is passed on the stack and the
    other isn't (because then the called routine will a) load the parameter
    from a wrong location and b) pop the wrong amount off of the stack at
    then end). Therefore FPC will warn in most cases where this can happen.
    (mantis #15777)

git-svn-id: trunk@15010 -
2010-03-13 22:13:20 +00:00
Jonas Maebe
cda17ad02a * correctly set the expectloc for int_2_int type conversions of bitpacked
arrays (and some other, related constructs) (mantis #15789)

git-svn-id: trunk@14927 -
2010-02-19 17:12:47 +00:00
Jonas Maebe
650ba6d50f * an int2int type conversion doesn't retain the value location in
case of a bitpacked access

git-svn-id: trunk@14911 -
2010-02-13 20:56:02 +00:00
Jonas Maebe
85984c2d8f * insert proper type conversions when optimising logical operations and
compares by avoiding unnecessary sign extensions (fixes bug reported in
    http://lists.freepascal.org/lists/fpc-pascal/2010-January/023907.html )
  * never throw away int2int type conversions on bitpacked loads, because
    in these cases the proper bits still need to be selected

git-svn-id: trunk@14892 -
2010-02-12 18:13:08 +00:00
Jonas Maebe
6b0a0c149b * don't perform a range check in Delphi mode when passing a cardinal as
vtInteger to an array-of-const parameter (mantis #15727)

git-svn-id: trunk@14882 -
2010-02-10 16:35:37 +00:00
florian
f12ba2ed23 * fixes ttypeconvnode.docompare hopefully finally (nobody has seen my last attempt ;))
git-svn-id: trunk@14755 -
2010-01-20 22:07:54 +00:00
florian
3c7f726f98 * typeconvnodes are only equal if also their result type is equal
git-svn-id: trunk@14690 -
2010-01-17 10:07:44 +00:00
paul
74cc1e0bab compiler: allow 'as' for dispinterface, allow comparisons of dispinterface and pointers (issue #0015530, issue #0015529)
git-svn-id: trunk@14663 -
2010-01-16 11:37:25 +00:00
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +00:00
Jonas Maebe
b4c572483b * always call procvars inside varargs in TP/Delphi mode (mantis #15446)
git-svn-id: trunk@14527 -
2010-01-02 21:43:19 +00:00
florian
dab642986e * patch by Sergei Gorelkin, fixes several issues with implements, resolves #15209
git-svn-id: trunk@14466 -
2009-12-23 16:23:19 +00:00
Jonas Maebe
dd7e472fa4 * don't convert "cardinal div (cardinal-cardinal)" to longint after it
has been upcasted to int64, but convert it back to cardinal (mantis
    #15015)
  * put the "remove unnecessary 64 bit type conversions" code between
    {$ifndef cpu64bitalu} instead of {$ifndef cpu64bitaddr}

git-svn-id: trunk@14396 -
2009-12-10 21:08:31 +00:00
Jonas Maebe
b9b95a8f73 * fixed compiler crash when putting non-constant string in a set expression
(mantis #15288)

git-svn-id: trunk@14367 -
2009-12-08 17:15:31 +00:00
Jonas Maebe
d1538ab023 o added ARM VPFv2/VFPv3 support:
+ RTL support:
      o VFP exceptions are disabled by default on Darwin,
        because they cause kernel panics on iPhoneOS 2.2.1 at least
      o all denormals are truncated to 0 on Darwin, because disabling
        that also causes kernel panics on iPhoneOS 2.2.1 (probably
        because otherwise denormals can also cause exceptions)
    * set softfloat rounding mode correctly for non-wince/darwin/vfp
      targets
    + compiler support: only half the number of single precision
      registers is available due to limitations of the register
      allocator
    + added a number of comments about why the stackframe on ARM is
      set up the way it is by the compiler
    + added regtype and subregtype info to regsets, because they're
      also used for VFP registers (+ support in assembler reader)
    + various generic support routines for dealing with floating point
      values located in integer registers that have to be transferred to
      mm registers (needed for VFP)
    * renamed use_sse() to use_vectorfpu() and also use it for
      ARM/vfp support
    o only superficially tested for Linux (compiler compiled with -Cpvfpv6
      -Cfvfpv2 works on a Cortex-A8, no testsuite run performed -- at least
      the fpu exception handler still needs to be implemented), Darwin has
      been tested more thoroughly
  + added ARMv6 cpu type and made it default for Darwin/ARM
  + ARMv6+ implementations of atomic operations using ldrex/strex
  * don't use r9 on Darwin/ARM, as it's reserved under certain
    circumstances (don't know yet which ones)
  * changed C-test object files for ARM/Darwin to ARMv6 versions
  * check in assembler reader that regsets are not empty, because
    instructions with a regset operand have undefined behaviour in that
    case
  * fixed resultdef of tarmtypeconvnode.first_int_to_real in case of
    int64->single type conversion
  * fixed constant pool locations in case 64 bit constants are generated,
    and/or when vfp instructions with limited reach are present

  WARNING: when using VFP on an ARMv6 or later cpu, you *must* compile all
    code with -Cparmv6 (or higher), or you will get crashes. The reason is
    that storing/restoring multiple VFP registers must happen using
    different instructions on pre/post-ARMv6.

git-svn-id: trunk@14317 -
2009-12-03 22:46:30 +00:00
Jonas Maebe
559e284bd0 * merged r13762-14047 from trunk
git-svn-id: branches/objc@14048 -
2009-11-04 15:50:26 +00:00
Jonas Maebe
fffa66e2f9 * only allow implicit conversions from 0 to NIL in Delphi mode, rather than
from any ordinal constant, and give a warning for this one allowed
    conversion like Kylix does (mantis #14713)
  * this required calling simplify from typecheckpass in ttypeconvnode for
    cord_to_pointer, because this simplification prevents the type checking
    from happening (but the typecheck itself also does that simplification)

git-svn-id: trunk@13919 -
2009-10-22 19:49:08 +00:00
Jonas Maebe
a149674a75 Merged revisions 13458-13596 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/trunk

git-svn-id: branches/objc@13598 -
2009-08-25 19:47:36 +00:00
Jonas Maebe
106c0673c0 * allow passing records to C varargs (also allowed by C)
git-svn-id: trunk@13595 -
2009-08-25 19:04:34 +00:00
Jonas Maebe
2f7457f37e * set the fileinfo of typeconversions created using inserttypeconv*()
to that of the left node
  * same for a typeconversion inserted in the typecheck pass of
    taddrnode

git-svn-id: trunk@13579 -
2009-08-22 22:11:03 +00:00
Jonas Maebe
acdb0bbb3e * don't change current_filepos in pass_typecheck when not generating
errornodes (so the that the parser won't afterwards suddenly start
    creating nodes with this different fileinfo)

git-svn-id: trunk@13577 -
2009-08-22 20:21:56 +00:00
Jonas Maebe
a25e791ff8 * allow Objective-C classes/protocols in C varargs parameter lists
git-svn-id: branches/objc@13460 -
2009-07-26 16:00:33 +00:00
Jonas Maebe
335e159c11 Merged revisions 13351-13373,13376-13457 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/trunk

git-svn-id: branches/objc@13458 -
2009-07-26 14:31:50 +00:00
Jonas Maebe
754696d1f5 * enable converting procedure callnodes with only default parameters into
procvars in tp/delphi mode (mantis #11771)

git-svn-id: trunk@13400 -
2009-07-17 10:29:56 +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
1f6ec379de * moved field definitions before method/property definitions (see mantis
#13971)

git-svn-id: trunk@13330 -
2009-06-27 11:27:31 +00:00
Jonas Maebe
66c14c8a88 * don't mark classes used in "is"- or "as"-expressions as potentially
instantiated (for wpo)
  * also replace vmt-entries for classes for which we don't have any
    information at all with FPC_ABSTRACTERROR (since that means they
    certainly are not instantiated), except for their published and
    virtual class methods
  * fixed check for published methods in wpo

git-svn-id: trunk@13219 -
2009-05-31 13:52:40 +00:00
Jonas Maebe
966ebbf157 * fixed missing reference counting in case a refcounted type was implicitly
type casted to a non-refcounted type, e.g. dynarray to pointer in Delphi
    mode (mantis #13820)

git-svn-id: trunk@13195 -
2009-05-25 19:41:14 +00:00
ivost
0438667eed * fixed bug #5800
* const s: string = icorbainterface; is possible now
* as operator is working now with corba interfaces
* supports helper function is working now with corba interfaces

git-svn-id: trunk@12729 -
2009-02-09 00:35:09 +00:00
Jonas Maebe
9d81148986 * only convert character constants into widechar/widestring when assigned
to a widechar/widestring (compatible with constant string handling,
    mantis #13036)

git-svn-id: trunk@12588 -
2009-01-24 12:45:03 +00:00
Jonas Maebe
bfbfa2eb64 * when converting a constant char (not widechar) with ord>=128 to a string,
convert it into a widechar at compile time using the current source file's
    code page (and in case it was to a non-widestring, then convert it at run
    time into the current run time ansi code page) (mantis #12993)

    Previously, the characters were either stuffed into the string without
    conversion (widestring), or passed to the run time "ansi-character to
    stringtype" routine (other string types; which was also wrong, since
    that routine expects the character to be in ansi-encoding, which is
    not necessarily the same as whatever the source file encoding was)

git-svn-id: trunk@12580 -
2009-01-21 18:58:37 +00:00
Jonas Maebe
7b4eed79ce * fixed generic uint32->float softfpu conversion
git-svn-id: trunk@12200 -
2008-11-22 18:05:19 +00:00
florian
a0939ad9d6 * actually the important part of r12120 containing the compiler change
git-svn-id: trunk@12121 -
2008-11-16 14:08:31 +00:00
Jonas Maebe
c6c9ec83e0 * only make the target of a type conversion not regable after checking
whether it's assignable if 1) the size/sign changes (was already the
    case) and 2) in case something actually can be assigned to it

git-svn-id: trunk@12039 -
2008-11-09 10:24:23 +00:00
Jonas Maebe
1e178d324f * explicitly check whether the methodpointer isn't the same as the result
before optimising function result assignment, because at this point the
    hidden self parameter is not yet inserted (mantis #12597)
  * changed ttypeconvnode.actualtargetnode to use the same logic as what
    is used to determine whether something can be assigned to the result
    of a type conversion (so the above check also works if the methodpointer
    contains a typecast to a different object type)

git-svn-id: trunk@12038 -
2008-11-09 10:19:29 +00:00
Jonas Maebe
19f8aede99 + some missing docompare() overrides
git-svn-id: trunk@11937 -
2008-10-19 16:50:43 +00:00
florian
cd6b57c733 * fixed constant char to unicodestring conversion
git-svn-id: trunk@11779 -
2008-09-14 17:19:20 +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
florian
9a83b1d275 * split typecast_string_to_string into simplify and firstpass, allows better constant propagation when inlining, resolves #11327
git-svn-id: trunk@11636 -
2008-08-23 07:29:30 +00:00
florian
1fa70f7a0a * proper support for tobject.getinterface with raw/corba interfaces, resolves #6798 and #6036
git-svn-id: trunk@11497 -
2008-08-01 15:27:58 +00:00
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
yury
6daceb38f6 * Fixed unreachable code warnings.
git-svn-id: trunk@11440 -
2008-07-23 09:55:44 +00:00
yury
b70bf05ad5 * I hope it's proper fix for r10688.
git-svn-id: trunk@10690 -
2008-04-18 10:51:56 +00:00
Jonas Maebe
62e66d2a56 * explicit typecasting of any ordinal type to a boolean of the same
size must happen without any mangling of the value (mantis #11027)
  * moved checking for signed-to-unsigned (or vice versa) type
    conversions in assignments from htypechk to ncnv (where there
    was already code for similar checks) and added support for
    bool_to_bool there as well

git-svn-id: trunk@10521 -
2008-03-21 14:44:58 +00:00
peter
8f239d04b6 * cleanup and simplify the set type handling
git-svn-id: trunk@10432 -
2008-03-02 17:48:27 +00:00
peter
85e904cb36 * fix range error
git-svn-id: trunk@10424 -
2008-03-02 14:00:38 +00:00
micha
83b7f81f81 + add no-fpu support to compiler/rtl for powerpc-linux (-Cfnone)
git-svn-id: trunk@10422 -
2008-03-02 12:59:02 +00:00
Jonas Maebe
97f4c0a130 * call taddnode.simplify at the very end of taddnode.pass_typecheck, so
it doesn't have to duplicate any type checking code, and so constant
    expressions get the same resultdefs as non-constant expressions
  * properly fixed resultdef determination of "set + setelementn" (follows
    same rules now as "set + set")
  * also convert "longint or/xor cardinal" to int64 (needed for correct
    results with negative numbers and Delphi-compatible) + test
  * extended 64-to-32 type conversion simplification to also handle
    or/xor nodes (so if the result is typecasted back to 32 bit, the
    evaluation can still be done entirely in 32 bit). These changes also
    enable that optimization in some extra cases (not just anymore for
    expressions containing only uint32)

git-svn-id: trunk@10418 -
2008-03-01 20:48:50 +00:00
Jonas Maebe
a2beae0e11 * use more generic set type boundaries for constant sets with one
element in Delphi mode (fixes mantis #10890, but requires more
    thorough changes in nadd.pas for proper fixing)

git-svn-id: trunk@10399 -
2008-02-27 21:17:13 +00:00
Jonas Maebe
179b840cea * also adjust constsetlo when parsing a constant set in Delphi mode
git-svn-id: trunk@10395 -
2008-02-27 15:42:49 +00:00
florian
6c53785e3a * first part of implements clean up and fixing
git-svn-id: trunk@10382 -
2008-02-24 11:05:46 +00:00
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +00:00
peter
519b11dba7 * workaround for 2.2 rnagecheck
git-svn-id: trunk@10106 -
2008-01-29 23:19:24 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
Jonas Maebe
84159b3cbb * optimize away unnecessary implicit upcasts to int64 for subtractions
of u32bit values on 32 bit platforms (after the int64 values have 
    already been used for overload selection etc, i.e., semantically
    nothing changes)
  + test which checks that not too many typecasts are optimized away

git-svn-id: trunk@9664 -
2008-01-06 23:30:19 +00:00
florian
8f17101039 * allow application of as operator only to interfaces having a guid, resolves #6797
git-svn-id: trunk@9436 -
2007-12-12 21:07:47 +00:00
Jonas Maebe
742ff35c48 + also optimize assignments from calls to by-reference "results":
o it's a by-reference parameter, but ignore that since it's
      guaranteed to be safe because of the escape analysis
    o it's wrapped in an absolute type conversion -> added
      actualtargetnode method to tnode which digs through that

git-svn-id: trunk@9412 -
2007-12-07 17:58:25 +00:00
yury
4e3547c7bf * Improved warning "Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.":
- check for procedure and class pointers as well;
  - do not warn if typecasted pointer is passed as parameter or directly assigned to a variable. 

git-svn-id: trunk@9264 -
2007-11-16 13:52:19 +00:00
Jonas Maebe
70c0c2ddd9 * all currently supported platforms require that single precision
parameters passed as C-style varargs are upgraded to double
    precision

git-svn-id: trunk@9201 -
2007-11-11 18:01:29 +00:00
Jonas Maebe
e716ac6b6b * give ord->formaldef again a higher precedence than ord->floatdef
(last convert level that is added, needs a more structural
     solution)

git-svn-id: trunk@9057 -
2007-11-02 11:17:11 +00:00
Jonas Maebe
82a0749970 * prefer non-matching orddef conversions to orddef-to-pointer conversions
(mantis #10002) and also to orddef-to-real conversions
    (delphi-compatible). More tests and fixes will follow later.

git-svn-id: trunk@9015 -
2007-10-31 17:20:37 +00:00
Jonas Maebe
0aba0acdf6 * fixed widechar to shortstring conversion after r8898 (webtbs/tw7758)
git-svn-id: trunk@8908 -
2007-10-21 22:58:17 +00:00
florian
7878f0feb3 * made all fpc_*_to_shortstr helpers a procedure, resolves #8580
git-svn-id: trunk@8898 -
2007-10-21 17:33:18 +00:00
peter
6b8aed593f * remove registers{int/mmx/fpu} from firstpass
* small cleanups of unused variables in firstpass
  * node_resources_fpu() created to get an approximation of the
    required fpu registers
  * for the moment use node_complexity in the CG until the
    node_resource_int() is created

git-svn-id: trunk@8655 -
2007-09-26 21:12:01 +00:00
peter
e0cf015159 * refactor function result handling
* rename methodpointerinit/done to callinitblock/callcleanupblock
  * moved checks in callnode to separate functions
  * funcretnode is now always a simple node instead of a block of
    statements
  * funcret and methodpointer are generated/optimized only in pass_1 so
    a conversion from calln to loadn is much easier
  * function result assignments are much more often optimized to use the
    assignment destination location instead of using a temp

git-svn-id: trunk@8558 -
2007-09-18 22:12:07 +00:00
Jonas Maebe
0040eecf9f + support for extra packing of sets whose lower element number
is <> 0 (Delphi compatible now, + various tests)
  + support for enums and sets in is_in_limit()
  * fixed converting smallset expressions to varsets
  * improved choosing an appropriate common set type when mixing
    set types in an expression
  - removed no longer used normalset code from nadd.pas
  - disabled large set (>256 elements) support for now, because
    they are not yet supported entirely throughout the compiler
    and this causes errors at run time in several situations

git-svn-id: trunk@8515 -
2007-09-16 20:04:45 +00:00
florian
0a50052802 * allow <const. node> -> <struct. type> type casts for internal type cast nodes, this is required by the softfloat code generator, it was forbidden by rev. 8369
git-svn-id: trunk@8504 -
2007-09-16 11:53:05 +00:00
Jonas Maebe
e1aefdbac5 * Improved escape analysis so the improved tretopt no longer fails.
The downside is that because it is context-insensitive, several
    (correct) optimizations which were performed in the past no longer
    are now (and while some new ones are done now, the downside is bigger
    -- but at least the code should be correct in all cases now)

git-svn-id: trunk@8385 -
2007-09-05 13:29:22 +00:00
Jonas Maebe
1ee8207ffa * fixed mantis #9522: no longer allow typecasting ordinal constants
to complex types (caused a lot of internal errors later on, and
    was also Delphi-incompatible)

git-svn-id: trunk@8369 -
2007-09-03 15:55:26 +00:00
Jonas Maebe
30e618ccb6 * fixed typecast error in last char/widechar/widestring patch
git-svn-id: trunk@8358 -
2007-09-02 20:29:26 +00:00
Jonas Maebe
eddc507a13 * disallow widechar sets (Delphi 7 compatible, and were handled wrongly
by FPC previously)
  * tbs/tb0474 now fails -> renamed to tbf/tb0201 (+ new test tbf/tb0202)

git-svn-id: trunk@8284 -
2007-08-14 14:27:59 +00:00
Jonas Maebe
d73e79f163 * fixed regression of webtbs/tw4254: if a constant (wide)string can't be
converted to a pchar at compile time, remove the cstring_to_pchar node
    because it expects a stringconstn in pass_generate_code

git-svn-id: trunk@8275 -
2007-08-13 09:13:07 +00:00
Jonas Maebe
815cd2b39d + support for widestring manager based widechar conversions
(widechar<->char, widechar<>*string), based on patch from
    Rimgaudas Laucius (mantis #7758)
  * no longer perform compile-time widechar/string->char/ansi/
    shortstring conversions if they would destroy information
    (they can't cope with widechars with ord>=128). This means
    that you can now properly constant widechars/widestrings
    in source code with a {$codepage } set without risking that
    the compiler will mangle everything afterwards
  * support ESysEINVAL return code from iconv (happens if last
    multibyte char is incomplete)
  * fixed writing of widechars (were converted to char -> lost
    information)

git-svn-id: trunk@8274 -
2007-08-12 20:01:08 +00:00
daniel
6e0a7bb0eb * Nil constants that are type converted to a method procvar are now
properly converted. The conversion is done at runtime to generate
    a two pointer memory reference as result location, something
    which the code generator can handle very well, which minimizes
    the chance of side effects.

git-svn-id: trunk@7978 -
2007-07-07 20:57:05 +00:00
daniel
d4280b3dec * Limit warning to orddefs to reduce false positives.
git-svn-id: trunk@7887 -
2007-07-01 09:34:13 +00:00
daniel
4ea8448c6d + Warn when converting pointers to signed types.
git-svn-id: trunk@7884 -
2007-07-01 09:05:11 +00:00
daniel
45832d4314 + New hint; for exmaple int64:=longint+longint says "Converting the operands to
int64 before addition could prevent an overflow error."

git-svn-id: trunk@7817 -
2007-06-26 07:52:04 +00:00
yury
5b5050a09c * Fixed integer to single conversion for arm-wince. It fixes tw8055.pp test.
git-svn-id: trunk@7757 -
2007-06-21 14:08:58 +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
Jonas Maebe
8d13899d84 * fixed memory leak in conversion of realconstn to currency
git-svn-id: trunk@7630 -
2007-06-10 22:02:53 +00:00
daniel
616fc0afcc * Adjust indent.
git-svn-id: trunk@7591 -
2007-06-06 20:10:35 +00:00
daniel
fe5118e903 * Reduce false positives of type_h_use_div_for_int.
git-svn-id: trunk@7590 -
2007-06-06 19:50:04 +00:00
Jonas Maebe
9cec910eb9 * changed *string_to_*chararray helpers from functions into procedures
because on win64 the location of a function result can depend on its
    size (so some chararrays had to be returned in registers and others
    by reference, which means it's impossible to have a generic function
    declaration which works in all cases) (mantis #8533)
  * pad constant string assignments to chararrays with #0 up to the
    length of the chararray for 2.0.x compatibility (fixes
    tests/test/tarray3)

git-svn-id: trunk@6915 -
2007-03-18 12:20:01 +00:00
Jonas Maebe
69cf42c4f7 * fixed val(s,int64) (it accepted values in the range
high(int64+1)..high(qword) if written in decimal notation) + test
  * fixed range checking of qword constants parsed by the compiler
    (they always gave a range error if > high(int64), because the compiler
     internally stores them as int64)
  * turn off range checking flag of rdconstnodes created by the parser
    from _INTCONST, because those are already range checked by the
    way they are parsed using val()

git-svn-id: trunk@6814 -
2007-03-12 22:22:43 +00:00
Jonas Maebe
c13ff3729b * Merged 2.3 branch changes:
+ darwin/ppc64 support
    + val/str/read(ln)/write(ln) support for enums
    + simple cse at the node tree level
    + if-node simplify support
    + simple ssa support for memory locations
    + support for optional overflow/rangecheck boolean parameters for
      operators
    * a lot of unification of the ppc32/ppc64 code generators


........
r6380 | jonas | 2007-02-08 21:25:36 +0100 (Thu, 08 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ncgld.pas
   M /branches/fpc_2_3/compiler/tgobj.pas
   A /branches/fpc_2_3/tests/webtbs/tw8283.pp

  + support for replacing the memory location of a temp (including
    local variables) with that of another temp to avoid unnecessary
    copies (mantis #8283)

........
r6381 | jonas | 2007-02-08 22:53:36 +0100 (Thu, 08 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/nflw.pas
   A /branches/fpc_2_3/tests/webtbs/tw8282.pp

  + simplify support for ifn (based on patch by Florian)

........
r6386 | peter | 2007-02-09 13:48:53 +0100 (Fri, 09 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/htypechk.pas
   M /branches/fpc_2_3/compiler/ncal.pas
   M /branches/fpc_2_3/compiler/symconst.pas

  * overflow,rangecheck optional parameters for operators, patch from 8281

........
r6391 | jonas | 2007-02-09 23:52:13 +0100 (Fri, 09 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc/agppcgas.pas
   M /branches/fpc_2_3/compiler/powerpc64/cpunode.pas
   D /branches/fpc_2_3/compiler/powerpc64/nppcinl.pas
   M /branches/fpc_2_3/compiler/ppcgen/ngppcinl.pas

  * merged fsqrt(s) support to common powerpc unit, activate for ppc32
    if -Op970 is used (still default for ppc64, since default cpu there
    is already ppc970)

........
r6394 | jonas | 2007-02-10 18:58:47 +0100 (Sat, 10 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc/cgcpu.pas
   M /branches/fpc_2_3/compiler/powerpc64/cgcpu.pas
   M /branches/fpc_2_3/compiler/ppcgen/cgppc.pas

  * adapted a_jmp_name for darwin/ppc64
  * merged g_intf_wrapper for ppc32 and ppc64, and added darwin/ppc64
    support to it

........
r6396 | jonas | 2007-02-10 20:16:06 +0100 (Sat, 10 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/cgobj.pas

  + darwin/ppc64 support for g_indirect_sym_load

........
r6397 | jonas | 2007-02-10 20:22:49 +0100 (Sat, 10 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc/cgcpu.pas
   M /branches/fpc_2_3/compiler/powerpc64/cgcpu.pas
   M /branches/fpc_2_3/compiler/ppcgen/cgppc.pas

  + darwin/ppc64 support to ppc64's fixref
  * moved ppc32 a_load_store to cgppc and use it for darwin/ppc64 as
    well (its relocatable symbols are only 32 bits large)

........
r6399 | jonas | 2007-02-10 22:02:37 +0100 (Sat, 10 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems.pas

  + system_x86_64_darwin identifier
  + set default source system for system_x86_64_darwin and
    system_powerpc64_darwin

........
r6404 | jonas | 2007-02-10 23:01:23 +0100 (Sat, 10 Feb 2007) | 5 lines
Changed paths:
   M /branches/fpc_2_3/compiler/aasmdata.pas
   M /branches/fpc_2_3/compiler/aggas.pas
   M /branches/fpc_2_3/compiler/cgobj.pas
   M /branches/fpc_2_3/compiler/cgutils.pas
   M /branches/fpc_2_3/compiler/cresstr.pas
   M /branches/fpc_2_3/compiler/dbgdwarf.pas
   M /branches/fpc_2_3/compiler/dbgstabs.pas
   M /branches/fpc_2_3/compiler/ncgutil.pas
   M /branches/fpc_2_3/compiler/ogelf.pas
   M /branches/fpc_2_3/compiler/pdecvar.pas
   M /branches/fpc_2_3/compiler/pmodules.pas
   M /branches/fpc_2_3/compiler/symdef.pas
   M /branches/fpc_2_3/compiler/systems.pas

  + system_x86_64_darwin identifier
  + systems_darwin set which collects all darwin variants
  + added support for darwin/ppc64 and darwin/x86_64 where needed in
    the generic code

........
r6406 | jonas | 2007-02-10 23:24:32 +0100 (Sat, 10 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/cgobj.pas

  * ifdef cpu64 -> ifdef cpu64bit

........
r6409 | jonas | 2007-02-11 00:34:04 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/pdecvar.pas

  * fixed ppc64 compilation

........
r6413 | jonas | 2007-02-11 12:41:27 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/bsd/system.pp
   M /branches/fpc_2_3/rtl/darwin/powerpc/sig_cpu.inc
   M /branches/fpc_2_3/rtl/darwin/signal.inc

  + darwin/ppc64 support for signal routines

........
r6415 | jonas | 2007-02-11 13:54:53 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems/i_linux.pas

  * set abi of linux/ppc64 to abi_powerpc_sysv

........
r6416 | jonas | 2007-02-11 13:55:51 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc64/cputarg.pas
   M /branches/fpc_2_3/compiler/systems/i_bsd.pas
   M /branches/fpc_2_3/compiler/systems/t_bsd.pas

  + darwin/ppc64 source and target information

........
r6418 | jonas | 2007-02-11 14:19:55 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/powerpc64/math.inc

  * darwin/ppc64 compilation fixes

........
r6419 | jonas | 2007-02-11 14:22:22 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc/cgcpu.pas
   M /branches/fpc_2_3/compiler/powerpc64/cgcpu.pas
   M /branches/fpc_2_3/compiler/ppcgen/cgppc.pas

  * darwin/ppc64 needs the 32 bit version of a_loadaddr_ref_reg

........
r6420 | jonas | 2007-02-11 14:22:55 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/utils/fpcm/fpcmmain.pp

  + darwin/ppc64 support

........
r6426 | jonas | 2007-02-11 16:13:19 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc64/rappcgas.pas

  * fixed refaddr parsing for darwin/ppc64

........
r6427 | jonas | 2007-02-11 16:14:21 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc/agppcgas.pas
   M /branches/fpc_2_3/compiler/powerpc64/agppcgas.pas
   A /branches/fpc_2_3/compiler/ppcgen/agppcutl.pas

  * moved ppc32/ppc64 assembler writer helpers to a common unit

........
r6430 | jonas | 2007-02-11 17:53:23 +0100 (Sun, 11 Feb 2007) | 4 lines
Changed paths:
   D /branches/fpc_2_3/rtl/darwin/powerpc/sig_cpu.inc
   D /branches/fpc_2_3/rtl/darwin/powerpc/sighnd.inc
   A /branches/fpc_2_3/rtl/darwin/powerpc64
   A /branches/fpc_2_3/rtl/darwin/powerpc64/sig_cpu.inc
   A /branches/fpc_2_3/rtl/darwin/powerpc64/sighnd.inc
   A /branches/fpc_2_3/rtl/darwin/ppcgen
   A /branches/fpc_2_3/rtl/darwin/ppcgen/ppchnd.inc (from /branches/fpc_2_3/rtl/darwin/powerpc/sighnd.inc:6422)
   A /branches/fpc_2_3/rtl/darwin/ppcgen/sig_ppc.inc (from /branches/fpc_2_3/rtl/darwin/powerpc/sig_cpu.inc:6422)
   M /branches/fpc_2_3/rtl/darwin/signal.inc

  * fixed ppc/ppc64 signal include handling (both real files are in
    ppcgen, dummies in powerpc and powerpc64 which include those files)
    (1st step because pre-commit filter can't handle replaced files)

........
r6431 | jonas | 2007-02-11 17:53:47 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   A /branches/fpc_2_3/rtl/darwin/powerpc/sig_cpu.inc
   A /branches/fpc_2_3/rtl/darwin/powerpc/sighnd.inc

  * second step of signal include patch

........
r6432 | jonas | 2007-02-11 19:00:12 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems/t_bsd.pas

  * changed darwin checks to use systems_darwin constant

........
r6433 | jonas | 2007-02-11 19:05:38 +0100 (Sun, 11 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc64/cgcpu.pas

  * handle non-multiple-of-4 offsets with 64 bit loads/stores for
    darwin/ppc64

........
r6434 | jonas | 2007-02-11 19:05:56 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   D /branches/fpc_2_3/compiler/powerpc/agppcgas.pas
   D /branches/fpc_2_3/compiler/powerpc64/agppcgas.pas
   A /branches/fpc_2_3/compiler/ppcgen/agppcgas.pas (from /branches/fpc_2_3/compiler/ppcgen/agppcutl.pas:6427)
   D /branches/fpc_2_3/compiler/ppcgen/agppcutl.pas

  * completely merged ppc assembler writers

........
r6435 | jonas | 2007-02-11 19:06:40 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/darwin/console.pp
   M /branches/fpc_2_3/rtl/darwin/termiosproc.inc

  * fixed 64 bit compilation

........
r6436 | jonas | 2007-02-11 19:09:28 +0100 (Sun, 11 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/packages/extra/Makefile.fpc

  * universal interfaces aren't 64 bit ready yet -> only compile for
    darwin/ppc and darwin/i386

........
r6438 | jonas | 2007-02-11 19:22:34 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   A /branches/fpc_2_3/tests/test/cg/obj/darwin/powerpc64
   A /branches/fpc_2_3/tests/test/cg/obj/darwin/powerpc64/ctest.o
   A /branches/fpc_2_3/tests/test/cg/obj/darwin/powerpc64/tcext3.o
   A /branches/fpc_2_3/tests/test/cg/obj/darwin/powerpc64/tcext4.o
   A /branches/fpc_2_3/tests/test/cg/obj/darwin/powerpc64/tcext5.o

  + compiled for darwin/ppc64

........
r6439 | jonas | 2007-02-11 20:24:42 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ppcgen/cgppc.pas

  * patch from Thomas to fix linux/ppc64

........
r6440 | jonas | 2007-02-11 20:25:15 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems.pas

  * fixed setting source OS for darwin/ppc64

........
r6444 | florian | 2007-02-11 22:24:20 +0100 (Sun, 11 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/globtype.pas
   M /branches/fpc_2_3/compiler/nopt.pas
   M /branches/fpc_2_3/compiler/nutils.pas
   M /branches/fpc_2_3/compiler/optcse.pas
   M /branches/fpc_2_3/compiler/psub.pas

+ first node cse implementation

........
r6445 | jonas | 2007-02-11 22:30:07 +0100 (Sun, 11 Feb 2007) | 6 lines
Changed paths:
   M /branches/fpc_2_3/compiler/cresstr.pas

  * hack to work around strange darwin/ppc64 linker bug: it seems to
    have problems if you put a global symbol at the end of a section
    without any data following (at least in case of the resource strings
    section) -> add dummy byte at the end for darwin/ppc64 (otherwise
    it messes up the address of the first symbol stub entry)

........
r6449 | jonas | 2007-02-11 23:23:44 +0100 (Sun, 11 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems/i_bsd.pas

  * cpupowerpc is defined for both ppc32 and ppc64 ->
    changed to cpupowerpc32 to avoid defining source
    wrongly on ppc64

........
r6450 | jonas | 2007-02-11 23:26:34 +0100 (Sun, 11 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ppcgen/ngppcset.pas

  * disable jump tables for darwin/ppc64 for now, don't work
    yet for some reason

........
r6451 | florian | 2007-02-11 23:54:37 +0100 (Sun, 11 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ncal.pas
   M /branches/fpc_2_3/compiler/nutils.pas
   M /branches/fpc_2_3/compiler/optcse.pas

* improved cse
* better complexity calculation for subscript nodes with classes or interfaces

........
r6456 | jonas | 2007-02-12 19:33:22 +0100 (Mon, 12 Feb 2007) | 4 lines
Changed paths:
   M /branches/fpc_2_3/compiler/nutils.pas

  + support for notn,shln,shrn,equaln,unequaln,gtn,gten,ltn,lten in
    node_cplexity()
  * mark muln,divn,modn as more complex

........
r6469 | jonas | 2007-02-13 15:56:01 +0100 (Tue, 13 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/optcse.pas

  * fixed when cross-compiling a 64 bit compiler from a 32 bit platform

........
r6471 | jonas | 2007-02-13 16:17:16 +0100 (Tue, 13 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc64/cputarg.pas

  * include stabs support (can work on darwin/ppc64, but doesn't work
    yet)

........
r6473 | jonas | 2007-02-13 16:45:48 +0100 (Tue, 13 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc64/cgcpu.pas
   M /branches/fpc_2_3/compiler/powerpc64/cpupara.pas

  * R2 is a volatile and usable register under darwin/ppc64
  * R13 is a reserved non-volatile register under darwin/ppc64 (tls)

........
r6479 | jonas | 2007-02-13 20:40:50 +0100 (Tue, 13 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems/i_bsd.pas

  * maxCrecordalign seems to have to be 8 rather 4, in spite of what
    the ABI docs say (although they are contradictory to some extent)

........
r6487 | jonas | 2007-02-14 15:57:40 +0100 (Wed, 14 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/tests/webtbs/tw8153a.pp

  * fixed for darwin/ppc64

........
r6488 | jonas | 2007-02-14 15:58:56 +0100 (Wed, 14 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/tests/webtbs/tw7851a.pp

  * fixed for darwin/ppc64

........
r6494 | jonas | 2007-02-15 19:36:55 +0100 (Thu, 15 Feb 2007) | 3 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems/i_bsd.pas

  * set default debug info for darwin/ppc64 to dwarf2 since
    it works better than stabs currently

........
r6500 | jonas | 2007-02-15 21:38:16 +0100 (Thu, 15 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/version.pas

  * updated version to 2.3.0

........
r6505 | jonas | 2007-02-15 22:39:28 +0100 (Thu, 15 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/version.pas

  * changed version to 2.3.1

........
r6511 | jonas | 2007-02-16 15:17:24 +0100 (Fri, 16 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/powerpc64/itcpugas.pas

  * system_powerpc_darwin -> system_powerpc64_darwin

........
r6546 | daniel | 2007-02-18 15:48:54 +0100 (Sun, 18 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ncginl.pas
   M /branches/fpc_2_3/compiler/ncgld.pas
   M /branches/fpc_2_3/compiler/ncgrtti.pas
   M /branches/fpc_2_3/compiler/ncnv.pas
   M /branches/fpc_2_3/compiler/ninl.pas
   M /branches/fpc_2_3/compiler/nld.pas
   M /branches/fpc_2_3/compiler/nutils.pas
   M /branches/fpc_2_3/compiler/pinline.pas
   M /branches/fpc_2_3/rtl/inc/astrings.inc
   M /branches/fpc_2_3/rtl/inc/compproc.inc
   M /branches/fpc_2_3/rtl/inc/sstrings.inc
   M /branches/fpc_2_3/rtl/inc/text.inc
   M /branches/fpc_2_3/rtl/inc/wstrings.inc

  + Val/str/read/write support for enumeration types.

........
r6547 | daniel | 2007-02-18 17:01:20 +0100 (Sun, 18 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/inc/sstrings.inc

  * Fix val code that I broke.

........
r6571 | daniel | 2007-02-20 09:27:44 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/inc/astrings.inc
   M /branches/fpc_2_3/rtl/inc/sstrings.inc
   M /branches/fpc_2_3/rtl/inc/text.inc
   M /branches/fpc_2_3/rtl/inc/wstrings.inc

  * o2s -> ord2str, s2o -> str2ord

........
r6572 | daniel | 2007-02-20 09:33:30 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ncgld.pas
   M /branches/fpc_2_3/compiler/ncgrtti.pas
   M /branches/fpc_2_3/compiler/ninl.pas
   M /branches/fpc_2_3/compiler/nld.pas

  * o2s -> ord2str, s2o -> str2ord

........
r6574 | daniel | 2007-02-20 12:07:58 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/inc/compproc.inc

  * o2s -> ord2str, s2o -> str2ord

........
r6578 | daniel | 2007-02-20 22:18:49 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/rtl/inc/text.inc

  * Change longint to valsint.

........
r6579 | daniel | 2007-02-20 22:29:09 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ninl.pas

  * Handle ordinal currency types.

........
r6580 | jonas | 2007-02-20 22:29:11 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ncgrtti.pas

  * fixed compilation for cpurequiresproperalignment

........
r6581 | jonas | 2007-02-20 22:30:21 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ninl.pas

  * fixed typo

........
r6582 | daniel | 2007-02-20 22:36:19 +0100 (Tue, 20 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/ninl.pas

  * Set is_real to true.

........
r6590 | jonas | 2007-02-21 20:23:54 +0100 (Wed, 21 Feb 2007) | 2 lines
Changed paths:
   M /branches/fpc_2_3/compiler/systems/i_bsd.pas

  * set tf_dwarf_only_local_labels for darwin/ppc64

git-svn-id: trunk@6720 -
2007-03-04 20:16:57 +00:00
florian
821e6abae1 * better set_to_set for setconst nodes
git-svn-id: trunk@6656 -
2007-02-25 21:07:32 +00:00
florian
9a0f769b2f * cleaned up set conversion
* fixed conversion of var sets

git-svn-id: trunk@6644 -
2007-02-25 16:29:39 +00:00
florian
2579cd139f + support for sets with size 1 and 2
git-svn-id: trunk@6172 -
2007-01-24 20:06:56 +00:00
pierre
0cfa2a6aad * Use IncRefCountBy in convert-operator
git-svn-id: trunk@6141 -
2007-01-23 05:47:59 +00:00
pierre
9a90410081 * ttypeconvnode.simplify, avoid a memory leak
git-svn-id: trunk@5551 -
2006-12-07 13:06:31 +00:00
florian
6118c3e477 * fixed assembling of movd with 64 bit registers
* fixed passing of floats to c varargs

git-svn-id: trunk@5477 -
2006-11-25 20:32:32 +00:00
Jonas Maebe
c0d46e65ee * (finally) fixed tests/test/trangeob.pp
git-svn-id: trunk@5434 -
2006-11-20 22:03:08 +00:00
florian
a13d358f1e * first partially working implementation of variant com invoking
git-svn-id: trunk@5247 -
2006-11-05 15:34:15 +00:00
florian
4cbb67aa00 * some fpu emulation code from arm to generic code generator moved
* several m68k fixes

git-svn-id: trunk@5218 -
2006-11-04 10:23:35 +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
Jonas Maebe
d87f03eef5 - removed automatic int-string, string-int and int-array conversion for
macpas after discussion on macpascal mailing list. The only thing left
    is automatic conversion of constant strings of length 4 to 32 bit ints.
  * adapted tests to this
  * fixed FOUR_CHAR_CODE and FCC functions in MacPas unit for little
    endian
  + FourCharArray type in macpas unit wich can be used to typecast
    int's "back" to an array[1..4] of char (though the characters
    will be in reverse on little endian systems in that case)

git-svn-id: trunk@5154 -
2006-11-01 16:34:37 +00:00
Jonas Maebe
5acc8b44a8 * activated internal get_frame for x86
* turn off stackframe optimizations on x86 if get_frame is called
    in the current routine, or if the address of a nested function
    is taken in the current routine
  + test for the above
  * this fixes the IDE when compiled with stackframe optimizations
    on x86

git-svn-id: trunk@5146 -
2006-11-01 12:48:53 +00:00
peter
136d3e8d46 * refactor implemented interfaces
git-svn-id: trunk@5134 -
2006-10-31 22:38:49 +00:00
peter
cb246eb781 * Remove dos,strings units, use SysUtils instead
* replace split* functions with Extract* functions
  * Add Directory caching

git-svn-id: trunk@5102 -
2006-10-30 23:29:35 +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
Jonas Maebe
943582b5f0 * fixed (macpas, non-constant) string to int conversion for little
endian targets

git-svn-id: trunk@5004 -
2006-10-22 18:16:59 +00:00
Jonas Maebe
2dd6a91a9f + allow implicit type conversions of 4 byte integers to strings for
parameter matching in macpas mode

git-svn-id: trunk@4957 -
2006-10-18 18:14:54 +00:00
florian
67aa148602 * fixed softfpu support
+ softfpu enabled for arm-gba

git-svn-id: trunk@4939 -
2006-10-15 21:31:27 +00:00
micha
5f353d6fef add warning for arithmetic on untyped pointers
git-svn-id: trunk@4823 -
2006-10-07 19:34:16 +00:00
peter
d07f470b71 * remove ifdef fpc
git-svn-id: trunk@4819 -
2006-10-07 13:43:34 +00:00
Jonas Maebe
564f36f51e * process tasnode.call in foreach(static) (fixes tw7391 with regvars on ppc)
git-svn-id: trunk@4783 -
2006-10-04 12:00:09 +00:00
Jonas Maebe
733f559267 * also perform C varargs type conversions for cdecl procedures declared
as "varargs" instead of using an array of const parameter

git-svn-id: trunk@4572 -
2006-09-08 16:04:15 +00:00
florian
d4848169e1 * as operator isn't allowed for non com interfaces
git-svn-id: trunk@3646 -
2006-05-23 18:52:56 +00:00
Jonas Maebe
e0250bcdb4 * never remove regvar-ability of parameters passed by reference
(previously worked only for var/out, now also for const and
     is more generic)

git-svn-id: trunk@3554 -
2006-05-17 13:38:02 +00:00
florian
3c4207bbe0 * fixed i.e. when type casting array constructors
git-svn-id: trunk@3532 -
2006-05-14 20:13:56 +00:00
peter
810a776e10 * patch from Jonas to pass interface result as parameter
git-svn-id: trunk@3199 -
2006-04-13 07:04:48 +00:00
Jonas Maebe
039e7143f4 * avoid some unnecessary bool->int->bool type conversions
git-svn-id: trunk@3184 -
2006-04-09 18:33:05 +00:00
Jonas Maebe
ac11ab43a2 * fixed wrong conversions from real to currency/int64 for x86
git-svn-id: trunk@2954 -
2006-03-18 13:20:58 +00:00
Jonas Maebe
4db6e1ddb8 * moved type conversion of C varargs from tcallnode to
tarrayconstructornode.inset_typeconvs() and fixed them:
    * integers < 32 bit are converted to 32 bit (this was previously
      done in the code generator for some targets, and not for others)
    * currency is also converted to double for targets where currency = int64
    * single is converted to double, except for x86_64 (is at least
      necessary on darwin/ppc, darwin/i386 and linux/i386)
    * enums are converted to 32 bit ints
    * procvars are converted to pointers
    * proper errors are given for various unsupported types
   NOTE: in C, floating point constants are by default double, while in
    FPC they are of type extended. On platforms where extended <> double,
    such constants when passed to C varargs are automatically converted
    to double by default (gives warning). If you want to pass them as
    single or extended or get rid of the warning, use an explicit typecast
  * increased ppu version because of introduction of new node flag
    (nf_cvarargs for tarrayconstructornode)
  * fixed tests/test/cg/tprintf
  * changed tests/test/cg/cdecl/taoc5 to use explicit typecasts for
    floating point constants passed to C varargs functions.

git-svn-id: trunk@2949 -
2006-03-17 22:26:48 +00:00
Jonas Maebe
5fbc345674 + some simplify support for ttypeconvnode
git-svn-id: trunk@2774 -
2006-03-05 21:38:05 +00:00
peter
232555904e * symtablestack cleanup and rewrite
git-svn-id: trunk@2448 -
2006-02-05 22:24:18 +00:00
peter
45176ea2a8 * split tstringtype for stringdef and stringconstnode
to prevent wrong typecasts

git-svn-id: trunk@2276 -
2006-01-13 17:20:27 +00:00
Jonas Maebe
58381ff7b6 * made chararray handling 98% TP-compatible, fixes web bugs 3012
and 4080. The compatibility differences are:
      a) writing a chararray which is zero-based but not zero-
         terminated does not cause a buffer overflow
      b) non-zero-based chararrays can also be read

    The difference was that previously, all chararrays were treated
    as pchars. In TP/Delphi (and now also in FPC), this is only done
    for zero-based chararrays. For non-zero-based ones, the entire
    contents of the array should always be used (including #0's).

    The default parameters in the system unit for the chararray
    helpers are to avoid having to use a define for bootstrapping.

git-svn-id: trunk@2152 -
2006-01-04 10:05:10 +00:00
florian
e4a8f008a7 * fixed ie when "converting" double to double and single to single on softemu
git-svn-id: trunk@2031 -
2005-12-22 22:24:02 +00:00
Jonas Maebe
42ec76598c * new categories for vs_*: vs_declared, vs_initialised, vs_read,
vs_written, vs_readwritten. vs_initialised is the old vs_assigned;
    vs_used has been replaced by vs_read, vs_written and vs_readwritten
  * the valid_for_*() routines in htypechk now get an extra parameter to
    decide whether or not errors should be reported

git-svn-id: trunk@1913 -
2005-12-10 16:51:26 +00:00
florian
1ef533ffa9 * rtti parameter for dyn. array to variant conversion fixed
git-svn-id: trunk@1590 -
2005-10-23 19:41:16 +00:00
peter
f9db030350 * fix overload choosing if both normal proc and proc of object are available
git-svn-id: trunk@1496 -
2005-10-19 07:56:08 +00:00
peter
8d9e9b24a6 * convert constant widestring to ansistring before assigning to pchar
git-svn-id: trunk@1482 -
2005-10-18 20:49:23 +00:00
peter
8b60dbe4cb * support constant array of char to array of widechar
git-svn-id: trunk@1475 -
2005-10-18 12:31:30 +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
edf553a223 * string constants are now array of char until
they are converted to a specific string type

git-svn-id: trunk@1254 -
2005-10-02 11:08:58 +00:00
peter
2f0fdd1847 * cleaner fix for tb0496 (r1185)
git-svn-id: trunk@1196 -
2005-09-25 19:23:37 +00:00
florian
be99f2a7fd * fixed loading of addresses of virtual methods to methodpointers in delphi mode
git-svn-id: trunk@1182 -
2005-09-25 10:58:17 +00:00
florian
a53c9e2666 * fixed stupid copy/paste which turned softfloat always off
* fixed wince softfloat compiler proc. to be correctly named also when used outside the system unit

git-svn-id: trunk@966 -
2005-08-28 21:08:23 +00:00
florian
adb193497d + softfloat support for wince
* more units are build for wince

git-svn-id: trunk@959 -
2005-08-28 12:40:43 +00:00
peter
376865d041 * mark variables used in set creation
git-svn-id: trunk@706 -
2005-07-20 06:44:59 +00:00
florian
7c10694bc3 * fixed widechar const to widestring, fixes bug #4155
git-svn-id: trunk@638 -
2005-07-17 08:49:38 +00:00
peter
91b59bc62a * don't check ranges for explicit typecasts of ordinal to pointer constants
git-svn-id: trunk@586 -
2005-07-05 07:14:30 +00:00
peter
bead787962 * fix type checking in constant sets
git-svn-id: trunk@583 -
2005-07-05 06:03:16 +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
68ac3b0ab2 remove forcing of non-regvar for left node when converting to non-regvar 2005-04-08 15:16:37 +00:00
michael
55e76063df * Fix methodpointer copy from callnode to loadnode 2005-04-06 11:49:37 +00:00
peter
3f9d6ab32f * add hint when passing an uninitialized variable to a var parameter 2005-03-25 22:20:18 +00:00
florian
737a81f30b + array -> dyn. array type cast 2005-03-11 21:55:43 +00:00
Jonas Maebe
adc5f048eb * fixed small bug in ttypeconvnode.printnodeinfo 2005-03-05 16:09:20 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
florian
a2a4985896 * in delphi mode const sets from enumerations with values > 255 are allowed if these elements aren't used 2005-02-03 18:43:59 +00:00
peter
4631658576 * add info that a procedure is local in error messages 2005-01-30 11:26:40 +00:00
peter
f4ec016665 * fix crash with -CR 2005-01-09 15:04:36 +00:00
florian
3cb0a53eca + compiler side of variant<->interface implemented 2005-01-07 21:14:21 +00:00
florian
ef9b70f1f4 * 1.0.10 starting patch from Peter 2005-01-06 13:40:41 +00:00
florian
7aa53f09cc * widechararray patch from Peter 2005-01-06 13:30:40 +00:00
florian
80af47489d + first batch of patches to support tdef.getcopy fully 2005-01-03 17:55:57 +00:00
peter
f0267daa4a * also don't call procvar when converting to procvar 2004-12-27 16:54:29 +00:00
peter
ced6bf20cd * fix lineinfo for with blocks 2004-12-26 16:22:01 +00:00
peter
78c2af7b3c * set vo_explicit_paraloc flag 2004-12-07 16:11:52 +00:00
peter
2b6456fe16 * procvar handling for tp procvar mode fixed
* proc to procvar moved from addrnode to typeconvnode
  * inlininginfo is now allocated only for inline routines that
    can be inlined, introduced a new flag po_has_inlining_info
2004-12-05 12:28:10 +00:00
florian
8b9c48e7fb * fixed compiler side of variant <-> dyn. array conversion 2004-12-05 12:15:11 +00:00
peter
1fcd2cd8ad * internal flag for compare_defs_ext 2004-11-26 22:34:28 +00:00
peter
4d8460ec2f * float routines all use internproc and compilerproc helpers 2004-11-21 15:35:23 +00:00
Jonas Maebe
14197fb830 * copy totype field in ttypeconvnode.getcopy() 2004-11-02 20:15:53 +00:00
peter
2e161c5e9e * nf_internal flag for internal inserted typeconvs. This will
supress the generation of warning/hints
2004-11-02 12:55:16 +00:00
peter
9b00c7832e * support > 32bit accesses for x86_64
* rewrote array size checking to support 64bit
2004-11-01 23:30:11 +00:00
peter
2aceb6f856 * no checkpointer code for dynarr to openarr 2004-11-01 17:15:47 +00:00
peter
a2cbf27e96 * -Or fix for absolute 2004-11-01 15:31:57 +00:00
peter
adb6f59eef * small regvar fixes
* loadref parameter removed from concatcopy,incrrefcount,etc
2004-10-24 11:44:28 +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
f1ae6fb6d4 * give error when converting class to interface are not related 2004-10-12 14:33:41 +00:00
peter
66df745917 * small regvar for para fixes
* function tvarsym.is_regvar added
  * tvarsym.getvaluesize removed, use getsize instead
2004-10-11 15:48:15 +00:00
peter
8fb3536f6e * simple regvar support, not yet finished 2004-09-26 17:45:29 +00:00
florian
120c165a62 * constant floating point assignments etc. are now overflow checked
if Q+ or R+ is turned on
2004-08-08 16:00:56 +00:00
peter
e179e7d9e1 * fix pchar:=char
* fix longint(smallset)
2004-06-29 20:57:50 +00:00
peter
cf3c1198ea * include unit name in error messages when types are the same 2004-06-23 16:22:45 +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
b86f2c6a25 * methodpointer is loaded into a temp when it was a calln 2004-05-23 18:28:40 +00:00
peter
a9df763770 * some typeconvs don't allow assignment or passing to var para 2004-05-23 15:03:40 +00:00
florian
d6b865167c + added set of widechar support (limited to 256 chars, is delphi compatible) 2004-05-23 14:14:18 +00:00
daniel
b721e5872c * Prepare compiler infrastructure for multiple ansistring types 2004-04-29 19:56:36 +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
peter
6b96b70118 * fixed operator overload allowing for pointer-string
* replaced some type_e_mismatch with more informational messages
2004-03-18 16:19:03 +00:00
florian
1d8b4661b8 * message about illegal type conversion reports now the types 2004-02-21 16:03:10 +00:00
peter
c844c5a505 * procvar cleanup 2004-02-20 21:55:59 +00:00
peter
3a3fdde6d1 * compare_defs_ext has now a options argument
* fixes for variants
2004-02-13 15:42:21 +00:00
florian
465aa5851b * several fixes to compile x86-64 system 2004-02-05 01:24:08 +00:00
daniel
d735071838 * Rtti generation moved to ncgutil
* Assmtai usage of symsym removed
  * operator overloading cleanup up
2004-02-04 22:15:15 +00:00
peter
ecfbbeffc3 * renamed xNNbittype to xNNinttype
* renamed registers32 to registersint
  * replace some s32bit,u32bit with torddef([su]inttype).def.typ
2004-02-03 22:32:53 +00:00
daniel
97e87aaebc * reginfo now also only allocated during register allocation
* third round of gdb cleanups: kick out most of concatstabto
2004-01-26 16:12:27 +00:00
florian
3d8e1ab1fb + fpu<->mm register conversion 2003-12-26 00:32:21 +00:00
peter
f2d2c4c496 * fix rangecheck error 2003-12-22 23:11:15 +00:00
peter
1260eed8fd * again procvar fixes 2003-12-08 22:35:28 +00:00
Jonas Maebe
3c33590a80 * fixed range error 2003-11-22 00:31:52 +00:00
florian
8b337fb5ef + type cast variant<->enum
* cnv. node second pass uses now as well helper wrappers
2003-11-04 22:30:15 +00:00
peter
9b0dda9f42 * don't call proc_to_procvar for explicit typecasts 2003-10-31 18:42:03 +00:00
florian
6a06df943b * fixed passing of dyn. arrays to open array parameters 2003-10-29 22:01:20 +00:00
peter
079e489b08 * absolute to object field supported, fixes tb0458 2003-10-28 15:36:01 +00:00
peter
4a1ecb07d1 * splitted buildderef and buildderefimpl to fix interface crc
calculation
2003-10-23 14:44:07 +00:00
peter
6878c55c80 * write derefdata in a separate ppu entry 2003-10-22 20:39:59 +00:00
peter
a28d911c98 * IncompatibleTypes() added that will include unit names when
the typenames are the same
2003-10-21 18:16:13 +00:00
peter
a909ffdd35 * allow explicit typecasts from classrefdef, fixes 2728 2003-10-09 14:39:03 +00:00
peter
95f132db3d * set_varstate cleanup 2003-10-08 19:19:45 +00:00
peter
e55017a946 * fix 2720 2003-10-07 14:30:27 +00:00
peter
70fe77ca7c * procinfo unit contains tprocinfo
* cginfo renamed to cgbase
  * moved cgmessage to verbose
  * fixed ppc and sparc compiles
2003-10-01 20:34:48 +00:00
peter
0805c4e535 * fix different expectloc 2003-09-25 14:57:51 +00:00
florian
f3e9e7a24f * fixed web bug #2669
* cosmetic fix in printnode
  * tobjectdef.gettypename implemented
2003-09-06 22:27:08 +00:00
peter
6a8d5eb25d * NEWRA branch merged 2003-09-03 15:55:00 +00:00
peter
6731abb0db * fixed some reported bugs 2003-08-10 17:25:23 +00:00
peter
28ebc69c8f * removed changesettype because that will change the definition
of the setdef forever and can result in a different between
    original interface and current implementation definition
2003-06-05 20:05:55 +00:00
Jonas Maebe
d8725a18bf * disable fpuregable for fpu variables typecasted to non fpu-type 2003-06-04 17:55:09 +00:00
Jonas Maebe
ad0dd43c4b * fixed void_to_(int,pointer) typeconversion 2003-06-04 17:29:01 +00:00
peter
4d67ae9f31 * fix check for procedure without parameters
* calling constructor as member will not allocate memory
2003-06-03 21:05:48 +00:00
peter
26d78ff5c9 * moved implicit exception frame from ncgutil to psub
* constructor/destructor helpers moved from cobj/ncgutil to psub
2003-05-11 21:37:03 +00:00
peter
1a2eedd767 * self moved to hidden parameter
* removed hdisposen,hnewn,selfn
2003-05-09 17:47:02 +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
c21ca3dfa0 + added currency support based on int64
+ is_64bit for use in cg units instead of is_64bitint
  * removed cgmessage from n386add, replace with internalerrors
2003-04-23 20:16:03 +00:00