mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 17:09:16 +02:00
+ 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:
parent
9b45f58c0b
commit
97acf24290
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -185,9 +185,9 @@ compiler/fppu.pas svneol=native#text/plain
|
|||||||
compiler/gendef.pas svneol=native#text/plain
|
compiler/gendef.pas svneol=native#text/plain
|
||||||
compiler/generic/cpuinfo.pas svneol=native#text/plain
|
compiler/generic/cpuinfo.pas svneol=native#text/plain
|
||||||
compiler/generic/symcpu.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/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/hlcg2ll.pas svneol=native#text/plain
|
||||||
compiler/hlcgobj.pas svneol=native#text/plain
|
compiler/hlcgobj.pas svneol=native#text/plain
|
||||||
compiler/html/i386/readme.txt svneol=native#text/plain
|
compiler/html/i386/readme.txt svneol=native#text/plain
|
||||||
|
@ -54,7 +54,8 @@ interface
|
|||||||
[m_delphi,m_class,m_objpas,m_result,m_string_pchar,
|
[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_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
|
||||||
m_out,m_default_para,m_duplicate_names,m_hintdirective,
|
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];
|
delphiunicodemodeswitches = delphimodeswitches + [m_systemcodepage,m_default_unicodestring];
|
||||||
fpcmodeswitches =
|
fpcmodeswitches =
|
||||||
[m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward,
|
[m_fpc,m_string_pchar,m_nested_comment,m_repeat_forward,
|
||||||
|
@ -438,7 +438,8 @@ interface
|
|||||||
m_blocks, { support for http://en.wikipedia.org/wiki/Blocks_(C_language_extension) }
|
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_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_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;
|
tmodeswitches = set of tmodeswitch;
|
||||||
|
|
||||||
@ -626,7 +627,8 @@ interface
|
|||||||
'CBLOCKS',
|
'CBLOCKS',
|
||||||
'ISOIO',
|
'ISOIO',
|
||||||
'ISOPROGRAMPARAS',
|
'ISOPROGRAMPARAS',
|
||||||
'ISOMOD'
|
'ISOMOD',
|
||||||
|
'ARRAYOPERATORS'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -515,7 +515,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ <dyn. array> + <dyn. array> is handled by the compiler }
|
{ <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
|
begin
|
||||||
allowed:=false;
|
allowed:=false;
|
||||||
exit;
|
exit;
|
||||||
|
@ -3436,7 +3436,7 @@ implementation
|
|||||||
{ Can we optimize multiple dyn. array additions into a single call?
|
{ Can we optimize multiple dyn. array additions into a single call?
|
||||||
This need to be done on a complete tree to detect the multiple
|
This need to be done on a complete tree to detect the multiple
|
||||||
add nodes and is therefor done before the subtrees are processed }
|
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
|
begin
|
||||||
result:=genmultidynarrayadd(self);
|
result:=genmultidynarrayadd(self);
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user