+ new stream class TCRangeStream that represents a substream of another stream while being also extendable
........
Extend tentryfile so that it can be opened from a stream in addition to a file
entfile.pas, tentryfile:
+ new method openstream() to open a readable tentryfile based on a stream
+ new method createstream() to open a writeable tentryfile based on a stream
* adjust openfile() to use openstream()
* adjust createfile() to use createstream()
........
A few extensions for tentryfile needed for package files
entfile.pas, tentryfile:
+ new property position to retrieve/control the position of the underlying stream (works also with tempclose()/tempopen())
+ new method substream() to retrieve a stream that goes from the specified offset with the specified length (-1 create a stream that is extendable, aka for writing)
+ new property stream to get the underlying stream directly; be careful when using this!
........
Extend tppumodule so that it can be opened from a stream as well.
fppu.pas, tppumodule:
* rename openppu() to openppufile()
+ new method openppustream() to open a module based on a stream
+ put the common part of openppufile() and openppustream() into a new method openppu()
........
Fix compilation.
fppu.pas, tppumodule:
* openppu: add parameter ppufiletime for printing the time of the file (only if filetime is not -1)
* openppufile: pass the retrieve time of the PPU to openppu()
* openppustream: pass -1 to openppu()
........
git-svn-id: trunk@33109 -
ncgrtti.pas, TRTTIWriter.write_rtti_data.objectdef_rtti.objectdef_rtti_interface_full:
* only set the ifHasStrGUID flag for Corba interfaces and if the IIDStr is not '' (which it is by default)
* only write the IIDStr for Corba interfaces
git-svn-id: trunk@33105 -
* support conditional branches with 2 parameters
* factored out common parts
* adjusted range limits, they were copy-pasted from PowerPC target which uses 14-bit offsets. MIPS however uses 16-bit offsets, i.e. can branch 4 times farther.
git-svn-id: trunk@33088 -
symdef.pas, tstoreddef:
* deref: don't free the deref list and it's entries as deref() might be called again when the unit reloaded a second time
git-svn-id: trunk@33054 -
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 -
The result type of the intrinsic is determined by the Then-expression to provide a bit of control. There might however be some situations in which this fails, for this exceptions need to be added (e.g. a constant string needs to be converted to a normal string).
compinnr.inc:
+ add new constant in_ifthen_x_y_z for the IfThen() intrinsic
psystem.pas:
+ create_intern_symbols: add symbol for IfThen() intrinsic
pexpr.pas:
* statement_syssym: parse parameters of IfThen() intrinsic and return corresponding inline node
ninl.pas, tinlinenode:
+ new method handle_ifthen() which converts the inline node to an if-node which assigns the expressions to a temp node that is returned
* pass_typecheck: handle in_ifthen_x_y_z using handle_ifthen()
* pass_1: in_ifthen_x_y_z does not need a first pass as it's already converted after the typecheck pass
+ added tests
git-svn-id: trunk@33036 -
selected instruction set define (CPU8086/CPU80186/CPU80286, etc.)
For a generic i8086 target define, 'CPUI8086' should be used instead of
'CPU8086'.
git-svn-id: trunk@33006 -
* updated TAOptObj.RegUsedAfterInstruction with the arm implementation and removed the arm specific implementation
* RegLoadedWithNewValue and InstructionLoadsFromReg are now a methods of TAoptBase
* moved RegEndOfLife to TAOptObj
* during this refactoring, fixed also TCpuAsmOptimizer.RegLoadedWithNewValue for arm regarding post/preindexed
memory references: those modify the register but do not load it with a new value in the sense of RegLoadedWithNewValue
git-svn-id: trunk@33000 -
Fix a potential access violation when exporting symbols on a Unix based system.
expunix.pas, texportlibunix:
* generatelib: check whether hp2.sym is really assigned before accessing it
........
git-svn-id: trunk@32983 -
Merged revision(s) 28793, 28903, 31951 from branches/svenbarth/packages:
psub.pas, read_proc:
* don't generate assembler symbols for compiler internal code
........
Ensure that unneeded initialization/finalization procedures don't leave assembler symbols.
ncgutil.pas:
+ new function release_proc_symbol which removes all assembler symbols of a procdef
pmodules.pas, proc_unit:
* if the initialization or finalization procedure is empty also remove their assembler symbols so they are exported
........
Ensure that readonly sections that need relocations are indeed declared as such.
Thanks to Jonas for this.
ncgvmt.pas, TVMTWriter:
* writeinterfaceids: use sec_rodata instead of sec_rodata_norel
........
git-svn-id: trunk@32982 -
Extract reading of the PPU/PCP version into tentryfile.
entfile.pas:
+ add new getversion method which uses the pointer returned by getheaderaddr to read the PPU/PCP version
ppu.pas:
- remove GetPPUVersion method
fppu.pas, pmodules.pas, utils/ppufiles.pp, utils/ppumove.pp, utils/ppuutils/ppudump.pp
* replace call to GetPPUVersion by call to getversion
........
git-svn-id: trunk@32980 -
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 -
Provide possibility to register callbacks that are called from InitGlobals and DoneGlobals.
globals.pas:
+ new function register_initdone_proc which allows to register a callback for InitGlobals and DoneGlobals respectively
+ add functions callinitprocs, calldoneprocs, allocinitdoneprocs, freeinitdoneprocs to manage and access the init/done-callbacks
* InitGlobals: call callinitprocs
* DoneGlobals: call calldoneprocs
........
git-svn-id: trunk@32977 -
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 -
Provide a possibility to ignore duplicate symbols for exporting.
export.pas, texportlib:
+ new property "ignoreduplicates" with which duplicate symbols are ignored upon insertion
+ new method "duplicatesymbol" which checks "ignoreduplicates" and generates an error if it is False (this method needs to be used if a duplicate was detected)
expunix.pas, texportlibunix:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_beos.pas, texportlibbeos:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_haiku.pas, texportlibhaiku:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwl.pas, texportlibnetwlibc:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_nwm.pas, texportlibnetware:
* exportprocedure: use "duplicatesymbol" instead of always generating an error
systems/t_win.pas, texportlibwin:
* exportfromlist: use "duplicatesymbol" instead of always generating an error
........
git-svn-id: trunk@32974 -
TObjData.writeReloc; on i8086 it was changed to longint to allow using 32-bit
relocations
+ added support for writing 32-bit OMF relocations
git-svn-id: trunk@32936 -
aliases for RELOC_ABSOLUTE and RELOC_RELATIVE
* use RELOC_ABSOLUTE16 and RELOC_RELATIVE16, instead of RELOC_ABSOLUTE and
RELOC_RELATIVE in the linker-related parts of the OMF support (OMF object
reader and MZ exe output). This will make the code more readable, when 32-bit
relocation support is added to the linker. It will also make easier to reuse
this code for i386, in case we add an i386 target, that uses the OMF object
format.
git-svn-id: trunk@32923 -
simplify, so that shortstring -> shortstring constant string conversions
are simplified for LLVM too (it leaves regular tc_equal type conversions
because often the type is still somewhat different), which is required
for the code in tasmlisttypedconstbuilder.tc_emit_stringdef() (it
assumes the result of inserting a type conversion is again a
stringconstant if it can be handled at compile time)
git-svn-id: trunk@32907 -
inserttypeconv()
o keep typeconversions between structurally equivalent but semantically
different procvardefs for LLVM and JVM, because they're different
types there
git-svn-id: trunk@32904 -
16-bit version is picked up by default for opsize=S_NO. Previously the 386
version was picked on i8086, but the generated code was correct, because we
don't yet generate a 0x66 prefix for "\325", which leads to many 32-bit
instructions not being assembled correctly with the internal asm obj writer on
the i8086
git-svn-id: trunk@32887 -
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 -
* don't reimplement BuildStringConst, use the inherited one
* findopcode's string argument is now const, simplified the function and removed some dead code
* removed an intentional null ptr write in an error path, which was debug code and left in accidentally
git-svn-id: trunk@32829 -
o individual elements are not (yet) dead-strippable on LLVM though,
there doesn't seem to be a way to encode the necessary information
in LLVM (so e.g. all resource strings from a unit are currently
always linked in if at least one is referenced)
git-svn-id: trunk@32802 -
fpc_addref_array/fpc_finalize_array (those helpers expect a pointer
to the elements of the array, not a pointer to the array)
git-svn-id: trunk@32779 -
o reduces the size of the generated LLVM IR, but mainly important for LLVM
intrinsics such as llvm.memcpy.*(), as llc complains if some of their
parameters are not constants (you could work around it by first running
opt or by using clang with optimizations so that the constants, which
were loaded in registers until now, were propagated to the intrinsics
by the time llc saw them)
git-svn-id: trunk@32776 -
loadvmtaddr and vmt_def
o give an error when trying to use sizeof on a class/object when
targeting the JVM (can't get/load the data size there)
git-svn-id: trunk@32764 -
those will never call a nested routine using Pascal-level support
for accessing local variables (even if the nestedvars stayed empty,
this caused a stack frame to be allocated because a temp of 0
bytes is rounded up to 4 bytes)
git-svn-id: trunk@32739 -
than the one we use to construct the LLVM equivalent (which doesn't support
variants), or in case the complete record is not defined in the source and
has to be padded with zeroes
o we do this by creating a new recorddef in this case with as elements the
defs of the actually emitted constant data, and replacing the original
def with this new def; note that this can also replace arrays in case of,
e.g., an array of a variant record type
o the pass in llvmtype takes care of inserting type conversions (bitcasts)
when these constants are accessed using the original def
git-svn-id: trunk@32719 -
aggregate to a (new) recorddef
o the size of the original type and that of the record must match
o will be used by the LLVM generator in case of a variant record, or
an array of variant records with constant data that does not match
our canonical LLVM definition
git-svn-id: trunk@32718 -