a code and temp generator for the architectural target instead of for LLVM
* write the code for pure assembler routines using a GNU-style external
assembler writer for the target, with a decorator to wrap it in
LLVM module-level assembly statements
git-svn-id: trunk@31633 -
defined) or a declaration (external symbol), instead of deriving it from
from the bind of the tasmsymbol. The reason is that with module-level
inline assembly, some locally implemented functions (in pure assembler)
won't have an LLVM IR body
git-svn-id: trunk@31629 -
intrinsic. This may insert actual calls to a function called memcpy with
the signature of the libc function, but llvm optimizers are free to
insert such calls by themselves already. This means that for non-libc
targets, we will have to add weak symbols for memcpy/memmove/memset
that call through to move/fillchar when using LLVM, so that these
implementation are used when not linking to libc
git-svn-id: trunk@31408 -
o all external symbol definitions are now inserted in the llvmtype post pass
based on all declarations and types used in llvm instructions
o this means we don't have to use the workaround with the Pascal mangled
names anymore for all external names, as we now insert the external
references only once we know all type information
git-svn-id: trunk@31287 -
interface of a unit, or forward declared, and then the implementation turns
out to be external. We now properly generate a wrapper routine at the
Pascal level for the original declaration that calls through to the
external routine
git-svn-id: trunk@31285 -
a single external symbol may be used with multiple declarations that
have different types:
o always declare an alias with the Pascal-mangled name that aliases the
external symbol, with the type of that Pascal declaration
o if the external symbol is not actually external but in the same unit,
we will determine the type of that symbol via its declaration and
insert type conversions in the alias declarations in case they use a
different type
o if it is external (so there is no declaration from which we can determine
its real type) and there are nevertheless multiple aliases for it with
different types, we just take the type of the first alias and insert
type conversions for the other aliases. LLVM will take care of the
conflicting types in multiple modules when performing WPO if necessary
git-svn-id: trunk@31054 -
gen_load_para_value(), as this may be different depending on
the calling conventions
* adapt llvm's gen_load_cgpara_loc() to use this passed def rather
than hardcoding the para's def (although these will normally match)
git-svn-id: trunk@31050 -
as an alias for the old one (rather than creating an interprocedural
jump, which is not possible in llvm IR and which is less efficient
anyway) (declaration for this method was already accidentally committed
in r30722)
git-svn-id: trunk@30777 -
because due to aliasing symbols a single symbol may be called using
different procdefs (e.g. FPC_ANSISTR_UNIQUE in the system unit is defined
as an alias for a function and called as a procedure). This means we have
to insert extra type conversions for llvm, which requires both the source
and destination type
git-svn-id: trunk@30776 -
assembler function, as the inline assembly code itself will be
responsible for returning the function result (we will have to add
the "return" instruction to it) while llvm requires a terminator
at the end of the function and it must return something
git-svn-id: trunk@30671 -
o results in simpler code, and more importantly is required for some code
that expects a LOC_REGISTER after calling certain system unit helpers
(e.g. in ncgutil.new_exception)
git-svn-id: branches/hlcgllvm@28375 -
o there are no cpu registers on the llvm target, but generic code may still
occasionally allocate them via the generic routines in case of e.g. a
hardcoded use of a function return register
git-svn-id: branches/hlcgllvm@28373 -
have to emit the label we originally allocated for the fallthrough path (otherwise
the branch is not inverted at all, and moreover the caller will also emit the
original target label somewhere so it will be doubly defined)
git-svn-id: branches/hlcgllvm@28367 -
convert one def to another, including information regarding whether
it should be done via an intermediate integer typecast
* use this routine in hlcgllvm
git-svn-id: branches/hlcgllvm@28116 -
typed constant data
o llvm declarations now get an extra "initdata" list that contains the
typed constant data associated with this declaration (if any)
git-svn-id: branches/hlcgllvm@28111 -
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 -
generate declarations when external symbols are referred in a taillvm
instruction
* added "declared" field to tasmsymbol for llvm to make avoid declaring a
symbol multiple times (harmless, but unnecessary)
* all kinds of declarations/definitions are now handled using the new
taillvmdecl, the old separate types have been removed
git-svn-id: branches/hlcgllvm@27010 -
destination types are different: the pointer types of the load/store must
be converted in that case, rather than the loaded/to be stored value
(you can't bitcast aggregates in LLVM)
git-svn-id: branches/hlcgllvm@26987 -
fpu: treat them as extended when they are loaded into registers, and as
int64 when loading from/storing to memory
git-svn-id: branches/hlcgllvm@26048 -