Commit Graph

91 Commits

Author SHA1 Message Date
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
b931f78b4b * insert a type conversion from ordinal to pointer for pointerconstn
git-svn-id: branches/hlcgllvm@30129 -
2015-03-07 21:44:01 +00:00
Jonas Maebe
9c42437326 * moved tasmlisttypedconstbuilder.tc_emit_string_offset() to
ttai_typedconstbuilder.emit_string_offset() so it can also be used outside
    the context of parsing a Pascal-level typed constant

git-svn-id: branches/hlcgllvm@30111 -
2015-03-06 19:45:04 +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
461821d1a5 * read array initializations in generic subroutines without fixed limits, resolves #25602
git-svn-id: trunk@29598 -
2015-02-01 17:09:00 +00:00
Károly Balogh
37cf157d7d initialize pd to fix a warning with O3+
git-svn-id: trunk@29518 -
2015-01-22 12:07:50 +00:00
Jonas Maebe
146e3bcb9e * synchronised with trunk till r29513
git-svn-id: branches/blocks@29516 -
2015-01-21 23:28:34 +00:00
Jonas Maebe
e97f31541e - reverted partial commit of merge
git-svn-id: branches/blocks@29515 -
2015-01-21 23:24:37 +00:00
Jonas Maebe
a76bbf363d * synchronised with trunk r29513
git-svn-id: branches/blocks@29514 -
2015-01-21 23:18:29 +00:00
sergei
6708b83a16 * Refactor tasmlisttypedconstbuilder so it emits string/PChar data, if any, into a second asmlist, instead of appending it directly to global asmlist.
git-svn-id: trunk@29513 -
2015-01-20 15:14:38 +00:00
Jonas Maebe
634d2931e2 * use ttai_typedconstbuilder.emit_ord_const() when emitting ordinal constants
git-svn-id: branches/hlcgllvm@28776 -
2014-10-06 20:54:20 +00:00
Jonas Maebe
e07933212b * factored out emitting a guid const
git-svn-id: branches/hlcgllvm@28773 -
2014-10-06 20:54:12 +00:00
Jonas Maebe
5a9b931e5c * renamed ttai_lowleveltypedconstbuilder to ttai_typedconstbuilder
git-svn-id: branches/hlcgllvm@28764 -
2014-10-06 20:53:49 +00:00
Jonas Maebe
d2b55b6f07 * moved the recording of aggregate type information during typed constant
parsing from nllvmtcon to aasmcnst
   o added automatic insertion of padding bytes when fields need to be aligned,
     so that once ncgvmt (and hopefully ncgrtti) are converted to the typed
     constant builder class, we can get rid of all the explicit alignment
     directives (only supported for non-bitpacked records for now)

git-svn-id: branches/hlcgllvm@28763 -
2014-10-06 20:53:46 +00:00
Jonas Maebe
bdfb6d81e5 * don't emit padding bytes if there was an error parsing a typed constant
record

git-svn-id: branches/hlcgllvm@28758 -
2014-10-06 20:53:33 +00:00
Jonas Maebe
210b532832 * split up specifying the type of the section of a typed constant and whether
it should be put in a new section

git-svn-id: branches/hlcgllvm@28753 -
2014-10-06 20:53:20 +00:00
sergei
d88e0df1ba * Fixed another case of emitting data without defining a section. Mantis #26473.
git-svn-id: trunk@28730 -
2014-10-03 11:19:25 +00:00
Jonas Maebe
d26e6278ba * don't free node before using its resultdef in an error message
git-svn-id: trunk@28699 -
2014-09-20 23:08:22 +00:00
Jonas Maebe
9e074d036b * migrated the handling of ansi/unicodestring constants to the high level
typed constant builder + llvm implementation

git-svn-id: branches/hlcgllvm@28327 -
2014-08-06 18:04:40 +00:00
Jonas Maebe
bd09b88a5b + support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
o blocks are implemented as a variation of procedure variables
   o declaration of a block variable: "test: procedure(c: char) is block;"
     (C equivalent: (void)(^test)(char c) )
   o the compiler automatically converts procedures/functions whose address
     is passed to a block parameter or assigned to a block variable into
     a "block". This consists of
    1) generating a block descriptor (containing the size of the "block
       literal" (see below) and the signature of the invocation function
       encoded as an Objective-C selector)
    2) generating a wrapper function around the original funcion (with C
       calling convention), that has an extra first hidden parameter
       (marked as vo_is_parentfp in the compiler) whose type is a pointer
       to the describing "block literal"
    3) generating the "block literal", which contains a pointer to an
       external variable indicating whether this block captures context or
       not, some flags (see compiler/blockutl.get_block_literal_flags for
       info), a pointer to the wrapper function and a pointer to the
       descriptor. In the future, it will also contain captured variables.
   o right now, only global procedures/functions can be converted to blocks
     (because they don't require state capturing). The next steps are (Object
     Pascal) methods (not Objective-C methods, because Objective-C method
     procvars don't exist) and finally nested functions
   o on Mac OS X, the functionality will only work on Mac OS X 10.7 and later,
     because we have to use the so-called "ABI.2010.3.16" to ensure that
     our blocks aren't called as variadic functions by the runtime (which
     came out after the Mac OS X 10.6 release)
   o while the currently implemented functionality does not require any
     library support at all, there's no use enabling it on other platforms
     because unless it has been confirmed to work with a blocks runtime,
     there's no point in using blocks (they're just somewhat bulky procvars
     right now). Enabling it on other platforms (in combination with the
     GNUStep Objective-C run time), should simply be a matter of adding
     the right {$linklib xxx} statement to rtl/inc/blockrtl.pp file, adding
     that file to Makefile.fpc for that platform and adding that platform
     to the compiler/systems.systems_blocks_supported set

