Add a new target flag which determines whether the target supports dynamic packages or not.
systems.pas:
+ new flag tf_supports_packages
pmodules.pas, proc_package:
* error out when flag tf_supports_packages is not set for the current target
msg/errore.msg:
+ error message for when tf_supports_packages is missing and a package file is compiled
........
git-svn-id: trunk@32978 -
the i8086 internal object writer. This allows weeding out spurious 386
instructions, as is similarly done by NASM when using it as an external
assembler.
git-svn-id: trunk@32871 -
* fixed for MorphOS, added for Amiga/m68k
* enabled as default when running natively on these systems (cross still defaults to GNU LD)
* added -XV command line switch to enable/disable it
* dropped the 'fpc' prefix from vlink binary name on MorphOS
git-svn-id: trunk@32324 -
o 'DB SEG symbol' produces an error
o 'DD SEG symbol' (and anything larger than DW, like DQ) adds extra high zeros
to the segment constant (this is Turbo Pascal 7 compatible)
git-svn-id: trunk@32283 -
+ add error message if a generic method is declared inside an interface
+ add error message if a generic method is declared as virtual
git-svn-id: trunk@31764 -
how the fpc sections have to be linked *on Linux*. This prevents the
"did you forget -T" warnings from ld, and in general is more correct than
our previous approach of specifying a complete linker script without -T
and hoping that there won't be any unexpected interactions with ld's
built-in linker script (fixed version of r31664, thanks to Alan Modra)
o use the new -X9 command line option to generate linker scripts that
are compatible with binutils older than 2.19 (reverts to the old
behaviour)
git-svn-id: trunk@31675 -
how the fpc sections have to be linked *on Linux*. This prevents the
"did you forget -T" warnings from ld, and in general is more correct than
our previous approach of specifying a complete linker script without -T
and hoping that there won't be any unexpected interactions with ld's
built-in linker script
o use the new -X9 command line option to generate linker scripts that
are compatible with binutils older than 2.19 (reverts to the old
behaviour)
git-svn-id: trunk@31664 -
an Objective-C method masks an identifier from a category, because due
to the fact that all standard categories are imported at the same time via
the CocoaAll unit, this can often happen with categories you don't know/
care about. These errors also didn't happen in 2.6.x
git-svn-id: trunk@29497 -
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 -
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
uses for anonymous function references. The "cdecl;" indicates that this
is for the C-variant of such references, which is what blocks are
git-svn-id: branches/blocks@28233 -
* 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 -
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 -
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
double operations, it makes no sense in my opinion to do so.
git-svn-id: trunk@27564 -
* don't allow to apply the same hint directive twice
* change parser_e_proc_dir_not_allowed to more generic variant parser_e_dir_not_allowed - they are similar and 'procedure' prefix does not give more information about the error.
* maybe_parse_hint_directives() uses procdef settings for initial values
+ add tests
git-svn-id: trunk@25720 -
that may trigger JVM bytecode verification errors if they are used
before they are initialised (this includes passing them as a "var"
parameter) + test
* sorted -CT parameters alphabetically and alligned them
git-svn-id: trunk@25387 -
so that code written according to Delphi coding standards can be compiled
into JVM bytecode with routine names conforming to JVM coding standards
git-svn-id: trunk@25385 -
1. At least on x86 the assembler reader initializes the parameter location informations which results in InternalError 200301231
2. Assembler tokens are not stored in the token stream and thus won't be reproduced during specialization
x86/rax86int.pas, tx86intreader.Assemble:
* check for "parse_generic" before calling generate_parameter_info
pstatmnt.pas, assembler_block & statement:
* generate an error message if an asm statement should be parsed inside a generic
+ added test
git-svn-id: trunk@24892 -
scandir.pas:
+ add function "get_peflag_const" to retrieve the value of a constant
* dir_setpeflags & dir_setpeoptflags: first check for an identifier (value is retrieved through "get_peflag_const") and then read a value
+ added messages for illegal parameters for SetPEFlags and SetPEOptFlags respectively
+ added tests
git-svn-id: trunk@24887 -
pdecsub.pas, pd_static:
* check whether the given pd is an operator or a class method not inside an Object and generate an error if either of these is true
msg/errore.msg, msgidx.inc, msgtxt.inc:
* add a message to inform that a certain procedure directive is not allowed
+ added tests
git-svn-id: trunk@23944 -
ptype.pas, parse_record_members:
* write an error message if "protected" or "strict protected" is encountered
msg/errore.msg:
+ add an error message for disallowed "things" in records
+ added test
* adjusted test (note: according to the bug report this test did not originally have the "protected" section, but it was added by Paul before commiting)
git-svn-id: trunk@23596 -
symconst.pas:
+ extend "thelpertype" by "ht_type" which tells the code in "pdecobj.parse_extended_type" that a type helper declaration has been parsed
node.pas:
+ add a constant which identifies all constant node types
ptype.pas:
+ read_named_type: add a parameter "hadtypetoken" to tell the code whether a "type" token had been parsed before
+ read_named_type: if an identifier "helper" is parsed we need to check whether "hadtypetoken" is true and the modeswitch "m_class" is set, but the "m_delphi" one is not; in that case we have a "type helper" declaration
pgenutil.pas, generate_specialization:
* adjust call to read_named_type
pdecl.pas, types_dec:
* adjust call to read_named_type
pdecobj.pas:
* parse_extended_type: extend for correct handling of primitive types (includes Delphi compatible handling as well) and reject types that are explicitly not allowed
* method_dec: require "static" for class methods in type helpers
* method_doc: allow constructors for type helpers as well
paramgr.pas, tparamanager:
* set_common_funcretloc_info: handle type helper constructors like record constructors
* handle_common_ret_in_param: the "self" value of a type helper constructor is also returned in a parameter
pexpr.pas:
+ add a function to postfixoperators which tries to find and apply a type helper for a given type
* postfixoperators: try to apply type helpers for ordinal constants
* postfixoperators: use the correct string type for string constants
* postfixoperators: try to apply type helpers for enum constants
* postfixoperators: try to apply type helpers for arrays
* postfixoperators: try to apply type helpers for Variant
* postfixoperators: try to apply type helpers for pointer types
* postfixoperators: try to apply type helpers for other types
* factor: check postfixoperators after _REALNUMBER, _CCHAR, _CWCHAR, _TRUE and _FALSE
* factor: also check postfixoperators if a _POINT follows a _NIL
symdef.pas, tdefawaresymtablestack.addhelpers:
* use "generate_objectpascal_helper_key" to generate the key
symtable.pas:
+ add function to generate the key value for the map of extended types using the extended def
* adjust "search_last_objectpascal_helper" and "search_objectpascal_helper" to handle primitive types as well
* use the new "generate_objectpascal_helper_key" function to generate the key
pparautl.pas:
* insert_self_and_vmt_para: don't insert the $vmt symbol for record or type helpers (ToDo: check whether class helpers really need the symbol as well)
* insert_self_and_vmt_para: pass "self" as var parameter for type helpers as well
psub.pas, generate_bodyentry_block:
* also allow type helpers for constructor methods
ncal.pas, tcallnode.gen_self_tree:
* also use a temp variable for type helper constructors
ncgcal.pas, tcgcallnode.secondcallparan:
* allow Pointers to be passed as address param if it is the Self value of a type helper extending a pointer type
* correctly handle the location in case of type helper constructors
+ add tests
git-svn-id: trunk@23580 -
JVM target, since Java bytecode itself has no support for properties and
hence exposing properties to external Java code can only be done through
getters/setters. Use the new parameters to do so:
-CTautogetterprefix=XXX
-CTautosetterprefix=YYY
The getter/setter will get the same visibility as the property. If a
getter/setter with the same naming convention was already specified for a
property and this getter/setter is declared in the same class as the
property, then the visibility of this existing getter/setter is
modified and no new routine is generated.
Newly generated getters/setters are virtual methods, because that is
the only way in Java bytecode to allow redefining these getters/setters
in child classes. However, that also means that using these switches can
change the behvaviour of code, since normally the used property definition
is only determined by the declared type of its associated class instance,
and not by the actual instance type. The compiler will therefore warn when
such an automatically generated getter/setter is overridden by another
automatically generated getter/setter in a child class.
git-svn-id: trunk@22959 -
(mantis #22665)
+ support "[var wrt ..gotpcrel]" nasm/yasm syntax in intel assembler mode
for GOT-relative accesses on x86-64, + give an error when trying to do
this on win64 (it doesn't have a GOT)
* moved code that give a warning when using GOT-relative accesses to
static data on x86-64 from the AT&T reader to rax86 so it's also
active for the Intel assembler reader
+ added warning when not using GOT-relative accesses (but plain
RIP-relative instead) to global data on non-Win64 x86-64
git-svn-id: trunk@22243 -
the result location is a simple location (a single register/reference)
(mantis #22490)
* print an error when accessing "result" in a nostack pure assembler routine
if the result location is not simple
git-svn-id: trunk@22166 -
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
stack traces from dump_stack)
+ niln is also valid in a cse domain
* parameters passed by reference shall have a complexity >1
* load nodes from outer scopes shall have a complexity >1
* better cse debugging
+ more node types added to cse
* consider parameters passed by reference in cse
* take care of cse in parameters in simple cases
git-svn-id: trunk@22050 -
default value (mantis #22343)
* give an error when specifying an invalid default value (e.g. a
floating point number for a longint parameter)
git-svn-id: trunk@22021 -
method by one with a lower visibility, because calling the overriding
method results in a java.lang.AbstractMethodError in that case
git-svn-id: trunk@21839 -
with the enum instance corresponding to ordinal 0 in JVM constructors,
because a virtual method called by a parent constructor may already
have assigned a different value (see tests/test/jvm/tenum2.pp). This
will result in null pointer exceptions when using such fields without
first explicitly assigning a value to them though.
The old behaviour can be restored with the new -CTenumfieldinit command
line parameter
git-svn-id: trunk@21736 -
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used
git-svn-id: trunk@21335 -
method's visibility, because this is common practice in Object-Pascal.
It can be re-enabled with {$warn INTF_RAISE_VISIBILITY on} (mainly
useful when trying to keep code compatible with the JVM target)
git-svn-id: trunk@21329 -
be generated for a single object file on AIX, automatically switch to
an indirection scheme that uses much less TOC entries, but is slower to
access global variables
* manually merged infrastructure for target-specific code generation
switches from JVM branch (-CTxxx switches)
* -CTsmalltoc switch for AIX that forces the indirection scheme for TOC
entries from the start in case the automatic one does not conserve
a sufficient amount (or in case you bump up against the global TOC
entries limit during linking)
git-svn-id: trunk@20963 -
o support for the new codepage-aware ansistrings in the jvm branch
o empty ansistrings are now always represented by a nil pointer rather than
by an empty string, because an empty string also has a code page which
can confuse code (although this will make ansistrings harder to use
in Java code)
o more string helpers code shared between the general and jvm rtl
o support for indexbyte/word in the jvm rtl (warning: first parameter
is an open array rather than an untyped parameter there, so
indexchar(pcharvar^,10,0) will be equivalent to
indexchar[pcharvar^],10,0) there, which is different from what is
intended; changing it to an untyped parameter wouldn't help though)
o default() support is not yet complete
o calling fpcres is currently broken due to limitations in
sysutils.executeprocess() regarding handling unix quoting and
the compiler using the same command lines for scripts and directly
calling external programs
o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
to the make command line
git-svn-id: branches/jvmbackend@20887 -
to low addresses in case the target cpu/OS does not support this (enabled
for reads on AIX/PPC because on AIX the first 16KB are readable)
git-svn-id: trunk@20832 -
o new eabihf (hard float) abi
o vfpv3_d16 variant of VFP (default variant used by EABI assemblers: VFPv3
with only 16 double registers instead of 32) and pass it to GNU as
o make the odd numbered single precision floating point VFP registers
available for explicit allocation for use by the calling convention
* fixed copy/paste error in stdname of S30 register
-> use -dFPC_ARMHF to create an ARM eabi hard float compiler
(mantis #21554)
git-svn-id: trunk@20660 -
in code and not in constants. In the case of primitive types constant nodes
are used while complex types like arrays, records and objects use a local
variable which is initialized to zero once at the entry of the method (the
variable is reused if Default() is used for the same type multiple times in
the same method). For this a new compilerproc was added which uses FillChar
to initialize the given memory area to zero.
This fixes Mantis #9420.
+ psystem.pas: Added Default symbol to system unit
+ htypechk.pas: Added function "is_valid_for_default" which checks recursively
whether the given type can be used with Default at all.
Forbidden types are files, helpers, ObjC and C++ types. This
check is used for records, arrays and objects only if the mode
is a non-Delphi one, as Delphi ignores these types on lower
levels.
+ msg/errore.msg: Added error message for unsupported types for Default()
+ symconst.pas: Added a new enum value vo_is_default_var which is used for the
local variables utilized by Default() so their initalization
and finalization can be avoided.
+ pexpr.pas: Add handling of Default() intrinsic to "statement_syssym"
+ ninl.pas: Extended tinlinenode by a method which returns the correct node for
a Default() and used that method in handle_typecheck.
* ncgutil.pas: Check for new flag "vo_is_default_var" when initializing and
finalizing local variables.
* ppu.pas: increase PPU version
+ psub.pas:
* Added a new routine which zeros defaultvars of a symtable.
* Use this routine inside "initializevars".
* Also use this routine to initialize the staticsymtable of the unit/program.
* Adjusted ppudump, because of the new enum value.
+ Added implementation of fpc_zeromem to system unit.
+ Added tests for Default()
git-svn-id: trunk@20629 -
Mac OS X/iOS version for the compiler code
o such a parameter is not passed, extract the information from the
environment variables MACOSX_DEPLOYMENT_TARGET/IPHONEOS_DEPLOYMENT_TARGET,
like gcc
o if neither the parameter nor the environment variable is used, use preset
default values
o pass on this version setting on to the Darwin linker
o use this setting to determine which version of the startup code (crt1.o
etc) to use, if any (based on information gathered from the GCC sources)
o define a symbol called MAC_OS_X_VERSION_MIN_REQUIRED/
IPHONE_OS_VERSION_MIN_REQUIRED based on this parameter
o for usage information, see
http://wiki.freepascal.org/FPC_New_Features_Trunk#Support_for_specifying_and_querying_the_deployment_version
git-svn-id: trunk@20503 -
in a compilation module parsed using a different code page, because this
changes the default ansistring type and {$codepage xxx} is also not
allowed in the middle of a unit (mantis #21445)
git-svn-id: trunk@20488 -
+ -CTcompactintarrayinit command line option to change the code generation
for typed array of some kind of integer-type initialization so that it
takes up less space in the bytecode (because the bytecode for all
routines, including the class initialization code that contains the
typed constant init code, is limited 64kb, large array or multiple
array constants could fairly easily bump into that limit)
git-svn-id: branches/jvmbackend@19638 -
- warn if compiler finds implicit or explicit string type conversion from a form of ansi string to a form of unicode string and vice versa
- mark explicit warnings as OFF by default
- warn if compiler finds an assignment of an unicode char const to ansi string or char type (warn for assignment of unicode string const to be implemented)
- revert a piece of code from r19457 regards shortstring handling because shortstring handling should not differ from ansistring in this paticular case
git-svn-id: trunk@19574 -
or published, because interface methods are always public and
hence mapping them to a private/protected method increases the
visibility of the underlying method (error on JVM target because
the JVM doesn't like that, warning on other platforms)
git-svn-id: branches/jvmbackend@19156 -
var-parameters on the JVM target for changes to the value passed
as var-parameter during the function call (because they are handled
via copy-in/copy-out, this may indicate unexpected bahviour later on).
out-parameters are checked in the same way, except if the out-parameter
is a local variable because then reading it before the call may result
in a bytecode verification error (since the variable may not yet be
initialized)
git-svn-id: branches/jvmbackend@19153 -
+ support parsing of strings with code page specification
+ added encoding and elementsize field to ansi- and unicodestring records
+ some basic rtl support routines for encoding aware strings
+ DefaultSystemCodePage
+ DefaultUnicodeCodePage
+ ppu writing/loading of code page aware strings
git-svn-id: trunk@19080 -
cs_create_smart if using dwarf information and external assembler
debug information as this is not compatible.
* Added a different message for cs_create_smart.
git-svn-id: trunk@19065 -
on the JVM target, because the generated code was invalid and I can't think
of a generic way to solve it (see added comments in njvmcal.pas)
git-svn-id: branches/jvmbackend@19055 -
unicodestring = java.lang.String. The reason this was the default in
the past is that this was the first string type that was implemented,
and without it being the default most code involving string operations
would fail. Now the default strings types are the same as for other
targets
+ new {$modeswitch unicodestrings} directive, that when activated
*together* with {$h+},
1) changes char into an alias for widechar
2) changes string into an alias for unicodestring
3) changes the preferred string evaluation type (in case of uncertainty)
to unicodestring
{$modeswitch unicodestrings} with {$h-} does not change anything at all
regarding the string type (it still changes the char type)
+ new uuchar unit that redefines char as widechar, and which is automatically
included by the compiler if {$modeswitch unicodestrings} is enabled
git-svn-id: branches/jvmbackend@18781 -
support those natively, so they are emulated via the procvar infrastructure
(and hence not very fast). Could probably be optimized somewhat by adding
a cache (hashmap of procvars) to the class hierarchies, maybe in the
future.
git-svn-id: branches/jvmbackend@18704 -
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 -
with temporary one when saving, since it's also freed when restoring ->
called replace_scanner() instead of save_scanner() now)
* when using -vd, print out the text that is internally generated for
injecting into the scanner
git-svn-id: branches/jvmbackend@18442 -
constructor is declared, rather than all constructors from the parent
class (because it cannot be done via scanner-injection, since some
parameter types of the parent constructors may not be visible in the
current unit, and there is no full-blown tprocdef.getcopy yet nor
a way to replace the type of the self-parameter afterwards)
* added sanity checks when inserting the parameterless constructor
(check for other identifiers called "create", and other parameterless
methods)
git-svn-id: branches/jvmbackend@18432 -
Java classes in case it is not declared in the specified Java class,
because that will create an instance of such a parent class (in the
future, we can may automatically clone inherited constructors)
git-svn-id: branches/jvmbackend@18425 -
via {$modeswitch finalfields} (on by default on the JVM target). The
meaning is the same as in Java: a final (class) field can only be set
in a (class) constructor of the class it's defined in, and can only be
written once there (and *must* be set there). They are currently only
supported for external classes since that basically turns them into
constants, since for non-external classes we need full dataflow analysis
o refactored pdecobj.parse_object_members() a bit in the process to reduce
the amount of repetition (which would have been further increased for
the support for final fields)
o made error message about "wrong use of absolute" for fields etc generic,
so it gives a proper error depending on which token was used (it had
to be made generic for "final" support, but already was used for other
things that were wrongly reported as "absolute" misusages)
git-svn-id: branches/jvmbackend@18398 -
o support formal external definitions (like for objcclass)
o allow specifying an "import_dll" for external Java classes, which can
be used to specify the Java package name (like the dll for cppclass)
o take the package name into account when mangling the Java class name
o several messages that were specific to Objective-Pascal classes have
been generalised because they also apply to Java classes, same for
several compiler function names
o disabled some proccall directives for Java, but more needs to happen
(Java methods are always either instance-virtual or class-static)
git-svn-id: branches/jvmbackend@18319 -
* Disallow simultaneous use of method resolution and delegation for the same interface. An interface with method resolution must be implemented directly. This is Delphi compatible and resolves#18058.
git-svn-id: trunk@18179 -
so a proper error message is written (resolves#19871),
EOutOfMemory is not handle perfectly because it could be that the exception
handling requires again a memory allocation
git-svn-id: trunk@18132 -
* Factored repeating REX operations into a separate function.
* Fixed instruction matching bug which was preventing compilation of 3-operand SIMD instructions with RIP-relative operand + test.
* Do not adjust offset of RIP-relative reference if it is a literal number, this was causing 0x123(%rip) to assemble as 0x122(%rip) in 3-operand instructions. Now tasm2.pp is the same with and without -Aas. Also fixed the expected result, improved verbosity of diagnostic and removed %norun, so it is actually executed.
+ Disallow high-byte registers in instructions requiring REX + test.
git-svn-id: trunk@17478 -
* pdecobj.pas:
- parse_object_members: in record helpers class methods need to be declared as "static" like in records
- object_dec:
- allow "published" in helpers as well
- disallow inheritance for record helpers in mode Delphi (and remove the forward declaration flag in that case)
* pdecsub.pas:
pd_abstract: "abstract" isn't allowed in either mode
* pexpr.pas: multiple corrections because of "inherited" and records
- allow "inherited" for "record helpers" (except for mode Delphi)
- load the symbol from the correct class (I hope...)
- give a more precise error message if "inherited" is used in records
* ptype.pas: I forgot to adjust the "(bit)packed record" case
* symtable.pas:
- searchsym_in_helper: "result" was not initialized (and identation fix)
- search_last_objectpascal_helper:
- don't search if there are no helpers (useful for projects that does not contain helpers like the compiler itself)
- don't search if the type to search helpers for is defined locally
- don't search if the type is a anonymous record
- search_struct_member: search for symbols in helpers as well
- msg*:
* correct the message for "parser_e_not_allowed_in_helper"
* add message "parser_e_inherited_not_in_record" which is used to tell that the use of "inherited" is not allowed in records and (in mode Delphi) record helpers
git-svn-id: branches/svenbarth/classhelpers@17239 -
+ parsing of section directive for variables
+ section test
+ write section names in the assembler/binary writers correctly
* allow section only after ; and for embedded targets
git-svn-id: branches/usersections@17154 -
- remove thelpersearch again => adjustments to searchsym_in_class and calls to it
- rename sto_has_classhelper to sto_has_helper
* symbase.pas: make push and pop in tsymtablestack virtual
* symdef.pas:
- add a new class tdefawaresymtablestack which overrides push and pop of tsymtablestack and adjusts the new extendeddefs field of the current tmodule
- tobjectdef.create: sto_has_classhelper => sto_has_helper
* fmodule.pas:
- add new hash object list to tmodule (key: mangled type name) which holds object list instances that contain all helpers currently active for a given type (= key of the hash list)
- tmodule.create: the hash list owns the sublists (but those don't own the defs)
- tmodule.destroy: free the hash list
* pdecobjpas:
- rename parse_extended_class to parse_extended_type
- parsing of constructors:
# for all helper types: no class constructors allowed
# for record helpers: as long as constructors for records themselves are disabled they are for record helpers as well
- object_dec: manually add the helper to the extendeddefs if the overall owner of the current def is a static symtable (implementation section or program/library main file), because the symtable won't be popped and pushed then
* parser.pas: instantiate the new stack class
* psub.pas: backup the extendeddefs in specialize_objectdefs as well
* ptype.pas:
- generate_specialization: backup the extendeddefs as well
- record_dec: _RECORD is now consumed in read_named_type itself
- read_named_type: parse "record helper" if advanced record syntax is enabled
* symtable.pas:
- correct searchsym_in_class declaration => adjustments in this unit as well
- add the possibility to pass a context def to search_last_objectpascal_helper
- rename search_objectpascal_class_helper to search_objectpascal_helper
- rename search_class_helper to search_objc_helper
- searchsym_in_class:
# search for helpers in every level of the tree of the class
# the contextclassh can also be a subclass of the extendeddef
- searchsym_in_record: search for helper methods as well
- searchsym_in_helper:
# search for symbols in class and record helpers is the same except for the search in the class' ancestors
# search the extendeddef directly and rely on searchsym_in_class only for the class' ancestors as we need to find the helpers there as well
- search_last_objectpascal_helper: use the extendeddefs list of current_module instead of scanning the symbol stack itself
* pexpr.pas: adjustments because of renaming of sto_has_classhelper
* pinline.pas: adjustment because of removing of thelpersearch
* nflw.pas:
- renamed classhelper to helperdef
- adjusted search_last_objectpascal_helper call
* msg*:
- adjusted error message for constructors in records (this currently applies to record helpers as well)
- renamed parser_e_not_allowed_in_classhelper to parser_e_not_allowed_in_helper => adjustments in code
- added parser_e_no_class_constructors_in_helpers
* pdecsub.pas: adjusted renamed error message
* htypechk.pas: check for helpers in every step of the hierarchy
* nobj.pas: search_class_helper => search_objc_helper
* utils/ppudump.pas: adjust, because of renames
Note: the define "useoldsearch" will be only used for performance comparison on my (faster) Linux machine; that (and its associated code) will be removed afterwards
git-svn-id: branches/svenbarth/classhelpers@17151 -
This change became necessary of the following reasons:
- Records don't support inheritance, thus for "record helpers" some creativity would have been necessary to implement them; with the new implementation this is more easily
- the new approach allows for easy checks regarding virtual methods and their overrides which would have been more complicated in the old variant
- if someone feels the need the types of helpers (object, interface) can be added rather easily
- unnecessary things like VMT generation can be disabled now
details:
- msg*:
* moved some messages from parser to type
* adjusted a message ("class helper" => "helper")
- symdef.pas:
* renamed "helperparent" to "extendeddef" and changed its type from "tobjectdef" to "tabstractrecorddef", so records can be extended as well (somewhen in the near future)
* removed "finish_class_helper" method as it isn't necessary (luckily I haven't yet adjusted the ObjC variant)
* changed name of "is_objectpascal_classhelper" to "is_objectpascal_helper" to reflect that this function applies to all helper types
* tobjectdef.create: ImplementedInterfaces isn't created for odt_helper anymore
* tobjectdef.alignment: for helpers it's the same as for classes although this shouldn't be used anywhere...
* tobjectdef.vmtmethodoffset: set to 0 for helpers to be sure...
* tobjectdef.needs_inittable: not needed for helpers (no fields allowed)
* is_objectpascal_helper: only needs check for "odt_helper" object type
- symconst.pas:
* changed odt_classhelper to more general odt_helper
* added new type "thelpertype" which is used to check that "(record|class) helper" corresponds with the given extended type (as Delphi XE checks this as well this strict solution can be kept for modes Delphi and ObjFPC)
- symtable.pas:
* extended "searchsym_in_class" with the possibility to disable the search for helper methods (needed for inherited) => this implies changing all occurences of "searchsym_in_class" with a "true" except some special locations
* renamed "search_objectpascal_classhelper" to "search_objectpascal_helper"
* searchsym_in_class:
** when an extended method is defined with "overload" it can be that a same named method of the extended class might be called (sadly this means that this search was unnecessary...)
** contextclassh is the def of the helper in the case of an inherited call inside the helper's implementation
** when methods inside a helper are searched, it must be searched in the extended type first
- ptype.pas:
* single_type is used to parse the parent of a helper as well, so allow a helper if the stoParseClassParent is given (needs check in pdecobj.pas/parse_class_parents for normal classes)
* read_named_type: currently the only case when something <> ht_none is passed to the modified parse_objdec (see below) is when the combination "class helper" is encountered ("record helper" will be another one)
- pinline.pas: adjustment for extended "searchsym_in_class"
- pexpr.pas:
* adjustments regarding "searchsym_in_class" and "is_objectpascal_helper"
* factor/factor_read_id: moved the check for "TSomeClassType.SomeMethod" outside of the "is_class" check
* factor:
** in case of an inherited we need to search inside the extended type first (Note: this needs to be extended to find methods in the helper parent if no method is found in the extended type)
** we also need to disable the search for helper methods when searching for an inherited method (Note: it might be better to introduce a enum to decide whether a helper method should search before or after the methods of the extended type or even never)
- pdecsub.pas:
* insert_self_and_vmt_para: in a helper the type of Self is of the extended type
* pd_abstract, pd_final: more nice error message
* pd_override, pd_message, pd_reintroduce: adjusted checks because now "is_class" is no longer true for helpers
* proc_direcdata: allowed "abstract" for helpers (only to produce a more nice error message)
* parse_proc_direc: adjustment because of "is_objectpascal_helper"
- pdecobj.pas:
* adjustments regarding "is_objectpascal_helper"
* adjusted object_dec to take the type of the helper (class, record) as a parameter to be able to check whether the correct extended type was given
* struct_property_dec: properties are allowed in helpers
* parse_object_options: nothing to be parsed for helpers (at least I hope so ^^)
* parse_parent_classes:
** the parent of a helper is now parsed as a normal parent, the extended type is parsed in an extra procedure
** check for "sealed" no longer needed
** added check that the parsed parent of a helper is indeed a helper
** allow to parse the closing ")" of the helper's parent
* parse_extended_class:
** new procedure that parses the type which is extended
** it checks that the extended type is a class for "class helper" and a record for "record helper"
** it checks that a helper extends the same class or a subclass for class helpers
** it checks that a helper extends the same record for record helpers
* parse_object_members:
** "type", "const", "var" is allowed in helpers
** don't exclude flags regarding virtual methods, they are needed for the checks in mode Delphi (this implies that VMT loading must be disabled for helpers)
* object_dec:
** don't change "odt_helper" to "odt_class", but still include the "oo_is_classhelper" flag
** allow the parsing of object options (there are none)
** parse the extended type for helpers
- pdecl.pas
* adjustment because of extension of object_dec
* types_dec: remove the call to finish_classhelper
- objcdef.pas
* objcaddencodedtype, objcdochecktype: add references to helpers as implicit pointers although that should not be used in any way...
- nld.pas
* tloadnode.pass_typecheck: self is a reference to the extended type
- nflw.pas
* create_for_in_loop: adjustment because of changed procedure and inheritance type
- ncgrtti.pas
* TRTTIWriter.write_rtti_data: disable for helpers for now (I need to check what Delphi does here)
- ncgld.pas
* tcgloadnode.pass_generate_code: virtual methods of helpers are treated as normal methods
- ncgcal.pas
* tcgcallnode.pass_generate_code: virtual methods of helpers are treated as normal methods
- ncal.pas
* tcallnode.pass_typecheck: adjust for extension of tcallcandidates constructor
- htypechk.pas
* tcallcandidates declaration: extend some methods to (dis)allow the search for helper methods (needed for inherited)
* tcallcandidates.collect_overloads_in_struct:
** search first in helpers for methods and stop if none carries the "overload" flag
** move the addition of the procsyms to an extra nested procedure because it's used for helper methods and normal struct methods
git-svn-id: branches/svenbarth/classhelpers@16947 -
- pdecobj.pas: removed a check whether a class (helper) tries to inherit from a class helper, because now single_type handles this
- pexpr.pas:
* prohibit type casts to class helpers (note: this might be needed for ObjC categories as well)
* class helper references may only be used when inheriting from them (needs to be checked for ObjC categories as well)
- ptype.pas:
* single_type: extend check against categories for class helpers
* read_named_type: extend check against categories for class helpers
- symbase.pas: add a method that adds symbol table flags recursivly to a stack of symtables (it stops updating the symtables once a symtable already has that flag or it's a global-/staticsymtable)
- symdef.pas: adjusted the constructor of tobjectdef to use the new method for adding flags
git-svn-id: branches/svenbarth/classhelpers@16889 -
- compiler/symdef.pas: add "helperparent" which contains the class helper the current class helper "inherits" from (its real parent is the extended class); it's saved to ppu as well
- compiler/ppu.pas: increase ppu version
- compiler/pdecobj.pas:
* parse the "parent" of a class helper before parsing the extended class (the real parent)
* also disallow to inherit from class helpers for normal class (and to extend class helpers for class helpers)
* disallow the declarations of fields
* disallow the use of destructors
* don't parse abstract/sealed for class helpers
- compiler/ptyp.pas: _FOR is now parsed inside pdecobj.pas
- compiler/msg*:
* extended some messages for class helpers
* added some class helper related messages (perhaps the one or other will vanish again...)
git-svn-id: branches/svenbarth/classhelpers@16792 -
- allow operator also if return type match the structure type (before at least one parameter had to match)
- search both operands symbol tables for a suitable assignment operator
- test
based on patch of Blaise Thorn (issue #0018490)
git-svn-id: trunk@16762 -
change is that it is now also allowed to specify an external name for
formal external class definitions, but if they are later mixed with
regular class definitions the external names have to match.
o because the "external" status of methods is now set while parsing the
class rather than afterwards, some procdir compatibility checks had to
be inlined because they only have to be performed for
* also adapted the syntax for external cppclasses in the same way
* fixed return type of NSObject.retainCount and NSObject.hash
(NSUInteger instead of cint)
* moved "patches" directory from cocoaint/src to cocoaint/utils/cocoa-skel
so they are used by the conversion script when re-parsing the headers
* updated Objective-C header parser script to
o use the new external class syntax
o not write inheritance information for root classes (NSObject, NSProxy)
o use internal translation tables for some conflicting method names that
are named specially in objcbase.pp
and updated parsed headers
* fixed rtl/inc/objcbase.pp and tests to conform to the new external class
syntax
git-svn-id: trunk@16684 -
------------------------------------------------------------------------
r16513 compiler: add support for visibility blocks in records and type, const declarations:
- add parse_record_members function to parse record blocks based on parse_object_members code
- disable published section in records
- rename in_class argument in some functions to in_structure because the same code can work for records now which are not classes
------------------------------------------------------------------------
r16514 compiler: check visibility of record members, allow access to record consts and types:
- add searchsym_in_record function
- change is_visible_for_object to accept tabstractrecorddef instead of tobjectdef arguments because records also have visibility sections now
- change arguments in do_member_read, do_proc_call to tabstractrecorddef from tobjectdef to accept records
- rename classh arguments to structh and change their type to tabstractrecorddef to show that they can accept records now too
- move RttiName from tobjectdef to tabstractrecorddef
------------------------------------------------------------------------
r16515 compiler: add current_structdef: tabstractrecorddef and point current_objectdef to it
------------------------------------------------------------------------
r16516 compiler: allow access other record symbols than fields, first extended records tests
------------------------------------------------------------------------
r16519 compiler:
- move objname, objrealname fields from tobjectdef to tabstractrecorddef,
- load and save them from/to ppu file,
- use tabstarctrecorddef in some more places where previously code worked for tobjectdef
- change push_nested_hierarchy, pop_nested_hierarchy to handle records too
------------------------------------------------------------------------
r16526 compiler: implement record methods and class methods:
- rename tprocdef._class to tprocdef.struct and change the type from tobjectdef to tabstractrecorddef because methods can belong not to classes only now but to records too
- replace in many places use of current_objectdef to current_structdef with typcast where is needed
- add an argument to comp_expr, expr, factor, sub_expr to notify that we are searching type only symbol to solve the problem with records,objects,classes which contains fields with the same name as previosly declared type (like:
HWND = type Handle;
rec = record
hWnd: HWND;
end;)
- disable check in factor_read_id which was made for object that only static fields can be accessed as TObjectType.FieldName outside the object because it makes SizeOf(TObjectType.FieldName) imposible and since the same method was extended to handle records it also breaks a52 package compilation
- rename tcallcandidates.collect_overloads_in_class to tcallcandidates.collect_overloads_in_struct and addapt the code to handle overloads in records too
- fix searchsym_type to search also in object ancestors if we found an object symtable
- add pd_record, pd_notrecord flags to mark procedure modifies which can or can't be used with records. Disallow the next modifiers for records: abstract, dynamic, export, external, far, far16, final, forward, internconst, internproc, interrupt, message, near, override, public, reintroduce, virtual, weakexternal,
Allow the next modifiers for records: static
------------------------------------------------------------------------
r16530 compiler: fix compilation problems caused by tprocdef._class -> tprocdef.struct rename which was found by make fullcycle
------------------------------------------------------------------------
r16531 compiler: redo searchsym_type:
- remove complex condition which was used previosly to decide whether objectsymtable or recordsymtable requires a search for type or not - they require a search because contains types (although not all object types)
- don't search only for typesym but for other symbols too - for example UnitSym.TypeSym or ConstSym..ConstSym are also valid types. Skip the next symtypes during the search because they can't be used in type declaration: fieldvarsym, paravarsym, propertysym, procsym, labelsym
------------------------------------------------------------------------
r16541 compiler: move objectoptions to tabstractrecorddef because it will be needed for records too
------------------------------------------------------------------------
r16542 compiler: remove unneeded checks and typecasting caused by move of objectoptions into tabstractrecorddef
------------------------------------------------------------------------
r16543 compiler: move constructor, destructor parsers to interface section to allow future use by records + change current_objectdef to current_structdef for the same reason, make constructor return type = record for records
r16544 compiler: start parsing of record constructors and destructors:
- disallow record destructor
- raise internal error for constructor because it is not yet implemented
- handle class constructors and destructors for records
- move find_procdef_bytype to tabstractpointerdef
------------------------------------------------------------------------
r16545 compiler: fix static fields creation and access for records
+ extend test to check class constructor/destructor for records and static fields access
------------------------------------------------------------------------
r16546 tests: add a test which checks that records destructors are not allowed
------------------------------------------------------------------------
r16547 compiler: rename aclass->astruct in read_property_dec because records will have properties too
------------------------------------------------------------------------
r16548 compiler: implement properties in records:
- rename property_dec from pdecobj to struct_property_dec because pdecl also has property_dec and move it to interface to use by records + allow properties for records
- use struct_property_dec in record parser
- change structh type from objectdef to abstractrecorddef in read_property_dec to use by records
- disallow stored and default modifiers for records because records are not used for streaming
- fix misuse of search_sym_in_class for records in few places
------------------------------------------------------------------------
r16550 compiler: disallow regular class methods in records and allow only static class methods. delphi do so and it is logical because records have no inheritance. + tests
------------------------------------------------------------------------
r16560 compiler: a trial to implement record constructor
- map self to constructor result
- don't push vmt for records
At the moment generated assembler has errors although node tree is correct
------------------------------------------------------------------------
r16561 compiler:
- add mode switch extendedrecords to allow/disallow extended records syntax, add this mode switch to delphi mode by default
- disable/enable extended records parsing based on extendedreocrds mode switch
------------------------------------------------------------------------
r16562 compiler: fix record constructor return type when parsing procedure declaration
------------------------------------------------------------------------
r16568 compiler: partly revert r16560 and disable (at least temporary) constructors in records
------------------------------------------------------------------------
r16569 test: add records Self test
------------------------------------------------------------------------
r16570 compiler: generate debug info for record methods:
- extended write_symtable_procdefs to handle record definitions
- fix stabs info generator to use prefixed symbol names for record methods, also handle records static symbols the same way as for object types
- fix dwarf info record generation: add visibility info and write methods, also prefix record members the same way as object members
git-svn-id: trunk@16574 -
- disallow record destructor
- raise internal error for constructor because it is not yet implemented
- handle class constructors and destructors for records
- move find_procdef_bytype to tabstractpointerdef
git-svn-id: branches/paul/extended_records@16544 -
- add parse_record_members function to parse record blocks based on parse_object_members code
- disable published section in records
- rename in_class argument in some functions to in_structure because the same code can work for records now which are not classes
git-svn-id: branches/paul/extended_records@16513 -
+ adds the missing DWARF3 values
+ introduces the DWARF4 values
+ basic class and debug info structures for DWARF4 support
+ added DWARF4 compiler parameter (-gw4) support
+ updated parameter description
git-svn-id: trunk@16288 -
* removed "for <achitecture>" from all -T option help messages, because
only targets supported on the current architecture are shown anyway
git-svn-id: trunk@16076 -
same way as regular methods as far as overriding is concerned ("override"
is now allowed, and even required, to override them in a descendent class;
and similarly, "reintroduce" must be used if a category wants to replace
a method in a child class if that method was added by another category in
a parent class)
* print the name of owning objcclass/category of the original method in case
override/reintroduce is missing for objc methods, since this is no longer
always the parent class
git-svn-id: trunk@16035 -
are newer than the ones used to create the ppu file, rather than that
the source file itself is necessarily newer than the ppu file (the
time stamp of the ppu file is used to check whether the main source file
has been changed, but for include files the time stamps are recorded in
the ppu file)
git-svn-id: trunk@15843 -
+ 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 -
* Fixed some typos
* Changed translation of message 5005 (see discussion at http://freepascal.ru/forum/viewtopic.php?t=6021)
* Changed translation of "Target OS" as was suggested by Dmitriy Boyarintsev a long time ago
git-svn-id: trunk@15536 -
+ {$modeswitch objectivec2}, which is required before you can use
Objective-C 2.0 features (such as the above). It automatically
also implies {$modeswitch objectivec1}
+ genloadfield() helper to load a field of a node representing
a record/object/class
git-svn-id: trunk@15460 -
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 -
- complete $WARN switch parsing and add a stab to change message state
- reimplement way of message hiding by -vm switch (by Dmitry Boyarintsev)
(note: $WARN switch does not work at the moment since state handling is not yet implemented)
git-svn-id: trunk@14809 -
- implement class properties: properties which can access only static fields and static class methods
- tests
- fix a possibility to call an instance method from the class method
git-svn-id: trunk@14585 -
units have changed, because these can influence the code of the
current unit in case method signatures changed (mantis #13840)
+ manual test
* fixed some recompilation crashes related to WPO info
* clarified the unit_u_add_depend_to message
git-svn-id: trunk@14503 -
info with the classname, like is done for Stabs. Not done by default
because otherwise once calling methods from the debugger is implemented,
this would require typing classinstance.classname__methodname
git-svn-id: trunk@14337 -
+ 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 -
+ basic support for Objective-Pascal: objcclass, objcprotocol,
objcselector on all Darwin platforms (ppc32/64, i386, x86_64, ARM),
see http://wiki.freepascal.org/FPC_PasCocoa and
http://wiki.freepascal.org/FPC_PasCocoa/Differences for some dialect
details. Use {$modeswitch objectivec1} to activate
+ Cocoa, iPhone/UIKit and WebKit interfaces for use with the new
syntax mode
git-svn-id: trunk@14068 -
rtl: add enumerators to the basic classes
tests: add enumerators test which compiles and work both by fpc and dcc
compiler:
+ start for-in loop implementation: implement for-in loop for types (enumerations and ranges), strings, arrays and sets. todo: perform type checking, optimize array and string loops - use temp for expression, implement for-in loop for classes
test:
+ add a simple test for the 'for-in' loop
compiler: fix string for-in loop. now it uses a temp variable to store string expression result
complier: fix for-in array loop. use a temp variable for the loop expression only if loop is not an open array loop
complier: continue enumerator implementation:
+ add operator enumerator which give an ability to add enumerator for an existent type (for example to override builtin string enumerator)
+ add class enumerator support via delphi compatible GetEnumerator method + enumerator class/object template (function MoveNext: Boolean; property Current)
+ tests
compiler: fix for-in loop for arrays. delphi does not copy arrays to a temp variable and it is possible to change array during loop. + test
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: add reference for the enumerator operator when it is used + another test for operator enumerator for a class
compiler: enumerator directive support:
+ allow to mark methods and properties by 'enumerator MoveNext' and 'enumerator Current' modifiers. Parser checks return types and duplicates.
+ prefer *marked* by enumerator directive methods and properties than GetEnumerator and Current builtin symbols
+ increase ppu version
+ test
rtl: add IEnumerator and IEnumerable interfaces declarations
tests: for-in loop tests:
+ add small comment at the top of test program
compiler: allow 'enumerator MoveNext' for the interface function declaration + test
compiler: move all for-in loop helpers to the nflw unit
compiler: don't allow the compiler to choose the non-valid enumerator operator for the for-in loop
git-svn-id: trunk@14008 -
- compiler: allow message after the *deprecated* keyword
- compiler: raise an internal error if deprecated message is trying to set to a non clear string pointer
git-svn-id: trunk@13997 -
-- Zusammenführen von r13887 in ».«:
A tests/test/tfinal1.pp
U compiler/msgtxt.inc
U compiler/msgidx.inc
U compiler/pdecsub.pas
U compiler/tokens.pas
U compiler/symconst.pas
U compiler/msg/errore.msg
U compiler/utils/ppudump.pp
-- Zusammenführen von r13890 in ».«:
G compiler/msgtxt.inc
G compiler/msgidx.inc
U compiler/nobj.pas
G compiler/msg/errore.msg
-- Zusammenführen von r13891 in ».«:
A tests/test/tfinal2.pp
git-svn-id: trunk@13938 -
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 -
-- Zusammenführen von r13884 in ».«:
U compiler/msgtxt.inc
U compiler/msgidx.inc
U compiler/pdecsub.pas
U compiler/pdecobj.pas
U compiler/tokens.pas
U compiler/ppu.pas
U compiler/symconst.pas
U compiler/msg/errore.msg
U compiler/utils/ppudump.pp
-- Zusammenführen von r13885 in ».«:
A tests/test/tsealed1.pp
A tests/test/tabstract1.pp
A tests/test/tsealed2.pp
-- Zusammenführen von r13893 in ».«:
A tests/test/tsealed3.pp
A tests/test/tsealed4.pp
git-svn-id: trunk@13908 -
* don't allow "type x = type y" for objcclass/objcprotocol for now
(would require generating new rtti for the new name)
git-svn-id: branches/objc@13641 -
only the last source file specified will be compiled, not the first one
* also print out both the old and the new source file name to be compiled
when showing that message (to more easily find where the error is)
* give an error if an unknown parameter is used, instead of silently
ignoring it
git-svn-id: trunk@13429 -
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 -
svn+ssh://jonas@svn.freepascal.org/FPC/svn/fpc/trunk
........
........
r13157 | marco | 2009-05-17 14:22:41 +0200 (Sun, 17 May 2009) | 2 lines
* mingw textmode IDE debugging support. First working version (for me), atexit handler for mingw and cygwin stuff under ifndef USE_MINGW_GDB
........
r13158 | marco | 2009-05-17 14:43:57 +0200 (Sun, 17 May 2009) | 1 line
* Fix for gdb66/mingw (general?) program reset issue. Instructs GDB to turn confirmation off. Mantis 0011968
........
r13159 | yury | 2009-05-17 14:43:58 +0200 (Sun, 17 May 2009) | 1 line
* Replaced some ifdef x86_64 by ifdef cpu64bitaddr, since it is more correct.
........
r13160 | yury | 2009-05-17 14:47:26 +0200 (Sun, 17 May 2009) | 1 line
* Set default image base for win64 dlls to $110000000.
........
........
........
r13163 | jonas | 2009-05-17 16:33:20 +0200 (Sun, 17 May 2009) | 3 lines
* support {$i *.ext} to include source files with the same base name, but
with a different extension than the current source file (mantis #13696)
........
r13164 | jonas | 2009-05-17 16:42:17 +0200 (Sun, 17 May 2009) | 2 lines
* copyright in comments updated (from mantis #13048)
........
r13165 | jonas | 2009-05-17 16:50:44 +0200 (Sun, 17 May 2009) | 2 lines
* small fixes from Karl-Michael Schindler (mantis #13048)
........
r13166 | marco | 2009-05-17 17:37:27 +0200 (Sun, 17 May 2009) | 3 lines
* gtk_cell_renderer_combo_new returns gtkcellrenderer not -combo (mantis 13689),
probably to support some kind of procedural polymorphism.
........
r13167 | jonas | 2009-05-17 18:01:13 +0200 (Sun, 17 May 2009) | 4 lines
* when loading the functions for a particular OpenGL function, also
automatically load those for lower versions (patch by "satan", mantis
#13687)
........
r13168 | marco | 2009-05-17 19:09:26 +0200 (Sun, 17 May 2009) | 3 lines
* reversed destruction order of TFPObjectList as per Mantis 13715.
Note that it is _NOT_ good coding to rely on such things
........
........
........
........
r13172 | sergei | 2009-05-18 00:56:51 +0200 (Mon, 18 May 2009) | 9 lines
DOM test suite enhancements:
* Do not convert tests which request implementation attribute 'signed'='true'.
Such tests aren't applicable to our unsigned DOM, they only cause compiler warnings
and noise in the test report.
+ Support for default properties (obj.item(x) -> obj[x]).
+ Support black-listing of testcases. Some of them (in HTML testsuite) are easier to
rewrite by hand than to convert.
+ Support adding certain units to 'uses' clause (e.g. HTML suite must use dom_html).
........
........
........
r13175 | sergei | 2009-05-18 22:33:43 +0200 (Mon, 18 May 2009) | 1 line
dom.pp: Ignore node read-only property when its owning document is being destroyed (enables destroying nodes in arbitrary order).
........
r13176 | sergei | 2009-05-19 00:03:37 +0200 (Tue, 19 May 2009) | 2 lines
* Moved TDOMAttrDef class from xmlread.pp to dom.pp (in order to implement default attribute handling at DOM level).
* Using regular CloneNode() method to create copies of TDOMAttrDef.
........
........
........
........
r13180 | sergei | 2009-05-21 01:08:24 +0200 (Thu, 21 May 2009) | 13 lines
Final strike for #13605:
src/dom.pp:
* GetElementsByTagName[NS] results now get cached in a hashtable. Repeated calls to
GetElementsByTagName with same arguments return the same instance of NodeList. All NodeLists
created during document lifetime are destroyed with the document.
src/xmlutils.pp:
* THashTable.Lookup(), changed SetString to SetLength+Move because SetString truncates on #0
+ added THashTable.RemoveData() method
tests/api.xml:
- No longer need to 'garbage collect' the NodeLists.
........
r13181 | jonas | 2009-05-21 11:57:45 +0200 (Thu, 21 May 2009) | 4 lines
- unconditionally enabled {$ifdef PARAOUTFILE}-code (that define was
decomissioned quite a while ago, but this file was forgotten in
that process)
........
r13182 | marco | 2009-05-21 13:26:54 +0200 (Thu, 21 May 2009) | 2 lines
* win64 compatibility fix from Vincent. TLibHandle is now equal to system.thandle
........
r13183 | marco | 2009-05-21 16:11:16 +0200 (Thu, 21 May 2009) | 1 line
* some minor vista/w7 related updates to message numbers
........
r13184 | sergei | 2009-05-21 22:45:16 +0200 (Thu, 21 May 2009) | 1 line
dom.pp: Added node memory management code (pure addition, no functionality changes this time).
........
r13185 | sergei | 2009-05-22 01:07:32 +0200 (Fri, 22 May 2009) | 10 lines
dom.pp: Customized memory management, fixes 17 test cases and all memory leaks in testsuite:
* Every node created by Document.CreateXXX method is now guaranteed to be destroyed with the
document, whether it is part of the tree or not. Therefore, DOM methods which remove nodes
from the tree (namely, TDOMNode.RemoveChild, TDOMNode.ReplaceChild,
TDOMElement.SetAttributeNode and TDOMElement.SetAttributeNodeNS) no longer need to destroy
their return value and are now conformant to the specs.
* Nodes are allocated in arrays of instances (emulates 'placement new operator' in C++ terms).
Allocation and freeing are as fast as possible (just assigns a couple of pointers).
* Behaviour of nodes that are created by direct call to constructor is unchanged.
........
r13186 | jonas | 2009-05-23 12:10:56 +0200 (Sat, 23 May 2009) | 2 lines
+ Darwin-specific fcntl constants
........
........
r13188 | marco | 2009-05-23 17:40:13 +0200 (Sat, 23 May 2009) | 1 line
* thread creation failure for win<x>. Mantis 13798
........
r13189 | joost | 2009-05-24 13:17:59 +0200 (Sun, 24 May 2009) | 1 line
* Modified patch from taka_jp to set the connection-dataset for mysql, bug #13588.
........
r13190 | joost | 2009-05-24 13:20:45 +0200 (Sun, 24 May 2009) | 1 line
* Fixed resource-leak on exceptions during creating/dropping databases, patch from taka_jp, bug #13587
........
r13191 | jonas | 2009-05-24 13:48:49 +0200 (Sun, 24 May 2009) | 5 lines
* changed the parameters of gotoxy() and the return values of wherex/wherey
from byte into tcrtcoord=1..255, since all crt unit coordinates are
1-based (not for Window() procedure, see comments in crth.inc;
mantis #13788)
........
r13192 | jonas | 2009-05-24 14:25:33 +0200 (Sun, 24 May 2009) | 2 lines
* again made less complex in case of PIC, otherwise it fails
........
r13193 | jonas | 2009-05-24 14:26:38 +0200 (Sun, 24 May 2009) | 2 lines
* make sure example also works without an application bundle
........
r13194 | jonas | 2009-05-25 20:34:04 +0200 (Mon, 25 May 2009) | 2 lines
* fixed evaluating "nil +/- int_const" expressions (mantis #13815)
........
r13195 | jonas | 2009-05-25 21:41:14 +0200 (Mon, 25 May 2009) | 4 lines
* 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)
........
r13196 | sergei | 2009-05-25 22:28:40 +0200 (Mon, 25 May 2009) | 8 lines
dom.pp: No more failures on level 1 testsuite... at last.
+ Implemented handling of default attributes:
* creating an element also creates and attaches the default attributes;
* removing an attribute restores it with default value, if there's one.
+ Attribute nodes remove themselves from the owner element upon destruction, making it possible
to Free attributes manually.
* TDOMNamedNodeMap.SetNamedItem does not reset attribute OwnerElement if the argument node is already
contained in the map (and whole operation is therefore is a no-op).
........
r13197 | marco | 2009-05-26 14:24:58 +0200 (Tue, 26 May 2009) | 5 lines
* uxtheme moved from Lazarus.
* Disabled (ifdeffed) lock around init/finalization because of circular
reference between fcl-base and winunits-base. If needed it can be
recoded directly using system specific (windows.pas) routines.
........
r13198 | jonas | 2009-05-26 18:22:41 +0200 (Tue, 26 May 2009) | 2 lines
* make references PIC-safe before pushing them as parameter (mantis #13829)
........
r13199 | marco | 2009-05-26 18:54:49 +0200 (Tue, 26 May 2009) | 2 lines
* tmschema as include file added at Paul's request
........
r13200 | sergei | 2009-05-27 00:14:21 +0200 (Wed, 27 May 2009) | 6 lines
+ Implementation of TDOMDocument.CreateAttributeNS and CreateElementsNS
+ Initial part of TDOMElement.SetAttributeNS
+ TDOMImplementation.CreateDocumentType checks validity of QualifiedName
* Use 'managed' memory allocation in TDOMEntity.CloneNode and TDOMNotation.CloneNode to avoid leaks
* TDOMDocument.RemoveID now using THashTable.RemoveData(), simplifies things
........
r13201 | marco | 2009-05-27 09:29:04 +0200 (Wed, 27 May 2009) | 2 lines
* Marquee patch from Paul + some Vista PBM_ constants.
........
r13202 | marco | 2009-05-27 10:46:27 +0200 (Wed, 27 May 2009) | 2 lines
* first half of vista updates.
........
r13203 | marco | 2009-05-27 18:26:32 +0200 (Wed, 27 May 2009) | 2 lines
* vista items till WC_STATICA, roughly at 80% now.
........
r13204 | jonas | 2009-05-27 19:26:50 +0200 (Wed, 27 May 2009) | 2 lines
* various optimizations by Dave Richards (mantis #12440)
........
r13205 | jonas | 2009-05-27 19:50:55 +0200 (Wed, 27 May 2009) | 3 lines
* forbid "nil +/- ordinal" expressions (Delphi-compatible, and the
expression is meaningless since nil is not a valid address)
........
r13206 | marco | 2009-05-27 22:08:56 +0200 (Wed, 27 May 2009) | 2 lines
* more Vista fixes, and implemented some macro's that somehow were not implemented.
........
r13207 | hajny | 2009-05-27 23:18:35 +0200 (Wed, 27 May 2009) | 1 line
* extension of r13191 to OS/2, EMX and potential other platforms using crt.inc based implementation of unit crt
........
r13208 | florian | 2009-05-29 00:28:58 +0200 (Fri, 29 May 2009) | 1 line
* patch to fix fillpoly, by borsa77
........
r13209 | michael | 2009-05-29 09:24:02 +0200 (Fri, 29 May 2009) | 1 line
* Change so that when FindFirst initially returns nonzero, FindClose is no longer needed (Windows compatible)
........
r13210 | michael | 2009-05-29 09:27:41 +0200 (Fri, 29 May 2009) | 1 line
* Change so that when FindFirst initially returns nonzero, FindClose is no longer needed (Windows compatible)
........
r13211 | michael | 2009-05-29 09:30:46 +0200 (Fri, 29 May 2009) | 1 line
* Fix from Ken Wright for broken FPC changes
........
r13212 | jonas | 2009-05-30 13:29:54 +0200 (Sat, 30 May 2009) | 2 lines
* fixed/cleaned up tests for "nil + 1"
........
r13213 | michael | 2009-05-30 14:07:16 +0200 (Sat, 30 May 2009) | 1 line
* Some TCustomVariant methods implemented
........
r13214 | sergei | 2009-05-31 10:18:06 +0200 (Sun, 31 May 2009) | 3 lines
+ Processing of prefixed attributes and prefix bindings. This completes namespace support at
the XML reader side.
........
r13215 | sergei | 2009-05-31 11:14:37 +0200 (Sun, 31 May 2009) | 1 line
* Added .txt extension to README_DOM (this one was missed while fixing Mantis #12358)
........
r13216 | sergei | 2009-05-31 12:38:28 +0200 (Sun, 31 May 2009) | 1 line
Bringing readme's up to date
........
r13217 | Legolas | 2009-05-31 14:15:24 +0200 (Sun, 31 May 2009) | 4 lines
* updated nds/gba linker scripts and reverted some changes for 2.2.4a release
- Removed unused/outdated stuff from libndsfpc
+ Added new examples for libndsfpc
+ Added working (I hope so...) makefile.fpc for all libndsfpc/libgbafpc examples
........
git-svn-id: branches/objc@13348 -
can create ambiguities for the parser in case the field names also exist
as modifiers (TP- and Delphi-compatible, mantis #13971) + tests
* fixed tests that broke because of this change
git-svn-id: trunk@13334 -
o support for declaring external Objective-C classes (see
rtl/inc/objcbase.pas), including derived classes
o support for converting methods of objcclasses into selectors
(see tests/test/tobjc1.pp)
o support for loading from/storing to fields of objcclasses
o support for calling Objective-C methods using regular
Object Pascal syntax (see tests/test/tobjc1.pp)
o some things that are known to be not yet working:
o automatic conversion from ID to objcclasses and back
o declaring and implementing new objcclasses/methods in Pascal code
o debug information (objcclasses are currently plain pointers
as far as the debugger knows)
git-svn-id: branches/objc@13162 -
* Warning when 64-bit object file contains 32-bit absolute relocations. In such case an executable image can be loaded into lower 4Gb of address space only.
git-svn-id: trunk@13110 -
work correctly with DWARF)
* only force the internal linker for STABS when generating relocatable
output (rather than for all debugging formats)
git-svn-id: trunk@12917 -
the use of Objective-C 1.0 constructs. Because it is a mode switch, it
can be used cumulatively with every syntax mode. Note that a {$mode xxx}
statement resets all mode switches as well, so you cannot use the
-Mobjectivec1 variant if you have such a statement in a unit. This
modeswitch is currently only enabled for Darwin/PowerPC and Darwin/i386,
as the backend support is not yet implemented for other platforms.
+ implemented selector() statement that can be used to create an Objective-C
selector for the message with the specified *constant* name (in the future,
it will also work for Objective-C method identifiers)
+ added SEL type to the system unit (the selector() statement returns it)
+ added all Objective-C segments to the assembler writers
+ (currently mostly dummy) objc1 unit that is automatically included if the
{$modeswitch objectivec1} statement is used
+ some tests for the selector() statement
git-svn-id: trunk@12870 -