Commit Graph

470 Commits

Author SHA1 Message Date
Jonas Maebe
ff3f812d97 * fix conversion of true/false macro definitions to boolean values
(mantis #38492)
   o since the macro lookups are recursive, "mac" will usually be nil
     afterwards (unless we found an undefined macro)

git-svn-id: trunk@49160 -
2021-04-10 10:56:02 +00:00
florian
9803318fef * give a proper error if macros are too deeply nested
git-svn-id: trunk@48357 -
2021-01-23 21:29:37 +00:00
svenbarth
a8d316d187 + add method to retrieve an integer expression from the scanner
git-svn-id: trunk@47601 -
2020-11-26 20:13:34 +00:00
Jonas Maebe
38a059f039 * give an error when trying to define a macro/compiler variable with
an empty name

git-svn-id: trunk@47300 -
2020-11-03 21:34:19 +00:00
florian
5b06af8886 * delphi has excessprecision turned on by default
git-svn-id: trunk@47245 -
2020-10-28 21:37:26 +00:00
florian
9ea52b8578 + new switches -DD and DT which allow to pass an arbitrary string which is used by %DATE%/%TIME%
git-svn-id: trunk@47132 -
2020-10-18 17:13:38 +00:00
florian
e83d214e98 + allow in ISO mode that { ... } and (* ... *) comments are paired, resolves at least partly #37428
git-svn-id: trunk@46903 -
2020-09-20 08:47:00 +00:00
yury
154ada9e86 * 8086: enable cs_force_far_calls when m_nested_procvars is enabled.
* 8086: when the compiler mode switches to a non-TP mode, enable cs_force_far_calls.

git-svn-id: trunk@46454 -
2020-08-16 10:34:23 +00:00
yury
f7d14128b5 * 8086: Do not force far calls in the TP mode by default. This is TP compatible. Other modes need forced far calls by default in order to compile non-TP code.
git-svn-id: trunk@46433 -
2020-08-14 16:56:13 +00:00
svenbarth
bd01182ff0 * add support for AND, OR, XOR and NOT of integer values in preprocessor directives (Delphi allows that as well)
+ added test

git-svn-id: trunk@45053 -
2020-04-24 14:09:04 +00:00
svenbarth
ae2801c707 * use asInt64 instead of asInt to evaluate an Integer expression
git-svn-id: trunk@45052 -
2020-04-24 14:09:02 +00:00
svenbarth
bffe99f59f + add an asInt64 to texprvalue
git-svn-id: trunk@45051 -
2020-04-24 14:09:00 +00:00
svenbarth
4f16473baa * fix typo
git-svn-id: trunk@44747 -
2020-04-17 14:44:16 +00:00
pierre
d1e4066477 Hopefully fix problems related to loading of ppufile generated with other endianess for generics
git-svn-id: trunk@44056 -
2020-01-28 23:43:56 +00:00
svenbarth
562d345060 * fix for Mantis #36121: define FPC_ISO and FPC_EXTENDEDPASCAL for modes ISO and EXTENDEDPASCAL respectively
git-svn-id: trunk@43114 -
2019-10-03 12:34:36 +00:00
florian
5947143d8f * intel asm reader: try to read avx512 extensions only if the instruction supports them
* cleanup

git-svn-id: trunk@42656 -
2019-08-12 10:46:19 +00:00
florian
f883dd6dbb Synchronized with trunk, part 2 (make all works, avx-512 support not yet tested, no regression testing yet)
git-svn-id: branches/tg74/avx512@42643 -
2019-08-10 19:38:35 +00:00
florian
746bfced25 Synchronized with trunk, part 1 (only make cycle tested, make all is broken, avx-512 support not yet tested
git-svn-id: branches/tg74/avx512@42642 -
2019-08-10 13:53:20 +00:00
pierre
70b2904c48 * Issue file change before line and column change in token writes to allow for better display in ppudump utility
git-svn-id: trunk@42601 -
2019-08-08 06:26:40 +00:00
pierre
92f085fdd9 Try to fix bug introduced in previous commit #42527, hopefully fixing bug report 35902
git-svn-id: trunk@42528 -
2019-07-29 11:54:27 +00:00
pierre
f2b200e4f0 Fix recordtoken writing into ppu files to allow correct
handling in cross-configuration with different endianess.

  The code has been modified to use the same scheme as the writing of
  the other parts of the ppu, i.e. change_endian filed has been
  added also to tscannerfile class of scanner unit.
  This field is then used to swap values that required endianess
  conversion.

  * scanner.pas: change_endian filed added to tscannerfile class.
    The value of this field is set as the same field in tentryfile class of entfile unit.
    Token read and write methods converted to use change_endian field.

  * ppu.pas: Increase CurrentPPILongVersion

  * utils/ppuutils/ppudump.pp: Remove unneeded FPC_BIG_ENDIAN code
    which was needed because tokens were previously written using a
    different rule.

git-svn-id: trunk@42527 -
2019-07-29 05:33:00 +00:00
pierre
8d4588e1b2 Fix compilation of compiler with -dPREPROCWRITE
git-svn-id: trunk@42084 -
2019-05-16 12:17:32 +00:00
Jonas Maebe
ba1b4b1c92 + support for verifying whether a case statements handles all possibilities
(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 -
2019-05-12 14:29:11 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
bde560dac2 * also accept {$elsif} after {$if(n)def} (mantis #34858)
git-svn-id: trunk@41724 -
2019-03-17 15:20:22 +00:00
Jonas Maebe
ba22fe74c7 * don't corrupt the assembler reader mode on i386 and i8086 if the syntax
mode is set to something else but Delphi on the command line

git-svn-id: trunk@41422 -
2019-02-23 16:03:25 +00:00
Jonas Maebe
dee1056546 * fixed wrong change of jumpalignmax from 10 to 16 in previous commit
o renamed jumpalignmax and coalescealignmax to jumpalignskipmax/
     coalescealignskipmax to better reflex the meaning of these setting
     (and the difference in meaning to e.g. constalignmax)

git-svn-id: trunk@40682 -
2018-12-28 13:22:50 +00:00
florian
0d50a63c7d + tsettings.tlsmodel
git-svn-id: trunk@40271 -
2018-11-07 22:03:01 +00:00
florian
a092da723a + new fields for more precise control of alignment
+ support of new alignment control values for GNU AS writer
+ support of new alignment control values for binary writer
* better alignment settings on i386-win32
* improved inserted align directives for if nodes

git-svn-id: trunk@40159 -
2018-11-01 20:49:17 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
tg74
4dc5442fa5 support vector operand writemask,zeroflag
git-svn-id: branches/tg74/avx512@39359 -
2018-07-02 20:20:03 +00:00
nickysn
a38e9ff12e * if an include file name ends in dot, and the file is not found, also search
for the file name without the dot. So, for example, if the code contains
  {$I MPAL256.} and 'MPAL256.' is not found, search also for 'MPAL256'

git-svn-id: trunk@39316 -
2018-06-27 14:41:06 +00:00
svenbarth
f077c7d950 + add support for Unicode code point constants > $FFFF; they are converted to a surrogate pair so they are in
fact a UnicodeString constant
+ added tests

git-svn-id: trunk@39123 -
2018-05-27 14:06:19 +00:00
florian
c671683e80 + patch by Denis Kozlov to add date/time tokens: %DATEYEAR%, %DATEMONTH%, %DATEDAY%, %TIMEHOUR%, %TIMEMINUTE%, %TIMESECOND%
+ test

git-svn-id: trunk@38329 -
2018-02-24 12:50:55 +00:00
Jonas Maebe
5f7d3e16f5 * increase comment nesting level when "(*" is followed by another '*'
(mantis #32019)

git-svn-id: trunk@37935 -
2018-01-07 21:05:50 +00:00
maciej-izak
751bde9792 Revert revision 36436 from trunk. Final fix for issue #31675.
git-svn-id: trunk@36446 -
2017-06-07 21:06:54 +00:00
maciej-izak
d3d29fa84c Revert revisions 36133, 36128 from trunk.
git-svn-id: trunk@36436 -
2017-06-06 07:12:26 +00:00
maciej-izak
631d4a2d53 * Move global variable in_preproc_comp_expr into tscannerfile class.
git-svn-id: trunk@36133 -
2017-05-06 12:12:50 +00:00
maciej-izak
6d1ad52dc5 * for symbols used in preprocessor expressions, we don't want to increase references count (for smaller final binaries). Partial fix for problem presented in mantis 31675. Preprocessor functions like declared() in uses section will work only for symbols declared in implicytly included modules (for example like for heaptrc by option -gh, see example/test tw31675.pp)
+ added tests

git-svn-id: trunk@36128 -
2017-05-05 22:27:07 +00:00
svenbarth
c552b2957a * implement support for 4 Byte UTF-8 codepoints that result in a surrogate pair for UTF-16
git-svn-id: trunk@36116 -
2017-05-05 14:03:57 +00:00
pierre
e87cc28b64 Replaced owner field by fileindex field in tpreprocstack class, in order to display correct include file for scan_e_endif_expected error
git-svn-id: trunk@35557 -
2017-03-09 22:43:23 +00:00
yury
2387ea1ee0 * Removed unneeded var assignment.
git-svn-id: trunk@35536 -
2017-03-07 09:08:45 +00:00
florian
3d6d5145bf * fix handling of const string symbols in preprocessor expressions
+ accept string constants in preprocessor expressions, resolves #31246

git-svn-id: trunk@35432 -
2017-02-12 17:29:45 +00:00
florian
8c701eaa7b * reset c in dir_include if it will be re-read
git-svn-id: trunk@34786 -
2016-11-05 23:05:39 +00:00
nickysn
c2305809dc + added an i8086-embedded target support to the compiler (RTL and makefile
support are not done yet)

git-svn-id: trunk@33999 -
2016-06-17 19:15:24 +00:00
svenbarth
f8def6dbc9 Store and use procedure directives of generic routines.
scanner.pas, tscannerfile:
  + new method is_recording_tokens to check whether token recording is already active
pdecsub.pas, parse_proc_directives:
  * record tokens into the declaration token buffer of a generic routine if necessary
pgenutil.pas, generate_specialization_phase2:
  * process the procedure directives that had been recorded with the generic routine

git-svn-id: trunk@33824 -
2016-05-26 18:35:08 +00:00
florian
e566fe1938 * tscannerfile.readoptionalstate can handle also switches enclosed in (* ... *) comments
git-svn-id: trunk@33522 -
2016-04-15 19:08:44 +00:00
svenbarth
d24065c529 Fix compilation of the JEDI package. Old Delphi versions have {$WEAKPACKAGEUNIT} while newer ones also seem to allow {$WEAKPACKAGENUNIT ON}... :/ (analogous for DENYPACKAGEUNIT...)
scanner.pas, tscannerfile:
  + new method readoptionalstate which reads a state like readstate, but if it encounters the closing } then it returns the provided fallback state
scandir.pas:
  + do_moduleflagswitch: new parameter optional that triggers the use of readoptionalstate instead of readstate
  * dir_weakpackageunit & dir_denypackageunit: the ON/OFF is optional

git-svn-id: trunk@33515 -
2016-04-15 14:18:39 +00:00
sergei
f69f6336e9 * Replaced hacks with resetting 'c' to zero and decreasing inputpointer by boolean parameter to skipcomment and skipoldtpcomment. This parameter specifies whether first character of comment should be read.
- in_asm_string also rendered useless by r32828, removed.

git-svn-id: trunk@32836 -
2016-01-03 17:07:15 +00:00
sergei
bbfbab7e0c * Moved handling of comments and line breaks in assembler blocks from scanner to tokenizer level. Handling them at character level was causing compiler to accept comments in the middle of any assembler token, which should never happen. It was also causing Mantis #27459: a newline immediately after closing 'end' token was first handled in asmgetchar and then by normal parser, causing all subsequent line numbering to be off by one.
git-svn-id: trunk@32828 -
2016-01-02 06:17:14 +00:00