Commit Graph

42489 Commits

Author SHA1 Message Date
Jonas Maebe
0283670041 * set location.size if we handle a subscript access in
handle_platform_subscript()

git-svn-id: branches/hlcgllvm@27136 -
2014-03-14 18:22:12 +00:00
Jonas Maebe
d3c11ca8b3 + support for MMREGISTER -> FPUREGISTER transfers in hlcgobj
git-svn-id: branches/hlcgllvm@27018 -
2014-03-06 21:42:31 +00:00
Jonas Maebe
482eb86047 - disabled can_call_ref() for llvm
git-svn-id: branches/hlcgllvm@27017 -
2014-03-06 21:42:27 +00:00
Jonas Maebe
2cb84bda6e * generate integer type definitions for smallsets
git-svn-id: branches/hlcgllvm@27016 -
2014-03-06 21:42:24 +00:00
Jonas Maebe
7d61ecf5ba * changed shortstring llvm representation to a plain array of bytes, so
it can be directly indexed rather than that we need to separately
    select the byte or data (just like at the Pascal level, and how it
    is/will be handled in the code generator)

git-svn-id: branches/hlcgllvm@27015 -
2014-03-06 21:42:21 +00:00
Jonas Maebe
0fd172ddf6 * ignore global labels with a comment for now, they're generated for
function symbol aliases

git-svn-id: branches/hlcgllvm@27014 -
2014-03-06 21:42:17 +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
bdc2aaec47 * fixed ansistring and unicodestring llvm defs (pointer indirection was
missing, and replaced by plain pointer because the array definition does
    not add any useful information)

git-svn-id: branches/hlcgllvm@27012 -
2014-03-06 21:42:10 +00:00
Jonas Maebe
f36848c243 * separate virtual method for loading the function result para (needed by
llvm)

git-svn-id: branches/hlcgllvm@27011 -
2014-03-06 21:42:07 +00:00
Jonas Maebe
b82053ef40 * reworked handling of defined/declared symbols in llvm: we now automatically
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 -
2014-03-06 21:42:03 +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
dad45d63b1 * improved symbol alias handling (pass in old sym instead of name, add
pointer add end of aliased procdef)

git-svn-id: branches/hlcgllvm@27008 -
2014-03-06 21:41:56 +00:00
Jonas Maebe
abee66b611 * optimized a_loadaddr_ref_reg() in cases where an offset is added to a
symbol or base register and the offset is a multiple of the def's size

