+ add a new modeswitch ArrayOperators which is set by default in Delphi modes that enables the internal array operators (currently only "+")

git-svn-id: trunk@39259 -
This commit is contained in:
svenbarth 2018-06-20 19:53:43 +00:00
parent 9b45f58c0b
commit 97acf24290
5 changed files with 12 additions and 7 deletions

4
.gitattributes vendored
View File

@ -185,9 +185,9 @@ compiler/fppu.pas svneol=native#text/plain
compiler/gendef.pas svneol=native#text/plain
compiler/generic/cpuinfo.pas svneol=native#text/plain
compiler/generic/symcpu.pas svneol=native#text/plain
compiler/globals.pas svneol=native#text/plain
compiler/globals.pas -text svneol=native#text/plain
compiler/globstat.pas svneol=native#text/pascal
compiler/globtype.pas svneol=native#text/plain
compiler/globtype.pas -text svneol=native#text/plain
compiler/hlcg2ll.pas svneol=native#text/plain
compiler/hlcgobj.pas svneol=native#text/plain
compiler/html/i386/readme.txt svneol=native#text/plain

View File

@ -54,7 +54,8 @@ interface
[m_delphi,m_class,m_objpas,m_result,m_string_pchar,
m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
m_out,m_default_para,m_duplicate_names,m_hintdirective,
m_property,m_default_inline,m_except,m_advanced_records];
m_property,m_default_inline,m_except,m_advanced_records,
m_array_operators];
delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring];
fpcmodeswitches =
[m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward,

View File

@ -438,7 +438,8 @@ interface
m_blocks, { support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension) }
m_isolike_io, { I/O as it required by an ISO compatible compiler }
m_isolike_program_para, { program parameters as it required by an ISO compatible compiler }
m_isolike_mod { mod operation as it is required by an iso compatible compiler }
m_isolike_mod, { mod operation as it is required by an iso compatible compiler }
m_array_operators { use Delphi compatible array operators instead of custom ones ("+") }
);
tmodeswitches = set of tmodeswitch;
@ -626,7 +627,8 @@ interface
'CBLOCKS',
'ISOIO',
'ISOPROGRAMPARAS',
'ISOMOD'
'ISOMOD',
'ARRAYOPERATORS'
);

View File

@ -515,7 +515,9 @@ implementation
end;
{ <dyn. array> + <dyn. array> is handled by the compiler }
if (treetyp=addn) and (is_dynamic_array(ld) or is_dynamic_array(rd)) then
if (m_array_operators in current_settings.modeswitches) and
(treetyp=addn) and
(is_dynamic_array(ld) or is_dynamic_array(rd)) then
begin
allowed:=false;
exit;

View File

@ -3436,7 +3436,7 @@ implementation
{ Can we optimize multiple dyn. array additions into a single call?
This need to be done on a complete tree to detect the multiple
add nodes and is therefor done before the subtrees are processed }
if canbemultidynarrayadd(self) then
if (m_array_operators in current_settings.modeswitches) and canbemultidynarrayadd(self) then
begin
result:=genmultidynarrayadd(self);
exit;