shutting down, that can fail
o the test will still fail because the tthread shutdown code itself in
the classes unit cannot handle running while a program is quitting,
and that should be fixed (exposed by r34456)
git-svn-id: trunk@34554 -
Reset tstoredsymtable.init_final_check_done when a symbol is added or removed as otherwise property getters in a record *before* any managed field would trigger it, thus leading to the record being considered as "non-managed".
git-svn-id: trunk@34088 -
generator to the typecheck pass, so that it also works for platforms
that use the parentfpstruct way to handle accesses to nested frames
in case the array has been migrated to such a parentfpstruct
o additionally, the number of comparisons for such range checks
has been reduced from 3 (for signed indices) or 2 (for unsigned
indices) to 1 in all cases
o the range checking code is disabled for the JVM target, as the
JVM automatically range checks all array accesses itself anyway
git-svn-id: trunk@34034 -
ninl.pas, tinlinenode:
* pass_typecheck: let code pass on to simplify() for undefineddefs in Low() and High()
* simplify: create a constant 0 as fallback
+ added test
git-svn-id: trunk@33884 -
pexpr.pas:
* handle_factor_typenode: rework code for records and objects so that Delphi style specializations are handled as well
* sub_expr.generate_inline_specialization: also do a typecheck pass on pload to be sure that we have a resultdef
+ added tests
git-svn-id: trunk@33876 -
pexpr.pas, sub_expr.generate_inline_specialization:
* do_member_read() needs to happen independently of whether we're calling a method of the same object (was incorrectly copypasted code... :/ )
+ added test
git-svn-id: trunk@33875 -
rawbytestring, ensure the resulting constant string does not get CP_NONE
as codepage, but the default system code page (mantis #30082)
git-svn-id: trunk@33597 -
the funcretnode field keeps a reference to this temp even after we
assign it to the call-by-reference return parameter if it is deleted
by changing it into a normal temp (after which it will be freed when
the result of the call node is used), because in that case getcopy
for the callnode must copy this reference after copying the
tempdeletenode in order to reset tempinfo^.hookoncopy (mantis #29891)
git-svn-id: trunk@33569 -
pgenutil.pas:
* parse_generic_specialization_types_internal: ignore the parasymtable of procvars (as before the addition of generic routines) and instead use the type's hierarchy name
* generate_specialization_phase2: specialize types of procvars into the parameter symtable as they don't have a local one
+ added test
git-svn-id: trunk@33544 -
whether a multiplication needs to be signed or unsigned (can be different
in case of a 32x32->64 multiplication) (mantis #30035)
git-svn-id: trunk@33539 -
In comparison with the original patch, support for a i386 has been added as well as a test program.
Further, a small issue with xbegin has been fixed
git-svn-id: trunk@33375 -
psub.pas, tcgprocinfo.parse_body:
* ensure that parse_generic and current_genericdef are set correctly when parsing a generic routine
pgenutil.pas, generate_specialization_phase2:
* when we're specializing inside a generic we don't want to have the routine definitions, so let the compiler assume that the routine is no longer a forward definition
+ added test
git-svn-id: trunk@33275 -
htypechk.pas, tcallcandidates:
* create_candidate_list: check the correct tableoptions for sto_has_overload flag
+ added test
git-svn-id: trunk@33211 -
o removed utf8string overload
o always ignore any code page information from the input, and interpret the
contents of the input directly as utf8-encoded bytes
* made utf8tostring() compatible with the JVM backend (mantis #29497)
git-svn-id: trunk@33159 -
htypechk.pas, tcallcandidates:
* create_candidate_list: don't check whether the pd is a specialization if the owner is valid; happens if a generic method is used more than once (which should happen here and then :P )
+ added test
git-svn-id: trunk@33037 -
tabstractrecordsymtable.has_single_field(), due to always looking in the
symlist of the original record rather than properly recursing into those
of nested ones (mantis #28641)
git-svn-id: trunk@32618 -
a pointer to a vmt, but a pointer to a pointer to vmt (mantis #29086)
o also adjusted the llvm type for interfaces accordingly
git-svn-id: trunk@32530 -
support for nested types when generating an access to a static fied;
we also always do that when generating the mangled name of a static
field declaration in symcreat.make_field_static() (mantis #29030)
git-svn-id: trunk@32517 -
ptype.pas, resolve_forward_types:
* in case of the def of the forward being the same as the genericdef of the def the forwarddef belongs to the typesym needs to be changed to the one of the specialization
tests/webtbs/tw28674.pp:
* adjusted text
git-svn-id: trunk@31987 -
ptype.pas, resolve_forward_types:
* fix an access violation in case of inline pointer declarations
* fix the check whether it's a valid use of a generic (parse_generic is useless here...)
+ added test
git-svn-id: trunk@31910 -
when {$modeswitch systemcodepage} gets disabled without having been
enabled first (such as when initially setting the syntax mode)
(mantis #28718)
git-svn-id: trunk@31831 -
that don't use a fixed stack (mantis #28454)
o moved the code to finalise managed out parameters from ncgcal to ncal,
and add it to the init code of the call node (so it's evaluated before
any parameters are processed, ensuring that mantis #28390 stays fixed)
git-svn-id: trunk@31328 -
parameters:
1) since they are finalised on the caller side, if that same value
is passed as a value parameter as well and its reference count
was 1, then the value parameter will contain an invalid pointer
2) since finalisation involves a call, for optimal code generation
purposes they should also be evaluated first
(mantis #28279, #28390)
git-svn-id: trunk@31201 -
rtl/objpas/classes/classes.inc:
+ new variable ExternalThreadsCleanup to keep track whether ExternalThreads list is currently cleared
* TExternalThread.Create: add the thread instance to the external thread list
* TExetrnalThread.Destroy: remove the thread instance from the external thread list (if not in system cleanup anyway)
* CommonCleanup: set ExternalThreadsCleanup to true so that the threads don't remove themselves from the list anymore
+ added test
git-svn-id: trunk@31028 -
tcallnode constructor, so that when it's needed later during pass 1,
its value doesn't depend on the context in which pass 1 is executed
(e.g. when inlining) (mantis #18121)
git-svn-id: trunk@30908 -
whether there isn't already a file and of so whether we can open it using
this exclusive sharing mode (since the locking is advisory, simply
overwriting any existing file and then locking it exclusively will
always work) (mantis #27998)
git-svn-id: trunk@30861 -
pgenutil.pas:
* parse_generic_parameters: create explicit undefineddefs for type parameters that don't have a constraint
* insert_generic_parameter_types: move the created undefineddefs from the parent symtable to the generic's symtable
defcmp.pas, compare_defs_ext:
* in case the flag for strict undefineddef checks is set don't consider two different undefineddefs as compatible
+ added tests
git-svn-id: trunk@30705 -
case a record contains an internal typed constant of its own type
(which happened becuase such a typed constant is also fieldvarsym, solved
by checking for sp_static) (mantis #27880)
* fixed several other similar cases in the compiler where we are only
interested in instance fields, but processed all fieldvarsyms
git-svn-id: trunk@30614 -
something without a location at all; it's a hint/optional operation,
so if there's nothing to prefetch just don't do anything
(mantis #27811)
git-svn-id: trunk@30502 -
the stack pointer during the prolog. This was done previously in
tcg.g_proc_entry(), but that routine is called after register allocation
and hence has no influence. Also cleaned up the deallocation of that
register by moving the previously ifdef'd code to thlcgppcgen
(mantis #27634)
git-svn-id: trunk@30164 -
type
TTestLongInt = specialize SomeOtherUnit.TTest<LongInt>;
will now have to read as
type
TTestLongInt = SomeOtherUnit.specialize TTest<LongInt>;
While this is not backwards compatible this situation should arise seldomly enough and the benefits especially in context with generic functions/procedures/methods outway the drawbacks.
pbase.pas:
* try_consume_unitsym: add a allow_specialize parameter that allows to parse "specialize" in front of a non-unit symbol; whether it was a specialization or not is reported using a new is_specialize parameter
+ add a new overload try_consume_unitsym_no_specialize that calls try_consume_unit sym with allow_specialize=false and a dummy is_specialize parameter
* switch calls to try_consume_unitsym to try_consume_unitsym_no_specialize
pstatmnt.pas, try_statement:
* switch call to try_consume_unitsym to try_consume_unitsym_no_specialize
* adjust call to parse_nested_types
ptype.pas:
+ extend id_type with the possibility to disallow unit symbols (needed if a specialize was already parsed) and to report whether a specialize was parsed
+ extend parse_nested_types with the possibility to tell it whether specializations are allowed
* have parse_nested_types specialize generic defs if one is encountered and local type defs are allowed
* id_type: only allow "unitsym.specialize sym" or "specialize sym", but not "specialize unitsym.sym"
* single_type: correctly handle specializations with "specialize" keyword
* read_named_type.expr_type: there is no longer a need to check for "specialize" keyword
pexpr.pas:
+ new function handle_specialize_inline_specialization which tries to specialize a type symbol
* handle_factor_typenode: handle specializations after a point that follows a record or object (why isn't this part of postfixoperators anyway? O.o)
* postfixoperators: handle "specialize" after records and objectdefs
* factor_read_id: handle "specialize" in front of an identifier (and after unit symbols)
+ added tests
* adjusted test webtbs/tw16090.pp
git-svn-id: trunk@29768 -
pgenutil.pas:
* parse_generic_parameters: a ';' terminates a parameter group, so correctly adjust firstidx in that case
+ added test
git-svn-id: trunk@29685 -
* when getting rid of temps. of inline parameters, take care if somewhere an alias of the variable might exist, resolves#24796 and #26534
git-svn-id: trunk@29616 -
symdef.pas:
* tprocdef.defaultmangledname: add some kind of differentiator to the result def, so that x(integer;integer) and x(integer):integer generate different mangled names
* make_mangledname: also use the returndef instead of a potentially uninitialized variable like was done for tprocdef.defaultmangledname and also add a prefix (so that the two are compatible)
+ added test
git-svn-id: trunk@29579 -
symdef.pas, tprocdef:
* defaultmangledname: don't use the potentially unassigned hp, but use - as intended - returndef if it is set (analog to the non-CRC part)
+ added test
git-svn-id: trunk@29537 -
pgenutil.pas:
* parse_generic_parameters & insert_generic_parameter_types: create the type parameter symbols as strict private instead of public (which is the default visiblity)
* adjusted two tests which relied on this behavior (that's why I fixed the type aliases previously)
+ added test
git-svn-id: trunk@29486 -
nutils.pas, handle_staticfield_access:
* generics don't have staticvarsyms for their static fieldvarsyms so we need to simulate a non-static access to avoid 1) an exception and 2) incorrect errors that instance methods can't be accessed
+ added tests
git-svn-id: trunk@29484 -
symtable.pas, is_visible_for_object:
* if the symtable belongs to a specialization we need to ignore any owning local- or parasymtable as well to determine which unit it belongs to
+ added test
git-svn-id: trunk@29482 -
psub.pas, tcgprocinfo.parse_body:
* also check record symtables besides object symtables to determine whether the staticsymtable is accessed from a globally declared generic
* use a translateable message if the static symtable is accessed if it should not
msg/errore.msg:
+ add new error message for when the static symtable is accessed from a global generic
msgidx.inc & msgtixt.inc:
* regenerated
+ added test
git-svn-id: trunk@29427 -
dynamic arrays and fixed-length static arrays when looking for
overloads of array constructors, while these are not valid in
such cases (and it also gave an error afterwards when trying to
actually use them). This caused a lot of spurious "can't select
which overloaded routine to call" errors when using many JVM
routines
git-svn-id: trunk@29393 -
resulttype of the div node set by the type checking pass, this is
also how the generic code generator handles it, resolves#27173
git-svn-id: trunk@29382 -
pgenutil.pas, specialization_init:
* don't push the localsymtable if the unit does not have one available
+ added test (needs manual execution though... :/ )
git-svn-id: trunk@29172 -
(because @gotpcrel shouldn't be used for non-global/exported symbols on
some platforms, such as OS X)
o fixes the test on OS X
git-svn-id: trunk@28986 -
becoming X86_64_SSE_CLASS/X86_64_INTEGER_CLASS/... This is not defined in
the ABI because there sizeof(extended)=16 and hence the class of the upper
eightbyte of the extended value can never be merged with the class of
another field (except in a union, but then the class of the lower
eightbyte will also be overwritten).
Handle it the same as when the lower eightbyte class of an extended in an
aggregate gets changed into something else: pass everything in memory
(part of mantis #26993)
git-svn-id: trunk@28984 -
inline function is getting assigned to one of its parameters, so that
typecasts etc. are dealt with correctly (mantis #26536)
git-svn-id: trunk@28834 -
pgenutil.pas, generate_specialization:
* first check whether we can reuse the current specialization or another specialization and only /then/ retrieve the symtable to specialize to
+ added test
git-svn-id: trunk@28705 -
pgenutils.pas, check_generic_constraints:
* correctly handle forward defs if the constraint is either a single IInterface/IUnknown or a TObject/class
+ added tests
git-svn-id: trunk@28601 -
htypechk.pas, tcallcandidates:
* collect_overloads_in_struct: we need to check the deftyp of the extended def for record- or objectdef, not the deftyp of the helper which will always be objectdef anyway.
+ added test
git-svn-id: trunk@28572 -
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 -