git-svn-id: branches/hlcgllvm@27007 -
2014-03-06 21:41:53 +00:00
Jonas Maebe
c4869980e8 * fixed typo in comment
git-svn-id: branches/hlcgllvm@27006 -
2014-03-06 21:41:50 +00:00
Jonas Maebe
358b346bbc * fixed writing of constant operands outside the longint range
git-svn-id: branches/hlcgllvm@27005 -
2014-03-06 21:41:46 +00:00
Jonas Maebe
161647f965 * simplified (incomplete) implementation of g_concatcopy() that simply calls
a_load_ref_ref (the llvm memcpy intrinsic can be lowered into a libc call,
    so we can't use it)

git-svn-id: branches/hlcgllvm@27004 -
2014-03-06 21:41:43 +00:00
Jonas Maebe
366baac98d * optimized version of a_load_ref_ref() in case the source has refaddr_full
(= "named register" in case of llvm)

git-svn-id: branches/hlcgllvm@27003 -
2014-03-06 21:41:40 +00:00
Jonas Maebe
fcbde1d6e9 + hlcg/llvm support for unary minus
o converted tcgunaryminusnode.emit_float_sign_change() to use a tdef instead
     of tcgsize

git-svn-id: branches/hlcgllvm@27002 -
2014-03-06 21:41:36 +00:00
Jonas Maebe
227ff0ea48 * llvm requires that single precision constants are exactly representable
using single precision -> convert them to single precision in the code
    generator

git-svn-id: branches/hlcgllvm@27001 -
2014-03-06 21:41:32 +00:00
Jonas Maebe
cdfb23bf6c * converted some leftovers in tcgtypeconvnode.second_int_to_int/
second_real_to_real to thlcgobj
  + added type conversion to second_pointer_to_array for llvm

git-svn-id: branches/hlcgllvm@27000 -
2014-03-06 21:41:27 +00:00
Jonas Maebe
8cc9b64ad7 * don't discard typeconversion nodes that only change the result type when
compiling for llvm, because this type change also needs to be modelled in
    llvm IR

git-svn-id: branches/hlcgllvm@26999 -
2014-03-06 21:41:24 +00:00
Jonas Maebe
5e79789f9e + dummy mmregister allocator for platforms that use such registers
git-svn-id: branches/hlcgllvm@26998 -
2014-03-06 21:41:19 +00:00
Jonas Maebe
bc0d4bbc87 + support second_cmpfloat (just call through to second_addfloat, where the
comparisons are already implemented)

git-svn-id: branches/hlcgllvm@26997 -
2014-03-06 21:41:16 +00:00
Jonas Maebe
752b6739a8 * properly handle address and temp registers in return locations
git-svn-id: branches/hlcgllvm@26996 -
2014-03-06 21:41:12 +00:00
Jonas Maebe
6b7ed0234c + new globalsymbolmangleprefix/suffix constant set to '@"\01' resp. '"'
for llvm, and empty for other targets:
   o the '@' is required to mark a global/static symbol identifier in llvm
   o the double quotes are required in case special characters are involved
   o the \01 means that the name should not be mangled by llvm (e.g., by
     default it still adds the C-prefix to all symbol names, and replaces
     some special characters with alternatives)
  * apply this prefix/suffix in all name mangling routines

git-svn-id: branches/hlcgllvm@26995 -
2014-03-06 21:41:09 +00:00
Jonas Maebe
41a53ef037 * don't replace some pointer types in paralocs with int64, gives nicer
results in llvm (fewer needless pointer -> int -> pointer conversions)

git-svn-id: branches/hlcgllvm@26994 -
2014-03-06 21:41:04 +00:00
Jonas Maebe
68fa17593d * no longer associated defs with size 1 to 3 bytes with paralocs, because
gcc and clang always allocate them in multiple of 4 bytes too (except in
    case of _Bool, which is 1 byte -> do the same for PasBool) and this is
    one possible interpretation of the ABI. This also frees us from having to
    perform special adjustments afterwards to ensure that smaller values are
    sign/zero-extended to 32 bits

git-svn-id: branches/hlcgllvm@26993 -
2014-03-06 21:41:00 +00:00
Jonas Maebe
81427523ab * pass a list of (pointers to) the paralocs to hlcgobj.a_call/g_call*, as
required for the LLVM support (LLVM parameter support is not yet
    included)
  * always return the function return loc from a_call*, again as required
    for the LLVM support

git-svn-id: branches/hlcgllvm@26992 -
2014-03-06 21:40:57 +00:00
Jonas Maebe
532d623be7 + support for encoding records/objectdefs in LLVM-speak
git-svn-id: branches/hlcgllvm@26991 -
2014-03-06 21:40:52 +00:00
Jonas Maebe
20a8175bf1 + support for subscript nodes in LLVM
git-svn-id: branches/hlcgllvm@26990 -
2014-03-06 21:40:49 +00:00
Jonas Maebe
e70175a10e * added extra boolean parameter to getelementptr taillvm constructors to
indicate whether or not an implicit indirection should be added (always
    was done until now)

git-svn-id: branches/hlcgllvm@26989 -
2014-03-06 21:40:46 +00:00
Jonas Maebe
cefcb856b6 + code from the old llvm branch to create a "shadow symtable" for records
that contains their mapping to LLVM (mainly getting rid of variant parts
    and adding explicit padding when not using {$packrecords c})

git-svn-id: branches/hlcgllvm@26988 -
2014-03-06 21:40:43 +00:00
Jonas Maebe
98be5b0825 * correctly handle loads/stores of aggregate types if the source and
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 -
2014-03-06 21:40:39 +00:00
Jonas Maebe
43e0eb3cfd + llvmaggregatetype() helper that returns whether a def is represented by an
aggregate type in llvm

git-svn-id: branches/hlcgllvm@26986 -
2014-03-06 21:40:36 +00:00
Jonas Maebe
f344adaf22 * the first parameter of loadaddr_ref_reg has to be converted to a pointer
(it's the type of the data stored in memory at that address, but we use
     the address itself here)

git-svn-id: branches/hlcgllvm@26985 -
2014-03-06 21:40:32 +00:00
Jonas Maebe
9902864cce * don't output alignments for reference operands to bitcast & co
git-svn-id: branches/hlcgllvm@26984 -
2014-03-06 21:40:29 +00:00
Jonas Maebe
f629f38bbc - removed unused local variable
git-svn-id: branches/hlcgllvm@26983 -
2014-03-06 21:40:25 +00:00
Jonas Maebe
9c674ff444 * made internalerror unique
git-svn-id: branches/hlcgllvm@26982 -
2014-03-06 21:40:21 +00:00
Jonas Maebe
c2c7f753a8 * don't hardcode the bitsize of the register states
git-svn-id: branches/hlcgllvm@26981 -
2014-03-06 21:40:18 +00:00
Jonas Maebe
839ad45b9e * ensure that the lineinfo of temps corresponds to the lineinfo of the
procedure entry code

git-svn-id: branches/hlcgllvm@26980 -
2014-03-06 21:40:15 +00:00
Jonas Maebe
c095a1b06a * also check regtype in get_spill_temp()
git-svn-id: branches/hlcgllvm@26979 -
2014-03-06 21:40:12 +00:00
Jonas Maebe
a6a72e210c * fixed typo in comment
git-svn-id: branches/hlcgllvm@26978 -
2014-03-06 21:40:08 +00:00
Jonas Maebe
672c96a811 * write elements of bitpacked arrays grouped per the number of bits that
will be used to load them afterwards instead of always per byte so we
    can use that loadsize as the array element type in llvm declarations
    (-> less casting required)

git-svn-id: branches/hlcgllvm@26977 -
2014-03-06 21:40:04 +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
Jonas Maebe
009c96a0bd * fixed setting up the global switch for main programs without a "program"
header on platforms not in systems_unit_program_exports

git-svn-id: trunk@26975 -
2014-03-06 18:41:03 +00:00
reiniero
2388575d3b fcl-db: export
* dbf export: default table format DBaseIV, set default autorename for fields to true

git-svn-id: trunk@26974 -
2014-03-06 18:16:47 +00:00
reiniero
7f22ae17ff fcl-db: cosmetic
git-svn-id: trunk@26973 -
2014-03-06 15:10:11 +00:00
reiniero
3478ca4672 fcld-db: dbase:
* Harden Visual FoxPro code: detect nil varbinary field source

git-svn-id: trunk@26972 -
2014-03-06 15:09:38 +00:00
reiniero
d0c93f4cd8 fcl-db: dbtestframework:
+ add Visual Foxpro export test

git-svn-id: trunk@26971 -
2014-03-06 14:38:36 +00:00
michael
77b771e91b * Let ToString return something meaningful for Exception
git-svn-id: trunk@26969 -
2014-03-06 13:34:40 +00:00