mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 00:29:19 +02:00
* mark each target switch with whether it's global or not, so a compiler
directive can be added that enables changing the local ones git-svn-id: trunk@23562 -
This commit is contained in:
parent
185f71762f
commit
4022c29500
@ -511,7 +511,7 @@ interface
|
|||||||
function UpdateOptimizerStr(s:string;var a:toptimizerswitches):boolean;
|
function UpdateOptimizerStr(s:string;var a:toptimizerswitches):boolean;
|
||||||
function UpdateWpoStr(s: string; var a: twpoptimizerswitches): boolean;
|
function UpdateWpoStr(s: string; var a: twpoptimizerswitches): boolean;
|
||||||
function UpdateDebugStr(s:string;var a:tdebugswitches):boolean;
|
function UpdateDebugStr(s:string;var a:tdebugswitches):boolean;
|
||||||
function UpdateTargetSwitchStr(s: string; var a: ttargetswitches): boolean;
|
function UpdateTargetSwitchStr(s: string; var a: ttargetswitches; global: boolean): boolean;
|
||||||
function IncludeFeature(const s : string) : boolean;
|
function IncludeFeature(const s : string) : boolean;
|
||||||
function SetMinFPConstPrec(const s: string; var a: tfloattype) : boolean;
|
function SetMinFPConstPrec(const s: string; var a: tfloattype) : boolean;
|
||||||
|
|
||||||
@ -1342,7 +1342,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function UpdateTargetSwitchStr(s: string; var a: ttargetswitches): boolean;
|
function UpdateTargetSwitchStr(s: string; var a: ttargetswitches; global: boolean): boolean;
|
||||||
var
|
var
|
||||||
tok,
|
tok,
|
||||||
value : string;
|
value : string;
|
||||||
@ -1387,7 +1387,10 @@ implementation
|
|||||||
end;
|
end;
|
||||||
if found then
|
if found then
|
||||||
begin
|
begin
|
||||||
if not TargetSwitchStr[opt].hasvalue then
|
if not global and
|
||||||
|
TargetSwitchStr[opt].isglobal then
|
||||||
|
result:=false
|
||||||
|
else if not TargetSwitchStr[opt].hasvalue then
|
||||||
begin
|
begin
|
||||||
if gotvalue then
|
if gotvalue then
|
||||||
result:=false;
|
result:=false;
|
||||||
|
@ -278,6 +278,7 @@ interface
|
|||||||
ttargetswitchinfo = record
|
ttargetswitchinfo = record
|
||||||
name: string[22];
|
name: string[22];
|
||||||
hasvalue: boolean;
|
hasvalue: boolean;
|
||||||
|
isglobal: boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -296,13 +297,13 @@ interface
|
|||||||
'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
|
'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
|
||||||
|
|
||||||
TargetSwitchStr : array[ttargetswitch] of ttargetswitchinfo = (
|
TargetSwitchStr : array[ttargetswitch] of ttargetswitchinfo = (
|
||||||
(name: ''; hasvalue: false),
|
(name: ''; hasvalue: false; isglobal: true ),
|
||||||
(name: 'SMALLTOC'; hasvalue: false),
|
(name: 'SMALLTOC'; hasvalue: false; isglobal: true ),
|
||||||
(name: 'COMPACTINTARRAYINIT'; hasvalue: false),
|
(name: 'COMPACTINTARRAYINIT'; hasvalue: false; isglobal: true ),
|
||||||
(name: 'ENUMFIELDINIT'; hasvalue: false),
|
(name: 'ENUMFIELDINIT'; hasvalue: false; isglobal: true ),
|
||||||
(name: 'AUTOGETTERPREFIX'; hasvalue: true ),
|
(name: 'AUTOGETTERPREFIX'; hasvalue: true ; isglobal: false),
|
||||||
(name: 'AUTOSETTERPREFIX'; hasvalue: true ),
|
(name: 'AUTOSETTERPREFIX'; hasvalue: true ; isglobal: false),
|
||||||
(name: 'THUMBINTERWORKING'; hasvalue: true )
|
(name: 'THUMBINTERWORKING'; hasvalue: false; isglobal: true )
|
||||||
);
|
);
|
||||||
|
|
||||||
{ switches being applied to all CPUs at the given level }
|
{ switches being applied to all CPUs at the given level }
|
||||||
|
@ -976,7 +976,7 @@ begin
|
|||||||
include(init_settings.moduleswitches,cs_create_smart);
|
include(init_settings.moduleswitches,cs_create_smart);
|
||||||
'T' :
|
'T' :
|
||||||
begin
|
begin
|
||||||
if not UpdateTargetSwitchStr(copy(more,j+1,length(more)),init_settings.targetswitches) then
|
if not UpdateTargetSwitchStr(copy(more,j+1,length(more)),init_settings.targetswitches,true) then
|
||||||
IllegalPara(opt);
|
IllegalPara(opt);
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user