Commit Graph

55 Commits

Author SHA1 Message Date
Jonas Maebe
5f14029e74 * if a function result has been migrated to the parentfpstruct because it is
accessed by a nested routine, assign it back to the original funcretsym
    at the end because the code generator is hardcoded to use funcretsym.
    We can't replace funcretsym with an absolutevarsym that redirects to
    the parentfpstruct field, because the code generator can only handle
    simple variables

git-svn-id: trunk@32687 -
2015-12-20 20:56:08 +00:00
yury
17358aa3ed * Removed unused local vars.
git-svn-id: trunk@32537 -
2015-11-26 17:15:04 +00:00
Jonas Maebe
eefcbaff69 * converted tnodeutils.InsertResourceInfo to the high level typed constant
builder and enabled it for llvm

git-svn-id: trunk@32532 -
2015-11-25 22:25:48 +00:00
Jonas Maebe
416894f206 * converted tnodeutils.InsertResourceTablesTable() to the high level typed
const builder
   o also put the resourcestring tables table in rodata instead of in data,
     since it doesn't change at run time (unlike the individual resourcestring
     tables)

git-svn-id: trunk@32397 -
2015-11-21 12:36:16 +00:00
Jonas Maebe
96b529072a * factored out generating the start and end of a vectorized dead strippable
section to the high level typed const builder, and use this functionality
    for the resource strings (generating items: todo)
  * fixed dead stripping unused resource strings (all string data was put in the
    same section since r30342)

git-svn-id: trunk@32394 -
2015-11-21 12:36:06 +00:00
Jonas Maebe
964f8c9f9b * factored out the creation of start/end symbols of vectorized dead strippable
sections such as the resourcestring data

git-svn-id: trunk@32391 -
2015-11-21 12:35:56 +00:00
florian
70b8789262 o basic extended pascal support:
+ automatically loaded helper unit
  * Makefiles adapted
  * mode switch
  * mode switches reorganized
+ TimeStamp support

git-svn-id: trunk@32330 -
2015-11-15 15:13:36 +00:00
svenbarth
529677cc79 ncal.pas:
* extend tcallnode with the ability to pass a tspecializationcontext so that tcallcandidates can do a final specialization
  * the final procdef is registered at the end of tcallnode.pass_typecheck

git-svn-id: trunk@31763 -
2015-09-18 14:48:54 +00:00
Jonas Maebe
f8d9e70ec2 * converted tnodeutils.InsertMemorySizes() to the high level typed constant
builder and activated it for llvm

git-svn-id: trunk@31678 -
2015-09-14 16:10:54 +00:00
Jonas Maebe
381270bf30 * changed the threadvars table count back from
tai_const.create_32bit_unaligned() into tai_const.create_32bit() after
    r31649 (Lazarus autocompletion...) (fixes webtbs/tw3540.pp regression)

git-svn-id: trunk@31661 -
2015-09-13 07:56:12 +00:00
Jonas Maebe
faf4a9cb38 * moved the generation of the "main" stub for libc-based platforms from
hlcgobj to pmodules/symcreat/ngenutil, so that it also works for llvm

git-svn-id: trunk@31658 -
2015-09-12 23:34:01 +00:00
Jonas Maebe
4b92083006 * converted tnodeutils.InsertRuntimeInitsTablesTable to the high level typed
const builder
   o enabled the routines that use this one for LLVM

git-svn-id: trunk@31652 -
2015-09-12 23:33:38 +00:00
Jonas Maebe
a4ee982269 * converted tnodeutils.InsertInitFinalTable to the high level typed const
builder and enabled it for LLVM

git-svn-id: trunk@31651 -
2015-09-12 23:33:35 +00:00
Jonas Maebe
a1c676cc51 * converted tnodeutils.InsertThreadvarTablesTable to the high level typed
constant builder

git-svn-id: trunk@31649 -
2015-09-12 23:33:28 +00:00
Jonas Maebe
f49d6e5f26 * converted tnodeutils.InsertThreadvars to the high level typed constant
builder