git-svn-id: branches/blocks@28232 -
2014-07-18 09:15:22 +00:00
Jonas Maebe
063d50b4c9 * make the string data of p(wide)char string constants local (except when
using library-based smartlinking), as it is not exported

git-svn-id: branches/hlcgllvm@28167 -
2014-07-05 15:44:26 +00:00
Jonas Maebe
b94a524556 * converted emitting pwidechar typed constants to the typed constant builder
git-svn-id: branches/hlcgllvm@28141 -
2014-07-03 22:28:25 +00:00
Jonas Maebe
2d335baab8 * create only a single tai_string for shortstrings typed constants
whose type length is larger than the specified string
  * corrected place of ftcb.maybe_end_aggregate() call

git-svn-id: branches/hlcgllvm@28134 -
2014-07-02 17:24:56 +00:00
Jonas Maebe
6c45f9b3ee * converted most of the asmlist-based typed const parsing to use the new
typed const builder class

git-svn-id: branches/hlcgllvm@28118 -
2014-07-01 16:30:40 +00:00
Jonas Maebe
b0ff41406a * grouped all tai_real* types into a single tai_realconst type,
to free up space for more ait_* types in taitype (can't have
    more than 32 because they have to fit in a small set)
   o factored out writing of floating point numbers as an array of
     byte in the external assemblers

git-svn-id: branches/hlcgllvm@28105 -
2014-07-01 16:29:58 +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
nickysn
4832682c58 * fixed i8086 far pointer typed constants that are initialized with nil
git-svn-id: trunk@27458 -
2014-04-03 21:39:00 +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
ffd6a4ea47 * set the code page of rawbytestring typed constants to the same value as
when assigning a string constant to a rawbytestring (system code page with
    {$modeswitch systemcodepage}, CP_ACP without) (mantis #25332)

git-svn-id: trunk@26397 -
2014-01-05 18:26:10 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
svenbarth
798bb91e90 Extract tdef.is_related plus its overrides in tobjectdef, trecorddef and tstringdef into a new function def_is_related in unit defcmp.
defcmp.pas:
  + add new function "def_is_related" which combines the "is_related" overloads of "tobjectdef", "trecorddef" and "tstringdef" (it returns "false" for other def types which is what "tdef.is_related" did)
  * compare_defs_ext & compatible_childmethod_resultdef: change call from "x.is_related" to "def_is_related(x,...)"
symtype.pas, tdef:
  - remove "is_related" method
symdef.pas:
  - remove "is_related" in "tobjectdef", "trecorddef" and "tstringdef"
  * tobjectdef.needs_inittable: for checking whether a Corba interface somehow inherits from a IInterface don't use "is_related" anymore (we want to avoid the dependency after all), but mimic the necessary functionality of "def_is_related"
htypechk.pas, nadd.pas, ncal.pas, ncnv.pas, ngtcon.pas, nld.pas, optvirt.pas, pdecobj.pas, pdecvar.pas, pexpr.pas, pgenutil.pas:
  * change call from "x.is_related" to "def_is_related(x,...)"
symtable.pas
  + use unit defcmp
  * change call from "x.is_related" to "def_is_related(x,...)"
jvm/njvmcnv.pas, jvm/njvmflw.pas:
  * change call from "x.is_related" to "def_is_related(x,...)"

git-svn-id: trunk@25847 -
2013-10-25 19:44:27 +00:00
nickysn
7ff97d9b7d * specify AT_DATA when refering to the 'RESSTR' symbols; among other things,
this fixes resourcestring constants in the i8086 memory model.

git-svn-id: trunk@25796 -
2013-10-15 22:06:16 +00:00
nickysn
bf07fc077b * specify AT_DATA in all references to the tobjectdef.vmt_mangledname symbol.
This fixes a lot of bugs, related to objects and classes in the i8086 medium
  memory model

git-svn-id: trunk@25794 -
2013-10-15 18:56:27 +00:00
Jonas Maebe
11d5d4f79d * check range of enums and booleans in typed constant expressions when
using the asmlist generator (mantis #24428)

git-svn-id: trunk@24495 -
2013-05-14 12:05:00 +00:00
Jonas Maebe
eb7e192226 * support pointer constants as initialisation values for procvar typed
constants in Delphi mode on non-treetypedconstbuilder platforms
    (mantis #21267)

git-svn-id: trunk@21344 -
2012-05-20 14:51:15 +00:00
Jonas Maebe
8282d6e37a * do not create a global symbol in the middle of ansi/unicodestring
constants on Darwin, because its linker uses global symbols as delimiters
    of subsections for dead code stripping. This was previously solved by
    never making any ansistring constants smart linkable, which is now
    solved

git-svn-id: trunk@21328 -
2012-05-19 10:19:35 +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
27c004807f * typecast the indices generated for array constants in the node-based
typed constant parser to the rangedef of the array (can be an enum,
    char, etc)

git-svn-id: branches/jvmbackend@18743 -
2011-08-20 08:31:41 +00:00
Jonas Maebe
51095fdd28 * make it possible to override parts of the typed constant code generation
by platform-specific units

git-svn-id: branches/jvmbackend@18658 -
2011-08-20 08:21:59 +00:00
Jonas Maebe
402390a25d * same extension as other files
git-svn-id: branches/jvmbackend@18657 -
2011-08-20 08:21:54 +00:00