symbol is defined
o removed all places where AB_INDIRECT symbols were explicitly generated
o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
o for some symbols an indirect symbol is always required (because they are
dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type
git-svn-id: trunk@34165 -
tasmdata.DefineAsmSymbol() and all routines that call it
o will be used to automatically generate AB_INDIRECT sybols when
necessary
git-svn-id: trunk@34164 -
Note: It needs to be checked what adjustments will need to be done for JVM and LLVM
Note 2: The indirect symbols will always be generated even if the target won't use them so that assembler code can be consistent among the targets (e.g. i386-win32 needs them while i386-linux does not)
ptconst.pas, read_typed_const:
* generate the indirect symbol in a read only data section
ngenutil.pas, tnodeutils:
* insertbsssym: generate the indirect symbol in a read only data section
git-svn-id: trunk@33279 -
global, and no longer make it global for all symbols when smartlinking
is enabled on systems that use section-based smartlinking
git-svn-id: trunk@22241 -
new ShortString->(Some)String precedence: ShortString, UTF8String, AnsiString, AnsiString(CodePage) and RawByteString, UnicodeString, WideString and other string types
new AnsiString->(Some)String precedence: RawByteString, UTF8String, AnsiString, AnsiString(CodePage), UnicodeString, WideString, ShortString and other string types
The new logic makes UTF8String more preferrable than other AnsiString types, AnsiString more preferrable than other AnsiStrings(codepage) and also makes UnicodeString more preferrable than WideString.
git-svn-id: trunk@21057 -
on AIX due to the extra inserted local symbols (although in case e.g
multiple procedures contain a typed constant with the same name, only
one can be accessible)
* removed '.' suffix of local symbols inserted for debug info of typed
constants for AIX (gdb couldn't find those symbols; it seems the
address calculated by gdb for typed constants is still not correct
though)
git-svn-id: trunk@20966 -
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 -
support the stabx as understood by gdb, which is a mixture of regular
stabs and stabx (e.g., class/object definitions are completely different
in real stabx). This means that gdb can be used to debug aix programs,
but the native dbx will complain about lots of debug information
constructs
git-svn-id: trunk@20842 -
* omit several error messages when in_generic is true because the error can be checked only during specialisation, resolves the issue reported in #21592
git-svn-id: trunk@20699 -
- add helper function getansistringcodepage which returns explicitly set codepage or 0 in other case
- add helper function getansistringdef which return a def with explicitly set codepage or cansistringtype in other case
- change tstoreddef.createnai constructor to allow set codepage in constructor
- don't convert string constants to rawbytestring. if string constant already has a codepage - preserve it or convert to ansistring codepage (delphi compatible)
- don't perform string conversion from ansistring to strings with explicitly set codepage (by directive or by compiler switch) and vice versa (delphi compatible)
+ test which covers most of the cases
git-svn-id: trunk@19510 -
* Patch from Inoussa:
* defcmp.pas
** ansistring to/from RawByteString are evaluated "te_equal"
** ansistring to UTF8string is evaluated (te_convert_l1,tc_string_2_string)
* ncnv.pas
** "ttypeconvnode.typecheck_char_to_string" : WideChar to AnsiString/ShortString
is possible if the source code page is not utf8
** "ttypeconvnode.typecheck_char_to_char" : WideChar to AnsiChar
is possible if the source code page is not utf8
* ncon.pas
** "tstringconstnode.changestringtype" : Unicode to utf8string bug fix(set the encoding),
constants in the source code with code page set utf8 should be converted back to utf8
* nopt.pas
** "genmultistringadd" : fpc_<stringname>_concat_multi have a new parameter "cp"
to indicate the "DestS" code page if the variable content is nil. This is required
in order not to loose the declared code page.
* pinline.pas
** "inline_setlength" : a new parameter "cp" to indicate the code page if the variable content
is nil. This is required in order not to loose the declared code page.
* ptconst.pas
** "parse_arraydef" : for string const to array of ansichar/widechar conversion check for wide string and
convert if it is required. For char const to array of ansichar/widechar conversion check for wide char and
convert if it is required.
git-svn-id: trunk@19113 -
assignment-nodes. For global typed constants and typed constants/
local variable initialisers in regular functions/procedurs, the
assignments are performed in the unit initialisation code. For
those in object/record definitions and their methods, it's done
in the class constructor. Since we may not yet have parsed all
method implementations when the class constructor is parsed, part
of these may be initialised in a helper routine called from the
class constructor. The ones known when the class constructor is
parsed are inited there, because the ones marked as "final" and
declared as static class fields must be initialised in the class
constructor for Java
o new set systems_typed_constants_node_init in systems unit that
indicates that a target uses node trees to initialise typed consts
instead of an initialised data section
o mark typed constants in {$j-} mode as "final" for JVM
o mangle the name of staticvarsyms inside localtables a bit to avoid
name clashes (only with procedure names for now, no parameters yet
so can still cause problems with overloaded routines)
o after a routine has been parsed, it is now processed by
cnodeutils.wrap_proc_body(), which can add extra nodes before code
generation (used for injected the typed constant node trees)
git-svn-id: branches/jvmbackend@18475 -
it can either generate an asmlist containing data definitions (like
it does now), or a node tree with explicit initialisation statements
(for the JVM target)
git-svn-id: branches/jvmbackend@18471 -
since the definition-specific adorning of JVM mangled names is Jasmin-
specific, and such code has no place in symdef
* moved code to adorn JVM mangled names for Jasmin definitions to agjasmin
git-svn-id: branches/jvmbackend@18346 -
whether the mangled name is for defining a symbol, or for referencing
it later (e.g. for a call or load of its address). The reason is that
on the JVM both cases are different.
+ jvmdef unit to encode types according to the JVM rules
+ tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
(the common part of defining/referencing it; tprocdef.mangledname
afterwards adorns it as required)
git-svn-id: branches/jvmbackend@18288 -
* Do not initialize unused symbols, because finalization code is not generated for them either.
* Always initialize/finalize such constants, even if they are declared in {$J-} state and cannot be modified by user code.
git-svn-id: trunk@18121 -
is_implicit_pointer_object_type() to better indicate the purpose of
that routine, and to avoid having to change its name every time
a new object type with this property is added
git-svn-id: trunk@16664 -
- rename tprocdef._class to tprocdef.struct and change the type from tobjectdef to tabstractrecorddef because methods can belong not to classes only now but to records too
- replace in many places use of current_objectdef to current_structdef with typcast where is needed
- add an argument to comp_expr, expr, factor, sub_expr to notify that we are searching type only symbol to solve the problem with records,objects,classes which contains fields with the same name as previosly declared type (like:
HWND = type Handle;
rec = record
hWnd: HWND;
end;)
- disable check in factor_read_id which was made for object that only static fields can be accessed as TObjectType.FieldName outside the object because it makes SizeOf(TObjectType.FieldName) imposible and since the same method was extended to handle records it also breaks a52 package compilation
- rename tcallcandidates.collect_overloads_in_class to tcallcandidates.collect_overloads_in_struct and addapt the code to handle overloads in records too
- fix searchsym_type to search also in object ancestors if we found an object symtable
- add pd_record, pd_notrecord flags to mark procedure modifies which can or can't be used with records. Disallow the next modifiers for records: abstract, dynamic, export, external, far, far16, final, forward, internconst, internproc, interrupt, message, near, override, public, reintroduce, virtual, weakexternal,
Allow the next modifiers for records: static
git-svn-id: branches/paul/extended_records@16526 -
- add parse_record_members function to parse record blocks based on parse_object_members code
- disable published section in records
- rename in_class argument in some functions to in_structure because the same code can work for records now which are not classes
git-svn-id: branches/paul/extended_records@16513 -
they are constants (instead of only on 32 bit systems), and always use the
actual upper/lower bound of the loop variable instead of hardcoding the
bounds of longint (mantis #17646)
git-svn-id: trunk@16213 -