Commit Graph

29 Commits

Author SHA1 Message Date
pierre
23570bed33 Use same parameter type for update_reference_offset override
git-svn-id: trunk@40325 -
2018-11-16 13:26:56 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
Jonas Maebe
0311528502 * always write bitpacked typed constant arrays as a multiple of bytes rather
than of their loadsize, because otherwise if they are e.g. part of a record
    they would occupy more space than allowed
   o adapted llvm code to deal with the fact that bitpacked arrays are now
     always arrays of bytes rather than arrays of integers with the same size
     as their loadsize -- this also fixes several type inconsistencies
     detected by llvm

git-svn-id: trunk@34125 -
2016-07-14 15:23:07 +00:00
Jonas Maebe
8bc39ba7a3 * fixed bitpacked array index calculation for llvm: the element bitsize was
only used for masking out the bits of the loaded data, not for calculating
    the offset

git-svn-id: trunk@33957 -
2016-06-12 09:20:54 +00:00
Jonas Maebe
fad7c8f151 * fixed indexing dynamic arrays and strings with a constant index (the index
was ignored in this case)

git-svn-id: trunk@32741 -
2015-12-26 20:01:32 +00:00
Jonas Maebe
86b02cf76e * handle bitpacked ordinal fields whose size is a multiple of 8 bits the same
other bitpacked ordinal fields, since they can also start on a non-byte-
    aligned boundary

git-svn-id: trunk@32570 -
2015-12-02 22:24:04 +00:00
Jonas Maebe
8df979e5e8 * take into account the fact that bitpacked ordinal fields are all encoded
as bytes in the LLVM type, so typecast them to the correct type (which is
    the size that will be used by hlcg.a_load*subsetref*)

git-svn-id: trunk@32565 -
2015-12-01 21:52:23 +00:00
Jonas Maebe
eaeb9d8351 * renamed thlcgobj.g_set_addr_nonbitpacked_record_field_ref() to
thlcgobj.g_set_addr_nonbitpacked_field_ref() and adjusted it so that
    it also works for objects/classes (if the incoming reference points
    to the start of the class contents)
   o factored out the related code from tllvmsubscriptnode

git-svn-id: trunk@32411 -
2015-11-21 12:37:01 +00:00
Jonas Maebe
54172d7de4 * fixed alignment of subscripts if the variant part of a record starts at a
non-zero offset from the reference field in the llvm version of the record

git-svn-id: trunk@31637 -
2015-09-12 23:32:46 +00:00
Jonas Maebe
f40ea04540 * changed getarraydef() into a tarraydef.getreusable() class method
git-svn-id: trunk@31147 -
2015-06-23 21:23: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
89c4bd8522 * index the llvm shadow symtable with a fieldvarsym rather than with the
index of the corresponding llvm fieldvar, as this index is a member
    of the fieldvarsym that only gets initialised once the llvm shadow
    symtable gets built, which in turn is triggered by trying to access
    it for the first time -> if fieldvarsym.llvmfieldnr got loaded by
    the compiler before evaluating the llvmst expression and if the
    llvmst hadn't been built yet, this llvmfieldnr was not yet initialized

git-svn-id: trunk@31060 -
2015-06-13 22:48:37 +00:00
Jonas Maebe
337716d413 * fixed subscripting classes in llvm
* fixed subscripting an objectdef in llvm if the field belongs to a
    parent type

git-svn-id: trunk@30957 -
2015-05-31 16:51:07 +00:00
Jonas Maebe
0d00c1a19d * fixed type used when subscripting implicit pointer types (don't add
another indirection)

git-svn-id: trunk@30953 -
2015-05-31 16:50:56 +00:00
Jonas Maebe
8034ef1f31 * support for dynamic strings and arrays in update_reference_reg_mul()
git-svn-id: trunk@30784 -
2015-05-03 16:51:13 +00:00
Jonas Maebe
864f9b24cc * handle indexing implicit pointer types on llvm
git-svn-id: trunk@30723 -
2015-04-25 15:51:39 +00:00
Jonas Maebe
98c5f7d20f * simplify references before generating getelementptr instructions with them
git-svn-id: trunk@30722 -
2015-04-25 15:51:36 +00:00
Jonas Maebe
03a3136525 * since extended values are represented as "array[1..10] of byte" in records
for llvm in order to ensure that it doesn't allocate the ABI-specified
    size, we have to convert the resulting pointer to an array of 10 bytes
    into a pointer to extended when we subscript the record (like is already
    done for arrays)

git-svn-id: trunk@30720 -
2015-04-25 15:51:30 +00:00
Jonas Maebe
6391794958 * fixed -Oodfa warnings
git-svn-id: trunk@30500 -
2015-04-08 19:08:39 +00:00
Jonas Maebe
5a2609933f * fixed crash in r30244 (we only have to get a new elementdef if we didn't
already initialise the location, and we won't get a new elementdef if
    the location is already assigned)

git-svn-id: branches/hlcgllvm@30346 -
2015-03-28 11:33:59 +00:00
Jonas Maebe
765044aede * fixed a number of (mostly false) warnings regarding uninitialised
variables with -Oodfa

git-svn-id: branches/hlcgllvm@30244 -
2015-03-15 21:10:50 +00:00
Jonas Maebe
0867b6e4f8 * added missing {$i fpcdefs.inc}
git-svn-id: branches/hlcgllvm@28378 -
2014-08-10 19:40:34 +00:00
Jonas Maebe
6ab2c00ac6 * recognise LOC_CREFERENCE in tllvmsubscriptnode.handle_platform_subscript()
git-svn-id: branches/hlcgllvm@28364 -
2014-08-10 19:39:58 +00:00
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
c4869980e8 * fixed typo in comment
git-svn-id: branches/hlcgllvm@27006 -
2014-03-06 21:41:50 +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
25fab5b0b6 + support for array vecnodes on the llvm target, both for regular and for
bitpacked arrays:
   o separate the element size from the index when constructing the memory
     references, so we can easily use the llvm getelementptr instruction
   o handle conversion of s80real values from their array declaration
     as array elements to floating point values when loading them

git-svn-id: branches/hlcgllvm@26050 -
2013-11-11 11:16:09 +00:00