will only be used for indexing huge pointers (i.e. only huge arrays with the
ado_IsConvertedPointer array option will be supported). In the distant future,
regular huge arrays may be supported as well (but that would require
substantially more work, including adding hugeness support to other structures
such as records, objects and classes, so I'm not planning on doing it anytime
soon).
git-svn-id: trunk@28270 -
symdef.pas:
+ tabstractrecorddef: implement buildderefimpl and derefimpl which works on the symtable (especially derefimpl is important here)
- trecorddef & tobjectdef: remove buildderefimpl; it's already handled by the tabstractrecorddef one now
- tobjectdef: remove the part of derefimpl that's already handled by tabstractrecorddef
git-svn-id: trunk@28267 -
Comparisons are already not promoted if sides are equally signed, but this wasn't true for "unsigned vs constant" case, because constants are preferably parsed as signed.
The change considerably improves generated code for i386 and even more considerably for m68k. Tested on i386-win32.
git-svn-id: trunk@28266 -
* Better handling of LOC_CREGISTER locations.
+ Support direct compares of constants with references.
+ Optimize away comparison of low dword when its result is constant (cases of "less" and "greater or equal" comparing against a constant with zero low dword).
git-svn-id: trunk@28263 -
* Cleaned up 32-bit comparison code and implemented one of the optimizations (TST instruction for comparison with constant zero which can act directly on references). This makes system unit shorter by about 1000 instructions.
git-svn-id: trunk@28260 -
pgenutil.pas, generate_specialization:
* also search for the generic type in general if it was previously found in a record/class as there might be a non-generic type (or one with a different number of parameters) defined elsewhere
+ added test
git-svn-id: trunk@28244 -
symtable.pas, searchsym_in_helper:
* check whether extendeddef is assigned as this function is called when parsing the extended type and it was not found (the second pass is to display a more accurate error message and was added some weeks ago)
+ added test
git-svn-id: trunk@28242 -
cgmessage won't do anything in case cgerror is already set (and in several
places we assume that the compiler will immediately abort after throwing a
fatal error)
git-svn-id: trunk@28229 -
This is useful if you want to change the calling convention of the copy.
o call insert_funcret_para() after creating a bare copy
* don't copy aliasnames of copied procdefs either (can at best result
in duplicate symbol errors)
git-svn-id: trunk@28227 -
* Parameter offsets are now calculated similar to other targets, target_info,first_parm_offset is applied only to callee side, while at caller side offsets start from 0.
* For cdecl procedures, parameters are removed by caller, for the rest it's still done by callee (resembles i386 target, except there is no 'register' calling convention).
git-svn-id: trunk@28185 -
* longjmp: restored loading of function result (d0) which got removed in r28177.
* While at the point, added test for zero, because longjmp must never return zero values.
* Assembler reader: 'fp' refers to frame pointer, not the stack pointer.
git-svn-id: trunk@28183 -
Please note that Delphi has the exact same bug as we have and thus code working in FPC will not work in Delphi.
Additionally taking the method address of a local variable or a local/global constant for a method pointer is dangerous as the variable (in case of constants is a temporary local variable) will go out of scope once the containing procedure/function/method exits!
ncgld.pas, tcgloadnode.pass_generate_code:
* only use the value of Self if it is an implicit pointer object (class instance) or a class reference, but not for everything else (objects, records, primitive types)
+added test
git-svn-id: trunk@28160 -
cs_hugeptr_arithmetic_normalization local setting
+ added the cs_hugeptr_comparison_normalization local setting and corresponding
directive {$HUGEPOINTERCOMPARISONNORMALIZATION} to set it
* the {HUGEPOINTERNORMALIZATION} changed to set both of the huge pointer
normalization settings, according to the specified compiler type ('BORLANDC',
'MICROSOFTC' or 'WATCOMC')
git-svn-id: trunk@28151 -
taddnode.first_addpointer. This will be overridden in the i8086 code generator
in order to implement huge pointer arithmetic.
git-svn-id: trunk@28138 -
* scandir.pas, dir_warn: also adjust the message state for type_w_instance_abstract_class if the identifier is CONSTRUCTING_ABSTRACT
* msg/errore.msg: enable type_w_instance_abstract_class by default
* msgidx.inc, msgtxt.inc: updated
git-svn-id: trunk@28137 -
Please note that this warning won't be triggered if an instance of that class is created using a class variable of that class type as the compiler can not know the type contained in the variable at compile time (see also the added test).
+ msg/errore.msg: added disabled message which informs about the instantiation of an abstract class
* pexpr.pas, do_member_read: generate the message if we have a constructor call for an abstract class using a loadvmtaddrnode (thus the type name is used and not a class variable)
* msg{idx,txt}.inc: updated
+ added test
git-svn-id: trunk@28127 -
- removed code for everything but booleans (it is handled perfectly well by generic code)
+ operate directly on references when possible
+ added handling for 64-bit data.
git-svn-id: trunk@28096 -
* records are passed by value
* records with size of 1,2 or 4 are returned in registers
* parameters with size<4 are justified on the stack according to big-endian target
Now everything except floating-point parameters is compatible with C code compiled with "-malign-int -mrtd".
Compatibility with "-mno-align-int" is achievable by changing target_info.maxCrecordalign to 2, but doings so causes a lot more troubles because RTL (incorrectly) assumes that records declared with {$PACKRECORDS C} are aligned to pointer size.
+ Reuse parameter locations. Since everything is passed on stack, it reduces code size quite a bit.
- tm68kparamanager.getintparaloc removed, generic implementation has been tested and works as expected.
git-svn-id: trunk@28083 -
or delphi mode is selected. This fixes the error "Selected assembler reader
not supported" in programs that specify $mode tp/delphi, but do not explicitly
set $asmmode intel.
git-svn-id: trunk@28068 -
* Change register type of second operand in CTC1 and CFC1 instructions to R_SPECIALREGISTER, so it is not output using a symbolic name. Mantis #26380.
git-svn-id: trunk@28034 -
constant values (i.e., anything non-value/const/constref) (mantis #263363)
o fixed default parameter value for var-parameter in chmreader
git-svn-id: trunk@28016 -