Commit Graph

587 Commits

Author SHA1 Message Date
Tomas Hajny
b11a2b169a * fixed inconsistent license files references
git-svn-id: trunk@20763 -
2012-04-08 20:00:45 +00:00
Tomas Hajny
a5a7c2aa3e * directions for reporting bugs are different from those for asking questions nowadays
git-svn-id: trunk@20747 -
2012-04-07 16:43:15 +00:00
Tomas Hajny
20ebbefc2b * e-mail address for reporting bugs is not valid since long time ago
git-svn-id: trunk@20746 -
2012-04-07 16:31:08 +00:00
Tomas Hajny
b12c38984b * fpc binary supported options made localizable and not shown separately from those handled by ppc* any longer
git-svn-id: trunk@20694 -
2012-04-02 22:11:21 +00:00
Jonas Maebe
6ba8dc7146 + support for the ARM hard float EABI on Linux (patch by Peter Green):
o new eabihf (hard float) abi
   o vfpv3_d16 variant of VFP (default variant used by EABI assemblers: VFPv3
     with only 16 double registers instead of 32) and pass it to GNU as
   o make the odd numbered single precision floating point VFP registers
     available for explicit allocation for use by the calling convention
  * fixed copy/paste error in stdname of S30 register
  -> use -dFPC_ARMHF to create an ARM eabi hard float compiler
  (mantis #21554)

git-svn-id: trunk@20660 -
2012-03-29 20:50:09 +00:00
svenbarth
c9ca2a6c0c Correct messages that should not have been changed (merge during update gone wrong). Resolves Mantis #21553
git-svn-id: trunk@20631 -
2012-03-25 19:33:26 +00:00
svenbarth
bd19a16be9 Add support for Default() intrinsic. For now this is only (fully) supported
in code and not in constants. In the case of primitive types constant nodes
are used while complex types like arrays, records and objects use a local
variable which is initialized to zero once at the entry of the method (the
variable is reused if Default() is used for the same type multiple times in
the same method). For this a new compilerproc was added which uses FillChar
to initialize the given memory area to zero.
This fixes Mantis #9420.

+ psystem.pas: Added Default symbol to system unit
+ htypechk.pas: Added function "is_valid_for_default" which checks recursively
                whether the given type can be used with Default at all. 
                Forbidden types are files, helpers, ObjC and C++ types. This
                check is used for records, arrays and objects only if the mode
                is a non-Delphi one, as Delphi ignores these types on lower
                levels.
+ msg/errore.msg: Added error message for unsupported types for Default()
+ symconst.pas: Added a new enum value vo_is_default_var which is used for the
                local variables utilized by Default() so their initalization
                and finalization can be avoided.
+ pexpr.pas: Add handling of Default() intrinsic to "statement_syssym"
+ ninl.pas: Extended tinlinenode by a method which returns the correct node for
            a Default() and used that method in handle_typecheck.
* ncgutil.pas: Check for new flag "vo_is_default_var" when initializing and
               finalizing local variables.
* ppu.pas: increase PPU version
+ psub.pas: 
  * Added a new routine which zeros defaultvars of a symtable.
  * Use this routine inside "initializevars".
  * Also use this routine to initialize the staticsymtable of the unit/program.
* Adjusted ppudump, because of the new enum value.
+ Added implementation of fpc_zeromem to system unit.
+ Added tests for Default()

git-svn-id: trunk@20629 -
2012-03-25 16:02:27 +00:00
florian
f4af507321 * inline is only a hint to the compiler which might be ignored so throw only a hint and not a warning if subroutine cannot be inlined
git-svn-id: trunk@20626 -
2012-03-25 14:19:45 +00:00
florian
0a118768c0 * updated copyright message to 2012
git-svn-id: trunk@20605 -
2012-03-23 18:38:05 +00:00
Jonas Maebe
3589f90cf8 * also show the valid bounds in most cases when signalling a range check
warning/error while evaluating constants (mantis #21299)

git-svn-id: trunk@20507 -
2012-03-10 21:53:36 +00:00
Jonas Maebe
eb2cccffda + -WM<X> and -WP<x> command line parameters to specify the minimally required
Mac OS X/iOS version for the compiler code
   o such a parameter is not passed, extract the information from the
     environment variables MACOSX_DEPLOYMENT_TARGET/IPHONEOS_DEPLOYMENT_TARGET,
     like gcc
   o if neither the parameter nor the environment variable is used, use preset
     default values
   o pass on this version setting on to the Darwin linker
   o use this setting to determine which version of the startup code (crt1.o
     etc) to use, if any (based on information gathered from the GCC sources)
   o define a symbol called MAC_OS_X_VERSION_MIN_REQUIRED/
     IPHONE_OS_VERSION_MIN_REQUIRED based on this parameter
   o for usage information, see
     http://wiki.freepascal.org/FPC_New_Features_Trunk#Support_for_specifying_and_querying_the_deployment_version

git-svn-id: trunk@20503 -
2012-03-10 19:31:57 +00:00
Jonas Maebe
a6a43c71ec * give an error message when including a file starting with an UTF-8 BOM
in a compilation module parsed using a different code page, because this
    changes the default ansistring type and {$codepage xxx} is also not
    allowed in the middle of a unit (mantis #21445)

git-svn-id: trunk@20488 -
2012-03-09 22:50:14 +00:00
Tomas Hajny
f1b81f12b5 * indicate -an being only useful with -dEXTDEBUG
git-svn-id: trunk@20433 -
2012-02-26 20:49:45 +00:00
florian
96e8e89e16 * write error code if an object file cannot be created
git-svn-id: trunk@20083 -
2012-01-15 10:59:10 +00:00
florian
ea8ae7c867 * update of Portuguese compiler message file by Marcelo B Paula, resolves #20963
git-svn-id: trunk@19898 -
2011-12-28 17:44:46 +00:00
marco
28c27c409e * fixed up messages compilation after last commit.
git-svn-id: trunk@19780 -
2011-12-08 20:49:18 +00:00
paul
031eb4d51c compiler: fix 'class class' message
git-svn-id: trunk@19682 -
2011-11-25 08:34:24 +00:00
pierre
8f7ea8718b + Add message for TExternalLinker.CatFileContent method
git-svn-id: trunk@19646 -
2011-11-18 21:28:46 +00:00
paul
26f66897cd compiler:
- warn if compiler finds implicit or explicit string type conversion from a form of ansi string to a form of unicode string and vice versa
  - mark explicit warnings as OFF by default
  - warn if compiler finds an assignment of an unicode char const to ansi string or char type (warn for assignment of unicode string const to be implemented)
  - revert a piece of code from r19457 regards shortstring handling because shortstring handling should not differ from ansistring in this paticular case

git-svn-id: trunk@19574 -
2011-11-03 00:39:22 +00:00
florian
6ec0f2549a * factored load node flags out of node flags to gain space
+ implemented iso mode mod, resolves #17685

git-svn-id: trunk@19558 -
2011-10-30 15:14:21 +00:00
sergei
6a3fe72de9 + Support .rva directive in AT&T reader. Put it into base class because it generally applies to all targets with COFF output, but enabled for Windows targets only (others need additional testing).
+ Support .seh_handlerdata directive in Win64.

git-svn-id: trunk@19546 -
2011-10-25 15:18:47 +00:00
sergei
85f7914906 * Don't generate .seh_endprologue if SEH directives are present in the text of (pure assembler) procedure, as it results in duplicate .seh_endprologue.
* Added checks for .seh_endprologue presence and correct position.

git-svn-id: trunk@19388 -
2011-10-06 03:29:35 +00:00
sergei
0db44ae108 + Support SEH directives in x86_64 AT&T asmreader.
git-svn-id: trunk@19366 -
2011-10-04 12:26:41 +00:00
paul
8a4634a7b1 merge r13481 from cpstrnew branch by florian
+ support parsing of strings with code page specification
+ added encoding and elementsize field to ansi- and unicodestring records
+ some basic rtl support routines for encoding aware strings
+ DefaultSystemCodePage
+ DefaultUnicodeCodePage
+ ppu writing/loading of code page aware strings

git-svn-id: trunk@19080 -
2011-09-17 10:37:36 +00:00
pierre
a5d2840980 + Fix commit 19061, by restoring cs_link_smart code and disabling
cs_create_smart if using dwarf information and external assembler
   debug information as this is not compatible.
 * Added a different message for cs_create_smart.

git-svn-id: trunk@19065 -
2011-09-14 13:38:15 +00:00
pierre
5a671336c7 Fix go32v2 rtl compilation error and add warning for %es:Const
git-svn-id: trunk@19057 -
2011-09-13 16:20:12 +00:00
florian
1491d77c9d * avoid ugly space in compilation summary
git-svn-id: trunk@18865 -
2011-08-27 21:21:24 +00:00
florian
da9d0d24e8 * update of german error message files by Karl-Michael Schindler, resolves #20021
git-svn-id: trunk@18457 -
2011-08-20 08:01:26 +00:00
florian
c855c7a0aa * unified handling of comparison of constant and expression with disjunct ranges of values
* warn if such an expression is encountered
* don't optimize the expression if it has side effects, resolves #17838

git-svn-id: trunk@18275 -
2011-08-19 18:47:37 +00:00
florian
cf874a3465 * give a more understandable error message if a procedure "result" is tried to be a
ssigned, resolves #19122 (and breaks hopefully nothing procvar related)

git-svn-id: trunk@18267 -
2011-08-18 21:10:05 +00:00
sergei
bbae63a4f2 * Check that a single interface is only delegated to a single property within a class.
* Disallow simultaneous use of method resolution and delegation for the same interface. An interface with method resolution must be implemented directly. This is Delphi compatible and resolves #18058.

git-svn-id: trunk@18179 -
2011-08-12 14:42:30 +00:00
florian
562961fd42 * catch EOSError, EIOError and IOutOfMemory exceptions inside the compiler
so a proper error message is written (resolves #19871), 
  EOutOfMemory is not handle perfectly because it could be that the exception
  handling requires again a memory allocation

git-svn-id: trunk@18132 -
2011-08-07 09:18:07 +00:00
florian
57cdf34a6b * put -Wpxxxx switch on the help screen
git-svn-id: trunk@18012 -
2011-07-17 20:42:56 +00:00
pierre
bded762fef Add missing x86_64 -A options
git-svn-id: trunk@17930 -
2011-07-04 08:58:46 +00:00
pierre
f220513821 + Warning for possible library overloading
git-svn-id: trunk@17803 -
2011-06-23 08:28:49 +00:00
florian
4f18a59b87 * fixes errore.msg file errors, resolves #19541
git-svn-id: trunk@17722 -
2011-06-11 21:21:59 +00:00
florian
ebc7a10954 * synchronized -Wxxxxx handling in options.pas and help screen, resolves #19400
* limited -Wxxxxx options to the targets they apply to

git-svn-id: trunk@17664 -
2011-06-05 15:39:44 +00:00
florian
93e53e1990 * allow also smaller values for code alignment parameters than the current one, resolves #19463
* limit code alignment parameters to power of 2 up to 256
* give an error for an invalid code alignment directive

git-svn-id: trunk@17659 -
2011-06-04 20:56:15 +00:00
sergei
d908fb42f7 x86 assembler fixes:
* Factored repeating REX operations into a separate function.
* Fixed instruction matching bug which was preventing compilation of 3-operand SIMD instructions with RIP-relative operand + test.
* Do not adjust offset of RIP-relative reference if it is a literal number, this was causing 0x123(%rip) to assemble as 0x122(%rip) in 3-operand instructions. Now tasm2.pp is the same with and without -Aas. Also fixed the expected result, improved verbosity of diagnostic and removed %norun, so it is actually executed.
+ Disallow high-byte registers in instructions requiring REX + test.

git-svn-id: trunk@17478 -
2011-05-16 20:18:03 +00:00
florian
d0c6e23116 + -Sy on the command line is now equal to $T+, resolves #16160
git-svn-id: trunk@17477 -
2011-05-16 15:36:16 +00:00
paul
ab8db32e2e compiler: correct the last used number for parser messages
git-svn-id: trunk@17349 -
2011-04-20 02:34:09 +00:00
paul
f904f41664 compiler: don't allow local or anonymous records to have types (the second part of issue #0019099)
git-svn-id: trunk@17336 -
2011-04-18 06:10:56 +00:00
florian
d3e0105ba8 + Italian UTF-8 message file, contributed by Massimo Soricetti, resolves #19179
git-svn-id: trunk@17332 -
2011-04-16 20:41:59 +00:00
svenbarth
35b47e491c Rebase to revision 17306
git-svn-id: branches/svenbarth/classhelpers@17314 -
2011-04-13 10:04:14 +00:00
florian
c97869bd89 * merge user sections support branch
git-svn-id: trunk@17285 -
2011-04-10 18:08:59 +00:00
svenbarth
d0705a1779 Rebase to revision 17236
git-svn-id: branches/svenbarth/classhelpers@17241 -
2011-04-03 17:24:35 +00:00
svenbarth
a944be69a6 * nflw.pas: search for enumerators in helpers for records as well
* pdecobj.pas:
- parse_object_members: in record helpers class methods need to be declared as "static" like in records
- object_dec: 
 - allow "published" in helpers as well
 - disallow inheritance for record helpers in mode Delphi (and remove the forward declaration flag in that case)
* pdecsub.pas:
pd_abstract: "abstract" isn't allowed in either mode
* pexpr.pas: multiple corrections because of "inherited" and records
- allow "inherited" for "record helpers" (except for mode Delphi)
- load the symbol from the correct class (I hope...)
- give a more precise error message if "inherited" is used in records
* ptype.pas: I forgot to adjust the "(bit)packed record" case
* symtable.pas:
- searchsym_in_helper: "result" was not initialized (and identation fix)
- search_last_objectpascal_helper:
 - don't search if there are no helpers (useful for projects that does not contain helpers like the compiler itself)
 - don't search if the type to search helpers for is defined locally
 - don't search if the type is a anonymous record
- search_struct_member: search for symbols in helpers as well
- msg*: 
* correct the message for "parser_e_not_allowed_in_helper"
* add message "parser_e_inherited_not_in_record" which is used to tell that the use of "inherited" is not allowed in records and (in mode Delphi) record helpers

git-svn-id: branches/svenbarth/classhelpers@17239 -
2011-04-03 14:03:17 +00:00
florian
736071e716 * updated copyright to 2011
* corrected copyright notice in message files and added "and others"

git-svn-id: trunk@17232 -
2011-04-02 20:06:46 +00:00
florian
f328b6d635 + user section type
+ parsing of section directive for variables
  + section test
  + write section names in the assembler/binary writers correctly
  * allow section only after ; and for embedded targets

git-svn-id: branches/usersections@17154 -
2011-03-20 15:42:28 +00:00
svenbarth
f7f357f18e * symconst.pas:
- remove thelpersearch again => adjustments to searchsym_in_class and calls to it
- rename sto_has_classhelper to sto_has_helper
* symbase.pas: make push and pop in tsymtablestack virtual
* symdef.pas:
- add a new class tdefawaresymtablestack which overrides push and pop of tsymtablestack and adjusts the new extendeddefs field of the current tmodule
- tobjectdef.create: sto_has_classhelper => sto_has_helper
* fmodule.pas:
- add new hash object list to tmodule (key: mangled type name) which holds object list instances that contain all helpers currently active for a given type (= key of the hash list)
- tmodule.create: the hash list owns the sublists (but those don't own the defs)
- tmodule.destroy: free the hash list
* pdecobjpas:
- rename parse_extended_class to parse_extended_type
- parsing of constructors:
# for all helper types: no class constructors allowed
# for record helpers: as long as constructors for records themselves are disabled they are for record helpers as well
- object_dec: manually add the helper to the extendeddefs if the overall owner of the current def is a static symtable (implementation section or program/library main file), because the symtable won't be popped and pushed then
* parser.pas: instantiate the new stack class
* psub.pas: backup the extendeddefs in specialize_objectdefs as well
* ptype.pas:
- generate_specialization: backup the extendeddefs as well
- record_dec: _RECORD is now consumed in read_named_type itself
- read_named_type: parse "record helper" if advanced record syntax is enabled
* symtable.pas:
- correct searchsym_in_class declaration => adjustments in this unit as well
- add the possibility to pass a context def to search_last_objectpascal_helper
- rename search_objectpascal_class_helper to search_objectpascal_helper
- rename search_class_helper to search_objc_helper
- searchsym_in_class: 
# search for helpers in every level of the tree of the class
# the contextclassh can also be a subclass of the extendeddef
- searchsym_in_record: search for helper methods as well
- searchsym_in_helper:
# search for symbols in class and record helpers is the same except for the search in the class' ancestors
# search the extendeddef directly and rely on searchsym_in_class only for the class' ancestors as we need to find the helpers there as well
- search_last_objectpascal_helper: use the extendeddefs list of current_module instead of scanning the symbol stack itself
* pexpr.pas: adjustments because of renaming of sto_has_classhelper
* pinline.pas: adjustment because of removing of thelpersearch
* nflw.pas: 
- renamed classhelper to helperdef
- adjusted search_last_objectpascal_helper call
* msg*:
- adjusted error message for constructors in records (this currently applies to record helpers as well)
- renamed parser_e_not_allowed_in_classhelper to parser_e_not_allowed_in_helper => adjustments in code
- added parser_e_no_class_constructors_in_helpers
* pdecsub.pas: adjusted renamed error message
* htypechk.pas: check for helpers in every step of the hierarchy
* nobj.pas: search_class_helper => search_objc_helper
* utils/ppudump.pas: adjust, because of renames

Note: the define "useoldsearch" will be only used for performance comparison on my (faster) Linux machine; that (and its associated code) will be removed afterwards

git-svn-id: branches/svenbarth/classhelpers@17151 -
2011-03-20 11:27:27 +00:00