git-svn-id: trunk@31647 -
2015-09-12 23:33:21 +00:00
svenbarth
65c37df999 + extend tprocdef with the possiblity to create it as unregistered
* for now all procdefs are created as registered
Note: an additional parameter instead of an overload is used for tprocdef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31593 -
2015-09-11 13:36:00 +00:00
Jonas Maebe
1941e64488 + added a hook to insert object-global information into the asmlists (will
be used to insert type definitions for llvm)

git-svn-id: trunk@30674 -
2015-04-19 21:37:43 +00:00
Jonas Maebe
640efba580 * fixed warnings after r30449/r30450
git-svn-id: trunk@30466 -
2015-04-06 14:24:09 +00:00
florian
9ab9e03650 * limit number of possible units with initialization/finalization for a certain architecture to high(aint)
+ give an error if the number of possible units is exceeded

git-svn-id: trunk@30450 -
2015-04-05 21:06:58 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jeppe Johansen
155998fe89 Support .set and .weak in internal assembler.
Fix problem with fpc_initialHeap getting put in .data instead of .bss.

git-svn-id: trunk@30233 -
2015-03-15 12:10:54 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
8de49997ea * align compiler generated constants according to constant aligment settings
git-svn-id: trunk@29652 -
2015-02-08 11:23:01 +00:00
florian
632f43c490 * fix assembling with masm according to #25858
git-svn-id: trunk@29635 -
2015-02-05 21:22:39 +00:00
sergei
a67478e033 * Simplified, removed redundant asmlist and duplicate call to maybe_new_object_file.
git-svn-id: trunk@29509 -
2015-01-20 07:52:11 +00:00
svenbarth
b38fb606cc Fix for Mantis #27185.
ngenutil.pas:
  * AddToStructInits: also process the class constructors/destructors of nested types

+ added test

git-svn-id: trunk@29308 -
2014-12-21 14:01:32 +00:00
Jonas Maebe
37009c917b * pass alignment to tnodeutils.insertbsssym()
git-svn-id: branches/hlcgllvm@28751 -
2014-10-06 20:53:14 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
svenbarth
4a0d27ebfe Fix for Mantis #26271: Don't trash local variables that are used for the Default() intrinsic.
* ngenutil.pas, tnodeutils.trashable_sym:
    check for vo_is_default_var flag and don't consider such as trashable

+ added test

git-svn-id: trunk@27872 -
2014-06-06 13:59:52 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
Jonas Maebe
b57c95043f + support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
   o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
     class
   o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
     class from the base classes, and initialises the c*def/c*sym classes with
     them. This is done so that the llvm target will be able to derive from
     the tcpu*def/sym classes without umpteen ifdefs, and it also means that
     the WPO can devirtualise everything because the c* variables are only
     initialised with one class type
   o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
     calls

git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
nickysn
5242ed7864 * changed TResStrInitTable.Count and TWStrInitTablesTable.Count to nativeint
git-svn-id: trunk@26921 -
2014-03-02 13:27:59 +00:00
nickysn
73e6ffe675 * the TableCount and InitCount fields in the INITFINAL table changed to
nativeint (generates smaller and more efficient code on i8086)

git-svn-id: trunk@26913 -
2014-03-01 14:33:10 +00:00
florian
15df4a4f80 + support iso pascal like program parameters in iso mode
git-svn-id: trunk@26437 -
2014-01-12 20:17:51 +00:00
Jonas Maebe
aa5823a454 * factored out inserting a single bss symbol in ngenutil so it can be
overridden by the llvm target
  * override a bunch of other ngenutil methods with empty stubs for things
    that are not yet supported when targeting llvm

