lost" warning by showing the exact register used (esp or rsp) and using the
asm syntax (Intel or AT&T) used originally in the code
git-svn-id: trunk@42211 -
and "Use of +offset(%ebp) for parameters invalid here" warning messages by
showing the exact register used (bp, ebp or rbp) and using the original asm
syntax (Intel: [EBP+offset]; AT&T: +offset(%ebp) )
git-svn-id: trunk@42207 -
non-LLVM-base compiler and vice versa (caused internal errors, because
the LLVM compiler uses different nodes, and these are saved in the PPUs
for inline routines)
git-svn-id: branches/debug_eh@42196 -
(based on patch by Martok)
o enabled by default in ISO and Extended Pascal: compile-time error if not
the case in ISO mode, warning and run-time error in Extended Pascal mode
o warning enabled by default in all other modes for boolean, enumeration and
subrange integer types with ranges different from the default ones
(i.e., different from 0..255, -128..127, 0..65536, etc)
o warnings for all ordinal types can be enabled in all modes with
-CC
git-svn-id: trunk@42047 -
for the system unit, as there are several bugs in the Xcode linkers
that trigger when the system unit is involved:
o Xcode 9.3: the second symbol associated with routines that have multiple
symbols (such as FPC_INTERLOCKED*) gets moved to the next routine (so
e.g. calling InterlockedIncrement results in calling InterlockedExchange)
o Xcode 10.1: the linker does not generate native code for the personality
routine (probably because it's not referenced directly anywhere)
git-svn-id: branches/debug_eh@41911 -
program/library also with -Clflto, all units compiled with that option
will be linked using their bitcode files and LTO
o compiling with -CLflto will compile all units twice: once for normal
(static or smart) linking, and once for LTO. So the result can be
used both with and without LTO.
git-svn-id: branches/debug_eh@41910 -
information in OMF LINNUM records, in addition to the DWARF debug information.
This enables source level debugging on i8086-msdos, when using the Open Watcom
Debugger, provided the source was compiled with this option and the external
linker (wlink) was used for generating the executable (the internal linker
does not yet support generating debug information).
git-svn-id: trunk@39014 -
information. Only enabled on i8086 (for now). Does not do much yet, but
hopefully, soon it'll start emitting line number information for i8086-msdos
that is usable by DOS debuggers.
git-svn-id: trunk@39006 -
[expr1][expr2] = [expr1+expr2]
[expr1[expr2]] = [expr1+expr2]
This is compatible with TP7's inline asm, and perhaps also with tasm/masm/delphi.
git-svn-id: trunk@38352 -
inline assembly, and fixed check after r35959 (mantis #32318)
o can also subscript parameters passed by value on the stack
o can also subscript local variables, the parameters passed by reference
that are subsequently copied into a local
git-svn-id: trunk@37886 -
* ppu version update
* -Sf might be used only during system unit compilation
* loadsystemunit factored out so the system unit can be loaded earlier than other units to get features set
git-svn-id: trunk@37708 -
warning (on the i8086 target) or an error (on i386 and x86_64) when this
instruction is used (because it only works on 8086 and 8088 CPUs)
git-svn-id: trunk@37514 -
specified to be (%esi) or (%edi), when using at&t syntax assembler (this is
not considered an error by intel syntax assemblers, so we're not adding a
warning there, for now)
git-svn-id: trunk@37458 -
regenerated from errordu.msg, which fixed two small typos (that were fixed
only in errordu.msg, but hadn't been applied to errord.msg)
git-svn-id: trunk@36455 -
Note 1: using an older AS might fail anyway if the amount of sections is too high (like in packages\odata\src\sharepoint.pp)
Note 2: it might be an idea to keep track of the created sections in the asmlists and only enable the option if *really* necessary (like with the internal COFF output generator), though this might lead to false positives due to multiple sections with the same name (since I'd prefer to use the KISS principle only a counter would be used)
git-svn-id: trunk@35381 -
* adjusted error message to reflect that we're not only dealing with generic classes
+ added test; note: it's added in webtbs, cause the test will loose its %FAIL attribute in the future
git-svn-id: trunk@35079 -
Add description to -gc option, saying it is experimental.
Add warning at link time for program/library if checkpointer is used in any unit or main code.
git-svn-id: trunk@34565 -
Merged revision(s) 29015, 29036, 31989, 32132-32133, 32306, 32478, 32513 from branches/svenbarth/packages:
Start to use package related messages
........
+ add a error message for specifying a package multiple times
........
msg/errore.msg:
+ add additional messages for implicitely imported units and units that must not be part of a package
........
* fix name of section for package related messages
+ add missing EndOfTex tag
........
+ add more package loading related messages
........
errore.msg:
+ new message that a PPU is loaded from a package
........
+ new message for when a unit is listed in the contains section that is already part of another package
........
msg/errore.msg:
+ new message when a unit from an indirectly referenced package is used
........
git-svn-id: trunk@33450 -
CPU target for inline assembler blocks. In addition to the different CPUs
(as listed under 'Supported CPU instruction sets:' in the output of 'fpc -i'),
it also supports the special values 'ANY' and 'CURRENT'. 'ANY' means no
restrictions (i.e. all instructions are available). 'CURRENT' means the
current CPU target (as specified with the '-Cp' command line option). For
backward compatibility, the default value is 'ANY' for all CPU targets, except
i8086, where it defaults to 'CURRENT'.
This directive requires support for the new asd_cpu directive in the assembler
writer. This is currently implemented only for NASM, but will be supported in
some of the other assembler writers as well (incl. the x86 internal assembler
writer).
git-svn-id: trunk@33138 -
Add a new target flag which determines whether the target supports dynamic packages or not.
systems.pas:
+ new flag tf_supports_packages
pmodules.pas, proc_package:
* error out when flag tf_supports_packages is not set for the current target
msg/errore.msg:
+ error message for when tf_supports_packages is missing and a package file is compiled
........
git-svn-id: trunk@32978 -
the i8086 internal object writer. This allows weeding out spurious 386
instructions, as is similarly done by NASM when using it as an external
assembler.
git-svn-id: trunk@32871 -
* fixed for MorphOS, added for Amiga/m68k
* enabled as default when running natively on these systems (cross still defaults to GNU LD)
* added -XV command line switch to enable/disable it
* dropped the 'fpc' prefix from vlink binary name on MorphOS
git-svn-id: trunk@32324 -
o 'DB SEG symbol' produces an error
o 'DD SEG symbol' (and anything larger than DW, like DQ) adds extra high zeros
to the segment constant (this is Turbo Pascal 7 compatible)
git-svn-id: trunk@32283 -
+ add error message if a generic method is declared inside an interface
+ add error message if a generic method is declared as virtual
git-svn-id: trunk@31764 -
how the fpc sections have to be linked *on Linux*. This prevents the
"did you forget -T" warnings from ld, and in general is more correct than
our previous approach of specifying a complete linker script without -T
and hoping that there won't be any unexpected interactions with ld's
built-in linker script (fixed version of r31664, thanks to Alan Modra)
o use the new -X9 command line option to generate linker scripts that
are compatible with binutils older than 2.19 (reverts to the old
behaviour)
git-svn-id: trunk@31675 -
how the fpc sections have to be linked *on Linux*. This prevents the
"did you forget -T" warnings from ld, and in general is more correct than
our previous approach of specifying a complete linker script without -T
and hoping that there won't be any unexpected interactions with ld's
built-in linker script
o use the new -X9 command line option to generate linker scripts that
are compatible with binutils older than 2.19 (reverts to the old
behaviour)
git-svn-id: trunk@31664 -
an Objective-C method masks an identifier from a category, because due
to the fact that all standard categories are imported at the same time via
the CocoaAll unit, this can often happen with categories you don't know/
care about. These errors also didn't happen in 2.6.x
git-svn-id: trunk@29497 -
psub.pas, tcgprocinfo.parse_body:
* also check record symtables besides object symtables to determine whether the staticsymtable is accessed from a globally declared generic
* use a translateable message if the static symtable is accessed if it should not
msg/errore.msg:
+ add new error message for when the static symtable is accessed from a global generic
msgidx.inc & msgtixt.inc:
* regenerated
+ added test
git-svn-id: trunk@29427 -
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
uses for anonymous function references. The "cdecl;" indicates that this
is for the C-variant of such references, which is what blocks are
git-svn-id: branches/blocks@28233 -
* scandir.pas, dir_warn: also adjust the message state for type_w_instance_abstract_class if the identifier is CONSTRUCTING_ABSTRACT
* msg/errore.msg: enable type_w_instance_abstract_class by default
* msgidx.inc, msgtxt.inc: updated
git-svn-id: trunk@28137 -
Please note that this warning won't be triggered if an instance of that class is created using a class variable of that class type as the compiler can not know the type contained in the variable at compile time (see also the added test).
+ msg/errore.msg: added disabled message which informs about the instantiation of an abstract class
* pexpr.pas, do_member_read: generate the message if we have a constructor call for an abstract class using a loadvmtaddrnode (thus the type name is used and not a class variable)
* msg{idx,txt}.inc: updated
+ added test
git-svn-id: trunk@28127 -
constant values (i.e., anything non-value/const/constref) (mantis #263363)
o fixed default parameter value for var-parameter in chmreader
git-svn-id: trunk@28016 -
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
double operations, it makes no sense in my opinion to do so.
git-svn-id: trunk@27564 -
* don't allow to apply the same hint directive twice
* change parser_e_proc_dir_not_allowed to more generic variant parser_e_dir_not_allowed - they are similar and 'procedure' prefix does not give more information about the error.
* maybe_parse_hint_directives() uses procdef settings for initial values
+ add tests
git-svn-id: trunk@25720 -
that may trigger JVM bytecode verification errors if they are used
before they are initialised (this includes passing them as a "var"
parameter) + test
* sorted -CT parameters alphabetically and alligned them
git-svn-id: trunk@25387 -
so that code written according to Delphi coding standards can be compiled
into JVM bytecode with routine names conforming to JVM coding standards
git-svn-id: trunk@25385 -
1. At least on x86 the assembler reader initializes the parameter location informations which results in InternalError 200301231
2. Assembler tokens are not stored in the token stream and thus won't be reproduced during specialization
x86/rax86int.pas, tx86intreader.Assemble:
* check for "parse_generic" before calling generate_parameter_info
pstatmnt.pas, assembler_block & statement:
* generate an error message if an asm statement should be parsed inside a generic
+ added test
git-svn-id: trunk@24892 -
scandir.pas:
+ add function "get_peflag_const" to retrieve the value of a constant
* dir_setpeflags & dir_setpeoptflags: first check for an identifier (value is retrieved through "get_peflag_const") and then read a value
+ added messages for illegal parameters for SetPEFlags and SetPEOptFlags respectively
+ added tests
git-svn-id: trunk@24887 -
pdecsub.pas, pd_static:
* check whether the given pd is an operator or a class method not inside an Object and generate an error if either of these is true
msg/errore.msg, msgidx.inc, msgtxt.inc:
* add a message to inform that a certain procedure directive is not allowed
+ added tests
git-svn-id: trunk@23944 -
ptype.pas, parse_record_members:
* write an error message if "protected" or "strict protected" is encountered
msg/errore.msg:
+ add an error message for disallowed "things" in records
+ added test
* adjusted test (note: according to the bug report this test did not originally have the "protected" section, but it was added by Paul before commiting)
git-svn-id: trunk@23596 -
symconst.pas:
+ extend "thelpertype" by "ht_type" which tells the code in "pdecobj.parse_extended_type" that a type helper declaration has been parsed
node.pas:
+ add a constant which identifies all constant node types
ptype.pas:
+ read_named_type: add a parameter "hadtypetoken" to tell the code whether a "type" token had been parsed before
+ read_named_type: if an identifier "helper" is parsed we need to check whether "hadtypetoken" is true and the modeswitch "m_class" is set, but the "m_delphi" one is not; in that case we have a "type helper" declaration
pgenutil.pas, generate_specialization:
* adjust call to read_named_type
pdecl.pas, types_dec:
* adjust call to read_named_type
pdecobj.pas:
* parse_extended_type: extend for correct handling of primitive types (includes Delphi compatible handling as well) and reject types that are explicitly not allowed
* method_dec: require "static" for class methods in type helpers
* method_doc: allow constructors for type helpers as well
paramgr.pas, tparamanager:
* set_common_funcretloc_info: handle type helper constructors like record constructors
* handle_common_ret_in_param: the "self" value of a type helper constructor is also returned in a parameter
pexpr.pas:
+ add a function to postfixoperators which tries to find and apply a type helper for a given type
* postfixoperators: try to apply type helpers for ordinal constants
* postfixoperators: use the correct string type for string constants
* postfixoperators: try to apply type helpers for enum constants
* postfixoperators: try to apply type helpers for arrays
* postfixoperators: try to apply type helpers for Variant
* postfixoperators: try to apply type helpers for pointer types
* postfixoperators: try to apply type helpers for other types
* factor: check postfixoperators after _REALNUMBER, _CCHAR, _CWCHAR, _TRUE and _FALSE
* factor: also check postfixoperators if a _POINT follows a _NIL
symdef.pas, tdefawaresymtablestack.addhelpers:
* use "generate_objectpascal_helper_key" to generate the key
symtable.pas:
+ add function to generate the key value for the map of extended types using the extended def
* adjust "search_last_objectpascal_helper" and "search_objectpascal_helper" to handle primitive types as well
* use the new "generate_objectpascal_helper_key" function to generate the key
pparautl.pas:
* insert_self_and_vmt_para: don't insert the $vmt symbol for record or type helpers (ToDo: check whether class helpers really need the symbol as well)
* insert_self_and_vmt_para: pass "self" as var parameter for type helpers as well
psub.pas, generate_bodyentry_block:
* also allow type helpers for constructor methods
ncal.pas, tcallnode.gen_self_tree:
* also use a temp variable for type helper constructors
ncgcal.pas, tcgcallnode.secondcallparan:
* allow Pointers to be passed as address param if it is the Self value of a type helper extending a pointer type
* correctly handle the location in case of type helper constructors
+ add tests
git-svn-id: trunk@23580 -
JVM target, since Java bytecode itself has no support for properties and
hence exposing properties to external Java code can only be done through
getters/setters. Use the new parameters to do so:
-CTautogetterprefix=XXX
-CTautosetterprefix=YYY
The getter/setter will get the same visibility as the property. If a
getter/setter with the same naming convention was already specified for a
property and this getter/setter is declared in the same class as the
property, then the visibility of this existing getter/setter is
modified and no new routine is generated.
Newly generated getters/setters are virtual methods, because that is
the only way in Java bytecode to allow redefining these getters/setters
in child classes. However, that also means that using these switches can
change the behvaviour of code, since normally the used property definition
is only determined by the declared type of its associated class instance,
and not by the actual instance type. The compiler will therefore warn when
such an automatically generated getter/setter is overridden by another
automatically generated getter/setter in a child class.
git-svn-id: trunk@22959 -
(mantis #22665)
+ support "[var wrt ..gotpcrel]" nasm/yasm syntax in intel assembler mode
for GOT-relative accesses on x86-64, + give an error when trying to do
this on win64 (it doesn't have a GOT)
* moved code that give a warning when using GOT-relative accesses to
static data on x86-64 from the AT&T reader to rax86 so it's also
active for the Intel assembler reader
+ added warning when not using GOT-relative accesses (but plain
RIP-relative instead) to global data on non-Win64 x86-64
git-svn-id: trunk@22243 -
the result location is a simple location (a single register/reference)
(mantis #22490)
* print an error when accessing "result" in a nostack pure assembler routine
if the result location is not simple
git-svn-id: trunk@22166 -
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
stack traces from dump_stack)
+ niln is also valid in a cse domain
* parameters passed by reference shall have a complexity >1
* load nodes from outer scopes shall have a complexity >1
* better cse debugging
+ more node types added to cse
* consider parameters passed by reference in cse
* take care of cse in parameters in simple cases
git-svn-id: trunk@22050 -
default value (mantis #22343)
* give an error when specifying an invalid default value (e.g. a
floating point number for a longint parameter)
git-svn-id: trunk@22021 -
method by one with a lower visibility, because calling the overriding
method results in a java.lang.AbstractMethodError in that case
git-svn-id: trunk@21839 -
with the enum instance corresponding to ordinal 0 in JVM constructors,
because a virtual method called by a parent constructor may already
have assigned a different value (see tests/test/jvm/tenum2.pp). This
will result in null pointer exceptions when using such fields without
first explicitly assigning a value to them though.
The old behaviour can be restored with the new -CTenumfieldinit command
line parameter
git-svn-id: trunk@21736 -
+ implement trashing of local variables if subroutine is inlined
* fix some errors releated to interproc. gotos and inlining
+ node_count function
* inline cannot be used with iochecking and safecall calling conventions
* track inherited usage
* don't inline if inherited is used
git-svn-id: trunk@21335 -
method's visibility, because this is common practice in Object-Pascal.
It can be re-enabled with {$warn INTF_RAISE_VISIBILITY on} (mainly
useful when trying to keep code compatible with the JVM target)
git-svn-id: trunk@21329 -