cases (that depend on the sizes of the typecast matching) so that we
can (internally) generate typecasts to open array/array of const
git-svn-id: trunk@29819 -
second_int_to_bool() and second_bool_to_int() for certain cases, do the
same for their first_*() variants in first_bool_to_bool() so that the
expectloc is correctly initialised
o since first_int_to_bool can now be called for bool_to_bool to, make
sure we correctly handle is_boolean(left.resultdef) in that case
(integers cast to a smaller boolean type ignore the upper bits,
while with boolean to boolean they are taken into account
git-svn-id: branches/hlcgllvm@28369 -
procvar in the local state of the block, and then call it insde the
generated invoke routine. We can't call it directly there, because
due to visibility reasons it may not be accessible from a regular
procedure (e.g. if it is a strict private method)
git-svn-id: branches/blocks@28234 -
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 -
o made all (non-abstract) tdef and tsym constructors virtual
o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
class
o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
class from the base classes, and initialises the c*def/c*sym classes with
them. This is done so that the llvm target will be able to derive from
the tcpu*def/sym classes without umpteen ifdefs, and it also means that
the WPO can devirtualise everything because the c* variables are only
initialised with one class type
o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
calls
git-svn-id: trunk@27361 -
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 -
defcmp.pas:
+ add function "find_implemented_interface"
* change method call of "find_implemented_interface" into function call
symdef.pas:
- tobjectdef: remove method "find_implemented_interface"
- remove use of unit "defcmp"
pgenutil.pas:
* change method call of "find_implemented_interface" into function call
+ add use of unit "defcmp"
ncgcnv.pas, ncnv.pas, pdecobj.pas, pdecsub.pas, pdecvar.pas:
* change method call of "find_implemented_interface" into function call
git-svn-id: trunk@25844 -
* Provide x86_64 SSE versions of fpc_trunc_real and fpc_round_real, strictly they are not necessary after the above change to code generation, but it still reduces size of system unit by avoiding compilation of related generic code.
git-svn-id: trunk@25735 -
because the compiler cannot convert arbitrary unicodechar constants at
compile time to a shortstring (since it doesn't know the code page to use)
(test part of next commit)
git-svn-id: branches/cpstrrtl@25429 -
the other fpc_(u)char_to_*str() routines (exception dates back to the
time calls to these routines were still inserted "manually" in the
compiler). Fixes the compilation of "shortstr:=widecharconstant" after
r23613 and simplifies other code calling this helper + test
git-svn-id: branches/cpstrrtl@25428 -
type with a non-default code page
TODO: ensure that string constants typecasted to ansistring become
ansistrings rather than typeless string constants
git-svn-id: trunk@25207 -