git-svn-id: branches/hlcgllvm@26051 -
2013-11-11 11:16:13 +00:00
Jonas Maebe
a14ceba791 + -CTinitlocals switch for the JVM that initialises all local variables
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 -
2013-08-29 22:21:23 +00:00
nickysn
e4f84b0f5d * i8086 medium model fixes in tnodeutils.InsertResourceTablesTable
git-svn-id: trunk@25290 -
2013-08-18 20:37:18 +00:00
nickysn
10db067372 * specify Tasmsymtype=AT_FUNCTION and use Create_nil_codeptr when generating the code pointers in the InitFinal table
git-svn-id: trunk@25286 -
2013-08-18 18:27:48 +00:00
svenbarth
ff3bb9322a Fix for Mantis #24848.
ngenutil.pas, AddToStructsInit:
  * don't add class constructors/destructors to the init table if they belong to a generic type

+ test

git-svn-id: trunk@25234 -
2013-08-11 11:20:12 +00:00
florian
380bc56e32 + create a default heap on embedded targets and register this default heap
* sysutils for the embedded target depends on a working heap manager

git-svn-id: trunk@23853 -
2013-03-16 10:37:18 +00:00
paul
5d74e0578a compiler: remove unused variables and unneeded assignments
git-svn-id: trunk@23467 -
2013-01-21 01:24:36 +00:00
sergei
1116bc3542 * Fixed incorrect condition (a linked list always has at least one dummy element) which was causing every unit to have a threadvar table, regardless of actual presence of threadvars. For units without code, this was causing creation of .o files which aren't necessary otherwise.
git-svn-id: trunk@23201 -
2012-12-21 14:13:30 +00:00
Jonas Maebe
289486346b * factored out code to decide when an asmsym for a staticvarsym has to be
global, and no longer make it global for all symbols when smartlinking
    is enabled on systems that use section-based smartlinking

git-svn-id: trunk@22241 -
2012-08-25 15:12:39 +00:00
Jonas Maebe
baa8fa39a8 * converted code to trash variables (-gt) to operate at the node tree level,
and also use this code to trash local variables in inlined routines
   o fixes mantis #22088
   o makes it possible to also implement it for the jvm target in the future

git-svn-id: trunk@21393 -
2012-05-26 11:32:39 +00:00
Jonas Maebe
834026bfb5 * synchronised with trunk up to r21067
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
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 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
40cf2cefa0 * when the user calls initialize(), force initialization to happen on the
JVM platform (normally it's not necessary because all types are
    automatically initialized)

git-svn-id: branches/jvmbackend@18672 -
2011-08-20 08:23:16 +00:00
Jonas Maebe
13b0ac91d9 + generate java.lang.Enum descendant classes for Pascal enum types
o these classes get an "enum" flag in the class files
   o these classes get a class field (whose type is that same enum
     class) per enum in the type, which also gets the "enum" flag
   o those class fields are initialised in the class constructor
     with the name of the enum and their order in the declaration
   o if the enum has jumps in FPC (lowest value is not 0, or not
     all values are contiguous), then we add an extra field
     to hold the FPC ordinal value of the enum
   o these classes get a class field valled $VALUES that contains
     a reference to the aforementioned class fields in order of
     declaration (= ordinal->instance mapping, JDK-mandated)
   o apart from the JDK-mandated instance methods (values, valueOf),
     also add FPCOrdinal (returns FPC ordinal value; same as order
     of declaration in case of no jumps) instance method and FPCValueOf
     (returns enum corresponding to FPC ordinal value) static class
     method
   o the mapping between FPC ordinals and enum instances in case of
     jumps is stored in a hashmap whose size is the next prime number
     greater or equal than the number of enum elements
   o moved several extra JDK types to the system unit for the enum
     support, and for future boxing and Java set support
   o several new synthetic method identifiers to generate the enum class
     methods/constructor/class constructor
   o enums with jumps are ordered by FPC ordinal value in the JVM
     $VALUES array so that the java.lang.Enum.doCompare() method
     will properly compare them

git-svn-id: branches/jvmbackend@18616 -
2011-08-20 08:15:28 +00:00
Jonas Maebe
e9e72e6de0 * fixed copyright date
git-svn-id: branches/jvmbackend@18581 -
2011-08-20 08:12:24 +00:00