bug report #0036882: [Feature] Class and record definition XML dump extension
These patches extend the node dump feature (enabled with DEBUG_NODE_XML)
so it also dumps class and record definitions to the XML file. They are contained within <definition> tags.
Currently only fields and constants are dumped to the XML file. Methods, constant and variable definitions may be added later.
git-svn-id: trunk@47658 -
that expects an open array of byte, and use it for all sets
o since all sets need to be typecasted to an array type of the appropriate
size, we'll get a compilation error in case this needs to be done and
that also tells us at the same time that the ppu version will need to
be increased
* enabled {$packset 1} for the compiler, as this is now safe with the above
changes
git-svn-id: trunk@43407 -
Allows compilation of compiler using -dDEBUG_NODE_XML
which will generate a NAME-node-dump.xml file for each
unit, program or library compiled,
containing a XML description of the nodes handled during
compilation of the unit, program or library.
git-svn-id: trunk@42271 -
(needed for LLVM, where we need two copies of the finally code: one in case
an exception occurs, and one in case none is raised)
o also first finalize parameters and only then code generator temps, since
in theory the former could create more of the latter
git-svn-id: trunk@40345 -
Extract functionality that is shared between the metadata files for units (PPU) and for packages (PCP) into a parent class called tentryfile
+ add new unit entfile which contains the new tentryfile class and related types and constants
* ppu.pas:
- remove methods, fields, types and constants which were moved to entfile.pas
* replace the parts of tppuheader shared with tentryheader by a field of type tentryheader
fppu.pas, pmodules.pas, utils/ppumove.pp, utils/ppuutils/ppudump.pp:
+ add entfile to uses
* adjust access to common header fields
node.pas, symdef.pas, symsym.pas, symtable.pas, wpoinfo.pas, utils/ppufiles.pp:
+ add entfile to uses
........
git-svn-id: trunk@32976 -
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 -
* eliminate warnings in compiler (i386 & i368->x86_64) and minor refactorings
- comment out unused vars and types
- comment out unneeded comparisons (Longword <=> 0)
- suppress some "comparison always true|false" warnings
- tweak visiblity sections
git-svn-id: trunk@19385 -
that was set during the typecheck pass because typeconversion nodes
may have been optimised away previously and sometimes the resultdef is
important (e.g. for the value of callparanodes) (mantis #17458)
git-svn-id: trunk@16101 -
to objc_msgSend* into the callnode. This allows reusing the current
call node rather than having to create a new one, and is in particular
necessary because even though the objc_msgSend* functions are declared
as varargs, you're supposed to typecast them to the function type
describing the method before calling them (so they should *not* use
varargs calling conventions!)
* for the above, a field called fobjcforcedprocname has been added to the
callnode, which can be set to a string that will be used as the (mangled)
name of the function to call instead of the mangled name of the procsym
-> fixes calling obj-c methods with floating point arguments on ppc
git-svn-id: branches/objc@13783 -
associated with an Objective-C protocol. Code generator part will
always generate an internalerror currently, because it cannot yet
be implemented (needs support for generating RTTI for Objective-C
classes)
git-svn-id: branches/objc@13461 -
instantiated (for wpo)
* also replace vmt-entries for classes for which we don't have any
information at all with FPC_ABSTRACTERROR (since that means they
certainly are not instantiated), except for their published and
virtual class methods
* fixed check for published methods in wpo
git-svn-id: trunk@13219 -
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 -
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 -
* store a node's verbosity in the node so that e.g. disabling warnings
also disables warnings for this node in pass_1
(the above together fix mantis #12076)
* save/restore verbosity with {$push}/{$pop} (mantis #12075)
* if warnings/notes/hints are turned off, also do not count encountered
ones for the totals (otherwise -Sew cannot be used properly in
combination with {$warnings off}, because disabled warnings will still
trigger a compiler error) -- this required adding -vw/-vn/-vh to all
tests using -Sew/-Sen/-Seh
- removed some superfluous state saving/restoring from firstpass()
git-svn-id: trunk@12025 -