Commit Graph

14 Commits

Author SHA1 Message Date
Jonas Maebe
d39db60934 * initialise the llvmvalueloc field for LOC_VOID locations, so they don't
get randomly passed as either byval or not (while they don't contain any
    data and hence this can't cause bugs in the generated code, it can cause
    signature mismatches in llvm)

git-svn-id: trunk@34956 -
2016-11-24 08:57:09 +00:00
Jonas Maebe
280a6e15b7 * fixed invalid memory reads and potential double freeing when removing
superfluous temporary paralocs for llvm

git-svn-id: trunk@34955 -
2016-11-24 08:57:05 +00:00
Jonas Maebe
8760a6fbf8 * set shiftval to 0 if we convert a reference to a register paraloc,
as the reference overlaid the shiftval field and hence it could
    have any value

git-svn-id: trunk@34303 -
2016-08-13 14:47:44 +00:00
Jonas Maebe
7ebbb744e9 * also specify sret attribute at the caller side
git-svn-id: trunk@34302 -
2016-08-13 14:47:42 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
Jonas Maebe
698ca04d90 * reset shiftval when transforming a paraloc into an llvm paraloc
git-svn-id: trunk@32690 -
2015-12-20 21:08:56 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
Jonas Maebe
94aadb23ab + implemented getintparaloc() for llvm
git-svn-id: trunk@30430 -
2015-04-04 14:29:19 +00:00
Jonas Maebe
39fa81eaa0 * fixed passing of C-style varargs parameters
git-svn-id: branches/hlcgllvm@28357 -
2014-08-10 13:19:29 +00:00
Jonas Maebe
39074edf10 - removed the globalsymbolmangleprefix/suffix constants that were added for
llvm
  * instead, add LLVM-specific name mangling based on the asmsymbol's bind
    and typ whenever we write out its name

git-svn-id: branches/hlcgllvm@28166 -
2014-07-05 15:44:16 +00:00
Jonas Maebe
6dcfd73d21 + support for a_call_name() on the llvm target:
o make use of the fact that callparanodes always first load everything
     in temporary parameters (allocated via paramanager.createtempparaloc)
     -> we pass those temporary paralocs to the llvm call nodes and ignore
     the "real" locations with physical registers
   o all function results are forced to memory before handing them back
     to the generic code generator to avoid having to deal with special
     result locations and llvm<->pascal type differences (llvm removes
     the extra temp stores/loads while optimising)
   o ideally, the llvm code generator should share the common code with
      the generic code generator for a_load_ref_cgpara() at some point in
      the future

git-svn-id: branches/hlcgllvm@27013 -
2014-03-06 21:42:14 +00:00
Jonas Maebe
02ca215272 * reworked and fixed llvm procdef handling (except for variadic C functions):
o handle parameters and function results divided over multiple paralocs,
     including generating fake recorddefs that represent
   o fixed zero/sign extension handling
   o properly handle difference between procdefs as printed for the
    implementation, an alias declaration or a procvar definition

git-svn-id: branches/hlcgllvm@27009 -
2014-03-06 21:42:00 +00:00
Jonas Maebe
8ede313ba1 + llvm parameter manager: it reuses the native parameter manager to create
the paraloc information, and then adds llvm-specific information to the
    paralocs
   o only partially implemented, in particular function result handling is
     not yet there

git-svn-id: branches/hlcgllvm@26040 -
2013-11-11 11:15:31 +00:00