Commit Graph

12950 Commits

Author SHA1 Message Date
florian
28036ed068 * fix some mips compiler issues, system unit compilation is getting forward
git-svn-id: trunk@20258 -
2012-02-04 22:53:52 +00:00
florian
8b339ded7a * started to fix the mips(el) linux rtl
git-svn-id: trunk@20255 -
2012-02-04 21:25:53 +00:00
svenbarth
ef10ce3bd0 * pgenutil.pas, generate_specialization:
When parsing an inline specialization inside a generic we need to 
	respect the "parsedtype" parameter which tells us whether the first
	generic parameter was already parsed. This fixes Mantis #20871 .
+ added test for this

git-svn-id: trunk@20251 -
2012-02-04 16:26:47 +00:00
svenbarth
9cb16c950f This fixes Mantis #20851 .
For the solution symbols will now contain a "sp_explicitrename" flag if they
were created through a type rename. This is necessary, because we can't
decide whether a type is a renamed generic para which contains by default a
reference to the default undefined def. Using individual undefined defs will
lead to duplicate identifiers as they are created before a symtable was
pushed (thus they'll ba part of whatever symtable is at the top). 

+ symconst.pas, tsymoption:
        Add a new option "sp_explicitrename" which will be used to track type
        renames.
+ pdecl.pas, type_dec:
        Set the new flag if we're dealing with a type rename
* pexpr.pas, factor_read_id:
        If we have an undefined def that is also a rename then we assume that
        it's a rename of a generic parameter
* utils/ppudump.pp:
        Adjustment because of change to tsymoption
* utils/ppu.pp:
        Increase PPU version
+ added test

git-svn-id: trunk@20250 -
2012-02-04 16:03:58 +00:00
svenbarth
04683c5f13 pgenutil.pas, generate_specialization:
- Remove unneeded check for "parse_generic" (it's already checked in the outer if-clause).
+ Check whether we are trying to specialize one of the surrounding type declarations of a
  nested type (as long as nested generics are forbidden this is always the outermost generic
  or specialization). This check can not rely on the symbol, because while parsing the
  generic or the specialization the symbol's def is still an errordef. This fixes 
  Mantis #19498 .

+ Added test from bug report.

git-svn-id: trunk@20247 -
2012-02-04 14:20:26 +00:00
svenbarth
a7a0ba0cf4 * Move the setup and teardown of the specialization symtable stack into two extra
procedures, so that changes in the setup/teardown need to be done only once 
  instead of twice.

git-svn-id: trunk@20246 -
2012-02-04 12:37:43 +00:00
svenbarth
c572395f61 * pgenutil.pas, generate_specialization & psub.pas, specialize_objectdefs:
When specializing a generic the references from unitsyms to the loaded modules
	needs to be reestablished, so that "unitidentifier.identifier" can be used
	inside a generic without leading to an access violation.
	Only global units are checked, because a generic must not use symbols from the
	static symtable or from units used by the implementation section (the latter is 
	currently not checked)

+ added tests for the above problem for "normal" units as well as units with a namespace 

git-svn-id: trunk@20245 -
2012-02-04 11:33:17 +00:00
florian
76d29ff172 * some Makefiles regenerated to support mips-linux
git-svn-id: trunk@20244 -
2012-02-04 09:50:03 +00:00
pierre
19e11f889f * Fix error in EXTDEBUG code
git-svn-id: trunk@20227 -
2012-02-02 23:55:43 +00:00
pierre
cf6590cc0e Use rmipsgas.inc file for gas register names
git-svn-id: trunk@20226 -
2012-02-02 23:54:39 +00:00
pierre
936c78eef1 + Use new assembler reader
git-svn-id: trunk@20225 -
2012-02-02 23:52:08 +00:00
pierre
bd9ddd498c Use standard MIPS regsiter names
git-svn-id: trunk@20224 -
2012-02-02 23:51:16 +00:00
pierre
61eba72178 Use standard MIPS regsiter names
git-svn-id: trunk@20223 -
2012-02-02 23:50:39 +00:00
pierre
a9c7e135ee Add MIPS GNU AS reader
git-svn-id: trunk@20222 -
2012-02-02 23:49:51 +00:00
pierre
77301e699d Commit some MIPS changes from MarkMLl
git-svn-id: trunk@20221 -
2012-02-02 23:46:24 +00:00
pierre
c0690d1bdc + New virtual method TATTReader.HandleDollar, useful for MIPS reader
git-svn-id: trunk@20220 -
2012-02-02 23:45:22 +00:00
pierre
4a351f42fe Commit some MIPS changes
git-svn-id: trunk@20219 -
2012-02-02 23:43:52 +00:00
Jonas Maebe
6a5cf6cf8d * always pass -arch parameter to linker when targetting Darwin, instead of
skipping this for dynamic libraries (not sure why that was done, but
    apparently not passing -arch triggers a bug in Xcode 4.2 Lion linker,
    mantis #21159)

git-svn-id: trunk@20211 -
2012-02-01 19:01:58 +00:00
pierre
3a3ab75e4a + regdatia64 phony target to generate all ia64 register include files
git-svn-id: trunk@20202 -
2012-01-31 15:49:30 +00:00
pierre
dbeca48e3d + New mkia64reg.pp source
git-svn-id: trunk@20201 -
2012-01-31 15:47:31 +00:00
Jonas Maebe
1f83203117 * make self-pointer passed by reference not regable. Was not necessary
when we only had objects because they are never put in registers,
    but (advanced) records can be (mantis #21177)

git-svn-id: trunk@20192 -
2012-01-29 11:30:12 +00:00
Jonas Maebe
74e721517d * keep track of the type of symbolic floating point constants rather
than always forcing them to bestreal (mantis #21151)

git-svn-id: trunk@20190 -
2012-01-28 18:38:06 +00:00
svenbarth
a28a9a9521 * pdecobj.pas, object_dec:
Always define nested types of a generic as generic as well.
* symtable.pas: 
	+ Add a function which decides whether two defs belong to the same generic.
	* Fix sym_is_owned_by as there can be corner cases where childsym becomes Nil.
* ptype.pas:
	* record_dec: Always define nested types of a generic as generic as well.
	* single_type & read_named_type.expr_type:
		Use the newly added function to improve the checks whether a generic 
		symbol should be rejected as "generics not allowed for types of 
		variables or fields".
+ Add a test for which the improved checks are necessary.

git-svn-id: trunk@20189 -
2012-01-28 18:09:40 +00:00
Jonas Maebe
f984a3d74e - removed optimization that pops the current symtable off the symtablestack
if it cannot contain local type definitions before looking up the type of
    a field, because the type of a field may be a new type definition (e.g. an
    inline record definition) and such type definitions must be added to the
    correct symtable for, a.o., correctly resolving uses of the name of a
    type that is currently being parsed

git-svn-id: trunk@20187 -
2012-01-28 17:07:56 +00:00
florian
fc569e224d * handle all operand combinations of xadd, resolves #21146
git-svn-id: trunk@20177 -
2012-01-25 21:26:59 +00:00
paul
310c396cfc compiler: add owner hierarchy prefix for mangled name of parameter def to prevent asm symbols collision (issue #0020940)
git-svn-id: trunk@20163 -
2012-01-24 08:27:51 +00:00
paul
a71d588105 compiler: write INIT and RTTI info also for defs of nested records and classes + test (issue #0020909)
git-svn-id: trunk@20162 -
2012-01-24 06:57:04 +00:00
paul
d752ce2c11 compiler:
- postpone insertion of hidden params into record methods after the full record parse to prevent interface and implementation difference because of the possible record size change after the method parse (issue #0021044)
  - skip hidden arguments during methods search for a property setter because of the above change and also for consistency with getter method search
  - test

git-svn-id: trunk@20161 -
2012-01-24 01:45:31 +00:00
Tomas Hajny
682299a647 + add previously missing support for link map generation for OS2 and EMX targets
git-svn-id: trunk@20158 -
2012-01-23 21:29:00 +00:00
svenbarth
7986f03186 * pgenutil.pas, generate_specialization:
* When building the typename for a generic use the full typename
	  including it's surrounding object- or abstractrecorddefs. This allows
	  that a nested non-generic type of a generic type A can be used as
	  type arguments for more than one specialization of another generic B
	  (there were some problems when B e.g. defined a pointer to the type
	  argument's type)

	* Always CRC the constructed specialization name as otherwise it might
	  reach the limit of 255 characters (not yet including unit name,
	  method name or method arguments)
	  Note: Errors like "expected XYZ, but got ABC" will need to be 
		adjusted to use the prettyname...

* increased PPU version
+ added test for above's point 1

git-svn-id: trunk@20149 -
2012-01-22 13:29:12 +00:00
Jonas Maebe
eedb5c89de * part of r20140, forgot to commit
git-svn-id: trunk@20145 -
2012-01-21 21:16:47 +00:00
Jonas Maebe
e5c097a6e2 * mark nodes that have been created by transforming a read-accessor of
of a property with nf_no_lvalue flag, and check that such nodes are
    never used in direct assignments (fixes mantis #21087 and a couple of
    other cases of invalid assignments to properties)

git-svn-id: trunk@20140 -
2012-01-21 19:09:30 +00:00
Jonas Maebe
6432c82c01 * don't pass property as var-parameter to val()
git-svn-id: trunk@20137 -
2012-01-21 16:54:57 +00:00
Jonas Maebe
ab9b52a003 * truncate indices into arrays from 64 to 32 bit on 32 bit
platforms so that their code generators don't get 64 bit
    operands (fixes internalerrors on at least ppc32  after r20108)

git-svn-id: trunk@20132 -
2012-01-20 22:43:55 +00:00
pierre
736299ffd9 Add ia64 define cpuXXXX series
git-svn-id: trunk@20123 -
2012-01-20 14:19:59 +00:00
pierre
752fabab73 Fix compilation of alpha/cpuinfo unit
git-svn-id: trunk@20122 -
2012-01-20 14:18:53 +00:00
pierre
6b2a0e978b Fix ia64 compilation problems
git-svn-id: trunk@20121 -
2012-01-20 14:17:56 +00:00
sergei
06192a8137 Values of managed variables are never ever used after decrementing reference on the variable, so there is no point of having a 'decrement reference' as a separate operation. We can always do 'finalize', i.e. clear the contents after decref.
* Modified fpc_ansistr_decr_ref and fpc_widestr_decr_ref so they always zero the pointer passed by reference. Other _decr_ref helpers already do it.
- Removed tcg.g_decrrefcount, calling cg.g_finalize instead.
- finalize_data_node and tcg.g_finalize: removed code generation for zeroing locations, because it is now done by RTL helpers. This further reduces code size.

As a total result of this change and r20118, the size of Lazarus executable is reduced by about 12%.

git-svn-id: trunk@20119 -
2012-01-19 23:11:09 +00:00
sergei
afb4992113 * Changed code generation for assignments of managed types, it now generates a single call to helper procedure (significantly reducing code size) and is handled entirely in firstpass.
git-svn-id: trunk@20118 -
2012-01-19 22:28:29 +00:00
Jonas Maebe
ceee186f2f * typecheck all array indices, not just integer and boolean types
o allows converting indices to the proper type if required (such as
     variant, mantis #20873)
   o do not create temporary defs for this type checking anymore if not
     necessary
   o makes sure that errors are thrown in case of conversions considered
     as invalid by the compiler rather than that wrong code is silently
     generated (such as in mantis #20873 before this change)

git-svn-id: trunk@20108 -
2012-01-18 21:29:44 +00:00
Jonas Maebe
bab8e5da5a * set the default range type of arrays to ptrsinttype rather
than s32inttype (so it's correct for 64 bit platforms too)

git-svn-id: trunk@20107 -
2012-01-18 21:13:21 +00:00
sergei
cbad0abab5 + Platform-specific exception support for x86_64-win64. Enable by cycling with OPT=-dTEST_WIN64_SEH.
git-svn-id: trunk@20098 -
2012-01-16 23:13:31 +00:00
florian
96e8e89e16 * write error code if an object file cannot be created
git-svn-id: trunk@20083 -
2012-01-15 10:59:10 +00:00
florian
ce070c93fc + patch by Jeppe Johansen to support the SC32442B
git-svn-id: trunk@20081 -
2012-01-14 21:39:32 +00:00
florian
bf290cadae + include avr in fullcycle
git-svn-id: trunk@20080 -
2012-01-14 20:48:33 +00:00
sergei
fde1695961 * tcgx86_64.g_proc_exit: restore stack pointer using value that was calculated and stored in tcgx86.g_proc_entry, instead of recalculating it again.
git-svn-id: trunk@20078 -
2012-01-14 18:04:45 +00:00
sergei
149218408b * Factored part of tcgrpocinfo.generate_code (responsible for setting up tempgen and stack frame) into a separate method.
git-svn-id: trunk@20077 -
2012-01-14 16:45:01 +00:00
sergei
898fbdcd26 * Disallow placing hidden 'high' parameter in register if it will be accessed from implicit finally block (happens for <value open array of managed type> parameters).
git-svn-id: trunk@20072 -
2012-01-14 04:34:39 +00:00
Jonas Maebe
56161e608d * do not interpret procsyms followed by ./^/( as potential procvar
expressions in case of TP/Mac-style procvar modes (mantis #21073)

git-svn-id: trunk@20062 -
2012-01-12 21:37:59 +00:00
Jonas Maebe
1f614b7efc * use correct source code position for error messages about invalid
published fields (mantis #21035)

git-svn-id: trunk@20060 -
2012-01-12 20:09:08 +00:00